使用 Line 開線上會議

 

疫情的關係,線上會議的需求大增,上班主要是使用 Zoom,現在 Line 也可以了~~~

教學就參考 — 「LINE 會議室」上線!不需拉群組,有連結即可加入更方便!

手機跟電腦都可以使用,不失為另一種選擇!

張貼在 COVID-19, 線上會議 | 發表留言

NSX-T BGP keepalive/holdtime的預設值

 

NSX-T 3.0 T0對外【Uplink】只支援 BGP ,3.1 版 T0對外,才有支援 BGP/OSPF,當然,Static Route也是可以使用的。

那麼,這個冷門的問題,到底 NSX-T T0對外的 BGP,keepalive 及 holdtime 預設值是多少?

先來看看 Cisco:

https://www.cisco.com/c/en/us/td/docs/ios/iproute_bgp/command/reference/irg_book/irg_bgp4.html

image

NSX-T 3.1

https://docs.vmware.com/en/VMware-NSX-T-Data-Center/3.1/nsxt_31_admin.pdf

image

vCloud Cloud 10,搭配 NSX-V,使用 Edge Service Gateway,倒是很明白的講預設值是多少

https://docs.vmware.com/en/VMware-Cloud-Director/10.0/com.vmware.vcloud.tenantportal.doc/GUID-AF7F4DF0-D667-413F-81B9-B6A386EF7526.html

image

當然,這是因為NSX-V 6.4,也是很明白的講清楚預設值

https://docs.vmware.com/en/VMware-NSX-Data-Center-for-vSphere/6.4/nsx_64_admin.pdf

image

 

這只是預設值而已,當然是可以改的,但是,記得要維持 hold down timer 是 keep alive timer 的三倍或三倍以上

https://docs.vmware.com/en/VMware-NSX-T-Data-Center/3.0/nsxt_30_admin.pdf

image

張貼在 Cisco, 網路, 虛擬化, NSX, VMware | 發表留言

Docker Hub Rate Limit – 關於 Docker 官網的下載限制

2020,11,20 開始,Docker官網新增一個下載的限制

https://www.docker.com/increase-rate-limits

image

限制的條件是:

匿名的連線,每小時可以下載【 pull】 100 個 container images

使用 free account 登入,每小時可以下載【pull】200個 container images

Docker Pro 或 Docker Team 帳號登入,每二十四小時可以下載【pull】50,000個container images

該要如何檢查 pull rate limit 呢?

需要使用 jq,一個輕量級的 JSON 解析工具

[root@docker ~]# rpm -qi jq
Name        : jq
Version     : 1.6
Release     : 2.el7
Architecture: x86_64
Install Date: Mon 22 Mar 2021 11:06:07 AM CST
Group       : Unspecified
Size        : 390033
License     : MIT and ASL 2.0 and CC-BY and GPLv3
Signature   : RSA/SHA256, Fri 29 May 2020 01:31:39 AM CST, Key ID 6a2faea2352c64e5
Source RPM  : jq-1.6-2.el7.src.rpm
Build Date  : Thu 28 May 2020 05:48:09 AM CST
Build Host  : buildvm-14.phx2.fedoraproject.org
Relocations : (not relocatable)
Packager    : Fedora Project
Vendor      : Fedora Project
URL         : http://stedolan.github.io/jq/
Bug URL     : https://bugz.fedoraproject.org/jq
Summary     : Command-line JSON processor
Description :
lightweight and flexible command-line JSON processor

 jq is like sed for JSON data – you can use it to slice
 and filter and map and transform structured data with
 the same ease that sed, awk, grep and friends let you
 play with text.

 It is written in portable C, and it has zero runtime
 dependencies.

 jq can mangle the data format that you have into the
 one that you want with very little effort, and the
 program to do so is often shorter and simpler than
 you'd expect.

要先安裝 epel 才能安裝 jq

[root@docker ~]# yum install epel-release -y
Loaded plugins: fastestmirror, langpacks, product-id, search-disabled-repos, subscription-manager

This system is not registered with an entitlement server. You can use subscription-manager to register.

Loading mirror speeds from cached hostfile
 * base: mirror01.idc.hinet.net
 * extras: mirror01.idc.hinet.net
 * updates: mirror01.idc.hinet.net
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-11 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==================================================================================================================================================
 Package                                Arch                             Version                           Repository                        Size
