OpenResty Edge™ 自檢工具的使用方法

1. 下載

curl -O https://openresty.com/client/oredge/openresty-edge-self-check.sh

2. 使用

執行自檢工具前,我們需要把工具傳輸到目標機器上。

2.1 預設模式

sudo bash openresty-edge-self-check.sh

2.2 詳細模式

sudo bash openresty-edge-self-check.sh -v

3. 案例

3.1 案例一

sudo bash openresty-edge-self-check.sh -v

[INFO] Processor: 32
[INFO] Memory: 32 GB
[INFO] Disk:
[INFO]   Filesystem   Size   Use%
[INFO]    /dev/sda2    50G    3%
[INFO] Firewall is disabled.
[INFO] Internet(IPv4) is up.
[INFO] The or-client.crt and or-client.key is match.
[INFO] The certificate or-client.crt remaining time greater than 30 days.
[INFO] openresty-edge-node is installed.
[INFO] oredge-node is running.
[INFO] oredge-node is listening on ports: 20717 8090 8091 11212.
[WARN] oredge-node is not listening on ports: 80 443 11212 8090 8091.
[WARN] There are error logs in /usr/local/oredge-node/logs/error.log, please confirm.
[INFO] Connect to openresty package server(pkg.openresty.com:443), Succeeded.
[INFO] Connect to Edge Admin(xx.xx.xx.xx:xxxx), Succeeded.
[INFO] Connect to Edge Log Server(xx.xx.xx.xx:xxxx), Succeeded.
[WARN] For more information: https://doc.openresty.com/en/edge-admin/troubleshooting

我們主要關注 WARN 級別的輸出,可以看到提示:

  • Edge Node 程序沒有在監聽預期會監聽的埠;
  • 日誌檔案中有錯誤日誌,需要檢查一下;
  • 展示了一個幫助頁,這是由於有需要我們確認的內容。

優先檢視錯誤日誌,看是否有明顯的錯誤訊息; 然後到幫助頁去看是否有對應的解決方案; 最後如果問題還無法解決,請直接聯絡我們。

3.2 案例二

sudo bash openresty-edge-self-check.sh -v

[INFO] Processor: 2
[INFO] Memory: 4 GB
[INFO] Disk:
[INFO]   Filesystem   Size   Use%
[INFO]   /dev/xvda1    40G   16%
[INFO] Firewall is disabled.
[INFO] Internet(IPv4) is up.
[INFO] The or-client.crt and or-client.key is match.
[INFO] The certificate or-client.crt remaining time greater than 30 days.
[INFO] openresty-edge-node is installed.
[INFO] oredge-node is running.
[INFO] oredge-node is listening on ports: 10808 8090 443 8091 12000 9090 11212 80 81.
[INFO] Connect to openresty package server(pkg.openresty.com:443), Succeeded.
[INFO] Connect to Edge Admin(xx.xx.xx.xx:xxxx), Succeeded.
[INFO] Connect to Edge Log Server(xx.xx.xx.xx:xxxx), Succeeded.

這個案例中所有檢查都透過了。