==================================================================================================================================================
Installing:
 epel-release                           noarch                           7-11                              extras                            15 k

Transaction Summary
==================================================================================================================================================
Install  1 Package

Total download size: 15 k
Installed size: 24 k
Downloading packages:
epel-release-7-11.noarch.rpm                                                                                               |  15 kB  00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : epel-release-7-11.noarch                                                                                                       1/1
  Verifying  : epel-release-7-11.noarch                                                                                                       1/1

Installed:
  epel-release.noarch 0:7-11

Complete!

然後就可以安裝 jq

[root@docker ~]# yum install jq -y
Loaded plugins: fastestmirror, langpacks, product-id, search-disabled-repos, subscription-manager

This system is not registered with an entitlement server. You can use subscription-manager to register.

Loading mirror speeds from cached hostfile
 * base: mirror01.idc.hinet.net
 * epel: mirror.earthlink.iq
 * extras: mirror01.idc.hinet.net
 * updates: mirror01.idc.hinet.net
epel/x86_64/primary_db                                                                                                     | 6.9 MB  00:00:19
Resolving Dependencies
--> Running transaction check
---> Package jq.x86_64 0:1.6-2.el7 will be installed
--> Processing Dependency: libonig.so.5()(64bit) for package: jq-1.6-2.el7.x86_64
--> Running transaction check
---> Package oniguruma.x86_64 0:6.8.2-1.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==================================================================================================================================================
 Package                             Arch                             Version                                Repository                      Size
==================================================================================================================================================
Installing:
 jq                                  x86_64                           1.6-2.el7                              epel                           167 k
Installing for dependencies:
 oniguruma                           x86_64                           6.8.2-1.el7                            epel                           181 k

Transaction Summary
==================================================================================================================================================
Install  1 Package (+1 Dependent package)

Total download size: 348 k
Installed size: 1.0 M
Downloading packages:
warning: /var/cache/yum/x86_64/7/epel/packages/jq-1.6-2.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY01 kB  00:00:03 ETA
Public key for jq-1.6-2.el7.x86_64.rpm is not installed
(1/2): jq-1.6-2.el7.x86_64.rpm                                                                                             | 167 kB  00:00:01
oniguruma-6.8.2-1.el7.x86_64.r FAILED
http://my.mirrors.thegigabit.com/epel/7/x86_64/Packages/o/oniguruma-6.8.2-1.el7.x86_64.rpm: [Errno 12] Timeout on http://my.mirrors.thegigabit.com/epel/7/x86_64/Packages/o/oniguruma-6.8.2-1.el7.x86_64.rpm: (28, 'Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds')
Trying other mirror.
(2/2): oniguruma-6.8.2-1.el7.x86_64.rpm                                                                                    | 181 kB  00:00:00
--------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                              11 kB/s | 348 kB  00:00:31
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Importing GPG key 0x352C64E5:
 Userid     : "Fedora EPEL (7) "
 Fingerprint: 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5
 Package    : epel-release-7-11.noarch (@extras)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : oniguruma-6.8.2-1.el7.x86_64                                                                                                   1/2
  Installing : jq-1.6-2.el7.x86_64                                                                                                            2/2
  Verifying  : oniguruma-6.8.2-1.el7.x86_64                                                                                                   1/2
  Verifying  : jq-1.6-2.el7.x86_64                                                                                                            2/2

Installed:
  jq.x86_64 0:1.6-2.el7

Dependency Installed:
  oniguruma.x86_64 0:6.8.2-1.el7

Complete!

RPM套件都安裝完成之後,寫個 script 來檢查

[root@docker ~]# vi check_docker_pull_rate_limit.sh
[root@docker ~]#
[root@docker ~]# cat check_docker_pull_rate_limit.sh
#!/bin/bash
# 2021.3.22 Mon Version 0.0.1 Anderson Wang
#           檢查 docker 網站的 pull rate limit【下載限制】
rpm -q jq &> /dev/null || echo "Please install jq first"
TOKEN=$(curl "https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimitpreview/test:pull" | jq -r .token)
curl --head -H "Authorization: Bearer $TOKEN" https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest

實際檢查一下現在的 docker pull rate limit

[root@docker ~]# chmod 755 check_docker_pull_rate_limit.sh
[root@docker ~]#
[root@docker ~]# ./check_docker_pull_rate_limit.sh

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  4369    0  4369    0     0   4652      0 --:--:-- --:--:-- --:--:--  4657
HTTP/1.1 200 OK
Content-Length: 2782
Content-Type: application/vnd.docker.distribution.manifest.v1+prettyjws
Docker-Content-Digest: sha256:767a3815c34823b355bed31760d5fa3daca0aec2ce15b217c9cd83229e0e2020
Docker-Distribution-Api-Version: registry/2.0
Etag: "sha256:767a3815c34823b355bed31760d5fa3daca0aec2ce15b217c9cd83229e0e2020"
Date: Mon, 22 Mar 2021 03:27:01 GMT
Strict-Transport-Security: max-age=31536000
RateLimit-Limit: 100;w=21600
RateLimit-Remaining: 100;w=21600



100 是還可以下載 100 個 container images

2160021600秒,相當於 6 小時

實際上來測試一下

[root@docker ~]# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
[root@docker ~]# docker pull busybox
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
[root@docker ~]#
[root@docker ~]# ./check_docker_pull_rate_limit.sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  4369    0  4369    0     0   4659      0 --:--:-- --:--:-- --:--:--  4662
HTTP/1.1 200 OK
Content-Length: 2782
Content-Type: application/vnd.docker.distribution.manifest.v1+prettyjws
Docker-Content-Digest: sha256:767a3815c34823b355bed31760d5fa3daca0aec2ce15b217c9cd83229e0e2020
Docker-Distribution-Api-Version: registry/2.0
Etag: "sha256:767a3815c34823b355bed31760d5fa3daca0aec2ce15b217c9cd83229e0e2020"
Date: Mon, 22 Mar 2021 03:34:43 GMT
Strict-Transport-Security: max-age=31536000
RateLimit-Limit: 100;w=21600
RateLimit-Remaining: 100;w=21600

好奇怪,並沒有減少~~~

寫個迴圈來挑戰一下 docker pull rate limit

[root@docker ~]# vi test_docker_rate.sh
[root@docker ~]#
[root@docker ~]# cat test_docker_rate.sh
#!/bin/bash
for i in $(seq 1 50)
do
  docker stop $(docker ps -aq) > /dev/null 2>&1
  docker rm $(docker ps -aq) > /dev/null 2>&1
  docker rmi -f $(docker images -aq) > /dev/null 2>&1
  echo -n "$(date +%Y%m%d%H%M%S)"
  echo -n "---"
  echo ${i}
  docker pull busybox
  sleep 1
  docker pull alpine
  sleep 1
done

暴力式的測試

[root@docker ~]# ./test_docker_rate.sh
20210322114055---1
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322114108---2
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322114120---3
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322114132---4
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322114144---5
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322114156---6
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322114209---7
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322114221---8
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322114233---9
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322114245---10
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322114257---11
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322114309---12
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322114321---13
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322114334---14
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322114346---15
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322114358---16
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322114410---17
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322114422---18
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322114435---19
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322114447---20
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322114459---21
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322114511---22
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322114524---23
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322114536---24
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322114548---25
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322114600---26
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322114613---27
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322114625---28
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322114637---29
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322114649---30
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322114701---31
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322114713---32
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322114726---33
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322114738---34
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322114750---35
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322114802---36
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322114814---37
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322114826---38
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322114838---39
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322114850---40
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322114902---41
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322114914---42
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322114927---43
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322114939---44
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322114951---45
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322115003---46
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322115015---47
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322115027---48
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322115039---49
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322115051---50
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest


下載 100 個 container images 之後,再檢查一下

[root@docker ~]# ./check_docker_pull_rate_limit.sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  4369    0  4369    0     0   4650      0 --:--:-- --:--:-- --:--:--  4647
HTTP/1.1 200 OK
Content-Length: 2782
Content-Type: application/vnd.docker.distribution.manifest.v1+prettyjws
Docker-Content-Digest: sha256:767a3815c34823b355bed31760d5fa3daca0aec2ce15b217c9cd83229e0e2020
Docker-Distribution-Api-Version: registry/2.0
Etag: "sha256:767a3815c34823b355bed31760d5fa3daca0aec2ce15b217c9cd83229e0e2020"
Date: Mon, 22 Mar 2021 04:00:56 GMT
Strict-Transport-Security: max-age=31536000
RateLimit-Limit: 100;w=21600
RateLimit-Remaining: 15;w=21600

好奇怪,竟然還可以下載 15 個~~~

頭都洗了,繼續測試下去~~~

再跑一次,這次只抓 20 * 2 個

[root@docker ~]# vi test_docker_rate.sh
[root@docker ~]#
[root@docker ~]# cat test_docker_rate.sh
#!/bin/bash
for i in $(seq 1 20)
do
  docker stop $(docker ps -aq) > /dev/null 2>&1
  docker rm $(docker ps -aq) > /dev/null 2>&1
  docker rmi -f $(docker images -aq) > /dev/null 2>&1
  echo -n "$(date +%Y%m%d%H%M%S)"
  echo -n "---"
  echo ${i}
  docker pull busybox
  sleep 1
  docker pull alpine
  sleep 1
done

這次終於如願的爆了~~~

[root@docker ~]# ./test_docker_rate.sh
20210322120818---1
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322120830---2
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322120843---3
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322120855---4
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322120907---5
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322120919---6
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322120932---7
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322120944---8
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322120956---9
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
latest: Pulling from docker.io/library/busybox
8b3d7e226fab: Pull complete
Digest: sha256:ce2360d5189a033012fbad1635e037be86f23b65cfd676b436d0931af390a2ac
Status: Downloaded newer image for docker.io/busybox:latest
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
ba3557a56b15: Pull complete
Digest: sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be
Status: Downloaded newer image for docker.io/alpine:latest
20210322121009---10
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit
20210322121016---11
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit
20210322121025---12
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit
20210322121033---13
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit
20210322121040---14
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit
20210322121048---15
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit
20210322121056---16
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit
20210322121104---17
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit
20210322121111---18
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit
20210322121119---19
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit
20210322121126---20
Using default tag: latest
Trying to pull repository docker.io/library/busybox ...
toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit
Using default tag: latest
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit

再次檢查 docker pull rate limit

[root@docker ~]# ./check_docker_pull_rate_limit.sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  4369    0  4369    0     0   4794      0 --:--:-- --:--:-- --:--:--  4790
HTTP/1.1 200 OK
Content-Length: 2782
Content-Type: application/vnd.docker.distribution.manifest.v1+prettyjws
Docker-Content-Digest: sha256:767a3815c34823b355bed31760d5fa3daca0aec2ce15b217c9cd83229e0e2020
Docker-Distribution-Api-Version: registry/2.0
Etag: "sha256:767a3815c34823b355bed31760d5fa3daca0aec2ce15b217c9cd83229e0e2020"
Date: Mon, 22 Mar 2021 04:12:45 GMT
Strict-Transport-Security: max-age=31536000
RateLimit-Limit: 100;w=21600
RateLimit-Remaining: 0;w=21600

果然歸零了!

image

匿名連線破表,再來改成用 free account 登入

image

果然可以下載!

再來使用 free account 登入,檢查 docker pull rate limit

先改一下檢查的 script

[root@docker ~]# vi check_docker_pull_rate_limit-freeaccount.sh
[root@docker ~]#
[root@docker ~]# cat check_docker_pull_rate_limit-freeaccount.sh
#!/bin/bash
# 2021.3.22 Mon Version 0.0.1 Anderson Wang
#           檢查 docker 網站的 pull rate limit【下載限制】
rpm -q jq &> /dev/null || echo "Please install jq first"
#TOKEN=$(curl "https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimitpreview/test:pull" | jq -r .token)
TOKEN=$(curl --user 'YourID:YourPASSWORD' "https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimitpreview/test:pull" | jq -r .token)
curl --head -H "Authorization: Bearer $TOKEN" https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest

使用 free account 檢查 docker pull rate limit

[root@docker ~]# ./check_docker_pull_rate_limit-freeaccount.sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  4465    0  4465    0     0   4706      0 --:--:-- --:--:-- --:--:--  4704
HTTP/1.1 200 OK
Content-Length: 2782
Content-Type: application/vnd.docker.distribution.manifest.v1+prettyjws
Docker-Content-Digest: sha256:767a3815c34823b355bed31760d5fa3daca0aec2ce15b217c9cd83229e0e2020
Docker-Distribution-Api-Version: registry/2.0
Etag: "sha256:767a3815c34823b355bed31760d5fa3daca0aec2ce15b217c9cd83229e0e2020"
Date: Mon, 22 Mar 2021 04:21:25 GMT
Strict-Transport-Security: max-age=31536000
RateLimit-Limit: 200;w=21600
RateLimit-Remaining: 199;w=21600

嗯,六小時內,還有 199 個 container images 可以下載!

結論是,如果匿名的 100 個已經滿了之後,就先 docker login -u <帳號>,改成使用 free account 就可以解掉這個限制了!

張貼在 CentOS 6, CentOS 7, CentOS 8, container, Docker, 虛擬化, kubernetes, Linux, RHEL 6, RHEL 7, RHEL 8, ubuntu | 發表留言

又一次的火星留名計畫 – SEND YOUR NAME TO MARS

 

上一次的火星留名計畫

這次的活動網址

https://mars.nasa.gov/participate/send-your-name/future

 

image

登記個人資料

image

又領到一張登機票了!目前已經有一千六百多萬人登記!

image

 

上一次的登機證

BoardingPass_MyNameOnInSight

上一次的人數比較少,兩百多萬人登記

image

張貼在 Bookmark, 生活, 旅遊, 一般 | 發表留言

清除 docker/podman/kubernetes 的資源

 

測試時,常常會建一大堆的物件,這時就需要清除全部資源。

 

docker環境的清除:

[root@docker ~]# cat docker_cleanall.sh
#!/bin/bash
# 2019.1.16 Wed Anderson Version 0.0.1
docker stop $(docker ps -aq)
docker rm $(docker ps -aq)
docker rmi -f $(docker images -aq)
[root@docker ~]# ./docker_cleanall.sh
"docker stop" requires at least 1 argument(s).
See 'docker stop --help'.

Usage:  docker stop [OPTIONS] CONTAINER [CONTAINER...]

Stop one or more running containers
"docker rm" requires at least 1 argument(s).
See 'docker rm --help'.

Usage:  docker rm [OPTIONS] CONTAINER [CONTAINER...]

Remove one or more containers
"docker rmi" requires at least 1 argument(s).
See 'docker rmi --help'.

Usage:  docker rmi [OPTIONS] IMAGE [IMAGE...]

Remove one or more images
[root@docker ~]# docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
[root@docker ~]# docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
[root@docker ~]# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE

 

podman 的清除:

[root@docker ~]# cat podman_cleanall.sh
#!/bin/bash
# 2020.3.17 Tue Anderson Version 0.0.1
# remove all containers+container images
podman stop -a
podman rm -a
podman rmi -a
[root@docker ~]# ./podman_cleanall.sh
[root@docker ~]#
[root@docker ~]# podman ps
CONTAINER ID  IMAGE  COMMAND  CREATED  STATUS  PORTS  NAMES
[root@docker ~]# podman ps -a
CONTAINER ID  IMAGE  COMMAND  CREATED  STATUS  PORTS  NAMES
[root@docker ~]# podman images
REPOSITORY   TAG   IMAGE ID   CREATED   SIZE

 

kubernetes(k8s)的清除:

[root@master ~]# cat kube_clean_all.sh
#!/bin/bash
# 2020.8.28 Fri Version 0.0.1
#               Anderson Wang
kubectl delete service --all
kubectl delete deployment --all
kubectl delete pod --all
kubectl delete pv --all
kubectl delete pvc --all
kubectl delete secrets --all
kubectl delete configmaps --all
[root@master ~]# ./kube_clean_all.sh
service "kubernetes" deleted
No resources found
No resources found
No resources found
No resources found
secret "default-token-29lmv" deleted
No resources found
張貼在 Bookmark, CentOS 6, CentOS 7, CentOS 8, 網路, Docker, kubernetes, Linux, RHEL 6, RHEL 7, RHEL 8, ubuntu | 發表留言

移轉 SQLite3 的 db for PHP

 

本以為 SQLite3 的 db 只有一個檔案,應該比 MySQL 之類的 database 方便備份/還原跟移轉,尤其是,指令是可以查詢到 table 清單,也可以顯示內容

# sqlite3 /tmp/test3.db
SQLite version 3.6.20
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .table
company  fight    hero     players <-- 可以查到 table 清單
sqlite> .quit

也可以查詢到 table 內的資料

# sqlite3 /tmp/test3.db SQLite version 3.6.20 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> select * from hero; <-- 可以查到 table 的內容 1|艾吉奧|1|0|1|||2|1|0|1 2|巫妖|1|1|2|||3|0|0|0 3|小小|1|0|1|||1|0|0|1

...以下省略...

另外單獨安裝了一台 RHEL 6.5 的虛擬機

# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.5 (Santiago)

RPM套件也都安裝了

# rpm -qa | grep httpd
httpd-2.2.15-29.el6_4.x86_64
httpd-tools-2.2.15-29.el6_4.x86_64

# rpm -qa | grep php
php-mysql-5.3.3-26.el6.x86_64
php-5.3.3-26.el6.x86_64
php-cli-5.3.3-26.el6.x86_64
php-common-5.3.3-26.el6.x86_64
php-pdo-5.3.3-26.el6.x86_64

連不相干的 MySQL 都安裝了

# rpm -qa | grep mysql
php-mysql-5.3.3-26.el6.x86_64
mysql-5.1.71-1.el6.x86_64
mysql-libs-5.1.71-1.el6.x86_64
mysql-server-5.1.71-1.el6.x86_64
mysql-devel-5.1.71-1.el6.x86_64

Apache 服務已經啟動

# service httpd status
httpd(pid  2248)正在執行...

# chkconfig httpd --list
httpd           0:off   1:off   2:on    3:on    4:on    5:on    6:off

 

防火牆規則全部都清除

# iptables -t filter -L -n
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

phpinfo 也都正常

# cat /var/www/html/phpinfo.php

image

但是,一但用 PHP 去開 SQLite3 的 db,就會出現無法開啟的錯誤訊息

# cat /var/www/html/test3.php
open("/tmp/test3.db");
      }
   }
   $db = new MyDB();
   //$db = new SQLite3('/tmp/test3.db');
   if(!$db)
     {
       echo $db->lastErrorMsg();
     }
   else
     {
      echo "Opened database successfully";
     }
?>

image

剛剛可以用指令查詢資料,內容沒問題,考慮到權限的問題,將檔案放到 /tmp,權限設定為 666

# ls -l /tmp/test3.db
-rw-rw-rw-. 1 apache apache 131072 Jul 31 15:57 /tmp/test3.db

所以,也不應該是權限的問題…

到這裡就卡關卡很久了…

一直到有一天,突發奇想的,將資料匯出再匯入

先匯出成 SQL 語法

# sqlite3 /tmp/test3.db
SQLite version 3.6.20
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .output /tmp/test3.sql
sqlite> .dump
sqlite> .exit
# ls -l /tmp/test3*
-rw-rw-rw-. 1 apache apache 131072 Jul 31 15:57 /tmp/test3.db
-rw-r--r--. 1 root   root   154192 Aug  8 14:05 /tmp/test3.sql

先用 PHP,Open 一個 SQLite 的 db

# cat /var/www/html/test5.php
open("/tmp/test5.db");
      }
   }
   $db = new MyDB();
   if(!$db)
     {
       echo $db->lastErrorMsg();
     }
   else
     {
      echo "Opened database successfully";
     }
?>

 

原本沒有 /tmp/test5.db,PHP會自己建一個新的 db

image

 

再用 SQL 語法,import 回去

# sqlite3 /tmp/test5.db
SQLite version 3.6.20
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .read /tmp/test3.sql
sqlite> .quit
# ls -l /tmp/test5.db
-rw-r--r--. 1 apache apache 130048 Aug  8 14:08 /tmp/test5.db

 

如此一來,就大功告成,無論是 sqlite3 指令,或是 PHP 網頁程式,都可以正常存取 SQLite3 db 的內容了!

張貼在 CentOS 6, CentOS 7, CentOS 8, Linux, MySQL, RHEL 6, RHEL 7, RHEL 8 | 發表留言

RHEL 6.x 版的網路設定

 

為了測試一個舊的系統,在 VMware Workstation 15.x 環境,安裝一台 RHEL 6.5 的虛擬機,沒想到,網路預設不 work …

[root@localhost ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.5 (Santiago)

每一次都要手動登入圖形介面,到右上角去點選一下【System eth0】,才有網路連線

image

這樣實在太麻煩,RHEL 6.x 實在太久沒用了,測試了一下才找到開機自動啟動網路的方法

 

預設啟動 NetworkManager 服務

[root@localhost ~]# chkconfig NetworkManager --list
NetworkManager  0:off   1:off   2:on    3:on    4:on    5:on    6:off

無論是 DHCP 或是固定 IP,重點是要關閉 NM_CONTROLLED

[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 TYPE=Ethernet ONBOOT=yes #NM_CONTROLLED=yes NM_CONTROLLED=no #BOOTPROTO=dhcp IPADDR=192.168.66.99 NETMASK=255.255.255.0 GATEWAY=192.168.66.2

這樣就大功告成,下回開機之後,網路預設就是啟動了!

張貼在 CentOS 6, 網路, Linux, RHEL 6, VMware | 發表留言

啟動 PHP 顯示錯誤訊息的功能

 

PHP程式如果遇到執行有問題,可以修改 /etc/php.ini,啟動顯示錯誤訊息的功能

; display_errors = Off
display_errors = On

重新啟動 httpd 服務

# systemctl restart httpd
張貼在 CentOS 6, CentOS 7, CentOS 8, Linux, RHEL 6, RHEL 7, RHEL 8 | 發表留言

RHEL 8 安裝遠端桌面(xrdp)服務

 

RHEL 7 的安裝要參考這一篇

RHEL 8 安裝 遠端桌面(xrdp) 服務

先安裝最新版的 EPEL【Extra Packages for Enterprise Linux】

CentOS 6 安裝 EPEL 看這裡

RHEL 7 安裝 EPEL 看這裡

# yum install --nogpgcheck https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm -y
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Last metadata expiration check: 0:47:00 ago on Thu 28 May 2020 04:31:29 PM CST.
epel-release-latest-8.noarch.rpm                                                                           26 kB/s |  22
Dependencies resolved.
=========================================================================================================================
 Package                            Arch                         Version                         Repository
=========================================================================================================================
Installing:
 epel-release                       noarch                       8-8.el8                         @commandline

Transaction Summary
=========================================================================================================================
Install  1 Package

Total size: 22 k
Installed size: 32 k
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :
  Installing       : epel-release-8-8.el8.noarch
  Running scriptlet: epel-release-8-8.el8.noarch
  Verifying        : epel-release-8-8.el8.noarch
Installed products updated.

Installed:
  epel-release-8-8.el8.noarch

Complete!

 

安裝 xrdp RPM套件

# yum install xrdp tigervnc-server -y
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Extra Packages for Enterprise Linux Modular 8 - x86_64                                 63 kB/s | 118 kB     00:01
Extra Packages for Enterprise Linux 8 - x86_64                                        1.1 MB/s | 6.8 MB     00:06
Dependencies resolved.
======================================================================================================================
 Package                  Arch            Version                 Repository                                     Size
======================================================================================================================
Installing:
 xrdp                     x86_64          1:0.9.13-1.el8          epel                                          444 k
 tigervnc-server          x86_64          1.9.0-9.el8             ucf-rhel-8-for-x86_64-appstream-rpms          252 k

Transaction Summary
======================================================================================================================
Install  2 Packages

Total download size: 696 k
Installed size: 3.1 M
Downloading Packages:
(1/2): tigervnc-server-1.9.0-9.el8.x86_64.rpm                                         2.7 MB/s | 252 kB     00:00
(2/2): xrdp-0.9.13-1.el8.x86_64.rpm                                                   1.5 MB/s | 444 kB     00:00
----------------------------------------------------------------------------------------------------------------------
Total                                                                                 709 kB/s | 696 kB     00:00
warning: /var/cache/dnf/epel-fafd94c310c51e1e/packages/xrdp-0.9.13-1.el8.x86_64.rpm: Header V3 RSA/SHA256 Signature, k                            ey ID 2f86d6a1: NOKEY
Extra Packages for Enterprise Linux 8 - x86_64                                        1.6 MB/s | 1.6 kB     00:00
Importing GPG key 0x2F86D6A1:
 Userid     : "Fedora EPEL (8) "
 Fingerprint: 94E2 79EB 8D8F 25B2 1810 ADF1 21EA 45AB 2F86 D6A1
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                              1/1
  Installing       : tigervnc-server-1.9.0-9.el8.x86_64                                                           1/2
  Running scriptlet: tigervnc-server-1.9.0-9.el8.x86_64                                                           1/2
  Installing       : xrdp-1:0.9.13-1.el8.x86_64                                                                   2/2
  Running scriptlet: xrdp-1:0.9.13-1.el8.x86_64                                                                   2/2
  Verifying        : xrdp-1:0.9.13-1.el8.x86_64                                                                   1/2
  Verifying        : tigervnc-server-1.9.0-9.el8.x86_64                                                           2/2
Installed products updated.

Installed:
  xrdp-1:0.9.13-1.el8.x86_64                            tigervnc-server-1.9.0-9.el8.x86_64

Complete!

 

啟動 xrdp 服務

# systemctl start xrdp
# systemctl enable xrdp
Created symlink /etc/systemd/system/multi-user.target.wants/xrdp.service → /usr/lib/systemd/system/xrdp.service.
# systemctl status xrdp
● xrdp.service - xrdp daemon
   Loaded: loaded (/usr/lib/systemd/system/xrdp.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2020-05-28 17:23:57 CST; 9s ago
     Docs: man:xrdp(8)
           man:xrdp.ini(5)
 Main PID: 8704 (xrdp)
    Tasks: 1 (limit: 74692)
   Memory: 1.0M
   CGroup: /system.slice/xrdp.service
           └─8704 /usr/sbin/xrdp --nodaemon

May 28 17:23:57 foundation28.ilt.example.com systemd[1]: Started xrdp daemon.
May 28 17:23:57 foundation28.ilt.example.com xrdp[8704]: (8704)(140388443059648)[INFO ] starting xrdp with pid 8704
May 28 17:23:57 foundation28.ilt.example.com xrdp[8704]: (8704)(140388443059648)[INFO ] address [0.0.0.0] port [3389] mo>
May 28 17:23:57 foundation28.ilt.example.com xrdp[8704]: (8704)(140388443059648)[INFO ] listening to port 3389 on 0.0.0.0
May 28 17:23:57 foundation28.ilt.example.com xrdp[8704]: (8704)(140388443059648)[INFO ] xrdp_listen_pp done

 

新增 firewall 規則

# firewall-cmd --list-all
trusted (active)
  target: ACCEPT
  icmp-block-inversion: no
  interfaces: br0 ens160
  sources:
  services:
  ports:
  protocols:
  masquerade: no
  forward-ports:
  source-ports:
  icmp-blocks:
  rich rules:

# firewall-cmd --zone=trusted --add-port=3389/tcp --permanent
success
# firewall-cmd --reload
success
# firewall-cmd --list-all
trusted (active)
  target: ACCEPT
  icmp-block-inversion: no
  interfaces: br0 ens160
  sources:
  services:
  ports: 3389/tcp
  protocols:
  masquerade: no
  forward-ports:
  source-ports:
  icmp-blocks:
  rich rules:

 

跟前一代 RHEL7 的時候比較,已經可以支援到 32bit ,全螢幕比較正常及穩定!

image

張貼在 Bookmark, CentOS 8, Linux, RHEL 8 | 發表留言

mrbs – OpenSource的線上會議室booking系統

 

MRBS https://mrbs.sourceforge.io/

線上會議室 booking 系統,Linux+Apache+PHP+MySQL/PostgreSQL

https://sourceforge.net/projects/mrbs/files/latest/download

下載回來的 zip 檔案,解壓縮就可以了。

初始化設定

將 mrbs*/web/config.inc.php-sample 更名為 mrbs*/web/config.inc.php【因為安全的考量,舊的檔案就不保留了!】

大約 40 行,設定時區

//$timezone = "Europe/London";
$timezone = "Asia/Taipei";

大約 57 行,設定要使用 MySQL 的哪個 database

MySQL要先建立 mrbs 資料庫

$db_database = "mrbs";

設定連線到 MySQL 使用的帳號/密碼

$db_login = "mrbs";
//$db_login = "root";
// Database login password:
//$db_password = 'mrbs-password';
$db_password = '12345678';

mrbs預設是對整個 Internet 開放的,如果架在公司內部,當然沒問題,如果是 Internet 可以存取,就建議取消 anonymous 登入

修改 mrbs*/web/systemdefaults.inc.php,大約 1038 行

//$auth['deny_public_access'] = false;
$auth['deny_public_access'] = true;

系統的套件安裝,除了標準的 httpdphpphp-mysqlmysql-server 之外,還需要安裝 php-json

服務需要啟動 httpd、mysqld

# systemctl status httpd
# systemctl status mysqld

MySQL 初始化,要執行 mysql_secure_installation,主要是設定 root 密碼

新增一個 database,名稱為 mrbs

然後建立 table 及相關 schema

mysql -u root -p mrbs < tables.my.sql

 

大概是這樣子吧!

image

 

以上是憑印象寫的,不知道會不會有遺漏…

張貼在 CentOS 6, CentOS 7, CentOS 8, Linux, MySQL, RHEL 6, RHEL 7, RHEL 8 | 發表留言