簡介
本檔案介紹使用者登入思科遙測代理(CTB)Web使用者介面(UI)時疑難排解「502」錯誤的程式。
必要條件
程式
有時,使用者無法在完成軟體更新後立即登入到CTB Manager Web UI。Web UI顯示Request failed with status code 502 error:
telegraf服務發生錯誤時會發生這種情況。要確認這是您的案例,請按照以下步驟操作:
- 使用admin憑據通過SSH登入到CTB管理器節點。
- 運行sudo su命令並輸入admin的密碼,以獲得root使用者的完全訪問許可權。
- 一旦您擁有root訪問許可權,請檢視telegraf-collector和ti-frontend容器服務的最新日誌。為此,請運行以下兩個命令:
- docker logs -f telegraf-collector
- docker logs -f鈦前端
- 在telegraf-collector日誌中顯示以下錯誤:
root@mexsna-ctb-mgr-node:/home/admin# docker logs -f telegraf-collector
Running as collector
2022-12-16T23:10:11Z I! Starting Telegraf 1.19.1-titan
2022-12-16T23:10:11Z I! Loaded inputs: disk mem system
2022-12-16T23:10:11Z I! Loaded aggregators:
2022-12-16T23:10:11Z I! Loaded processors:
2022-12-16T23:10:11Z I! Loaded outputs: http
2022-12-16T23:10:11Z I! Tags enabled:
2022-12-16T23:10:11Z I! [agent] Config: Interval:1m0s, Quiet:false, Hostname:"", Flush Interval:10s
2022-12-16T23:11:02Z E! [agent] Error writing to outputs.http: when writing to [http://localhost/telegraf] received status code: 500
2022-12-16T23:11:17Z E! [agent] Error writing to outputs.http: when writing to [http://localhost/telegraf] received status code: 500
2022-12-16T23:11:31Z E! [agent] Error writing to outputs.http: when writing to [http://localhost/telegraf] received status code: 500
- 從Titanium-frontend 記錄auth request unexpected status: 502 while sending to client and connection rejected errors are displayed:
root@mexsna-ctb-mgr-node:/home/admin# docker logs -f titanium-frontend
2022/12/16 23:10:13 [error] 15#15: *4 auth request unexpected status: 502 while sending to client, client: 10.64.0.66, server: , request: "POST /telegraf HTTP/1.0", host: "10.64.0.65"
2022/12/16 23:10:20 [error] 15#15: *8 auth request unexpected status: 502 while sending to client, client: 10.64.0.67, server: , request: "POST /telegraf HTTP/1.0", host: "10.64.0.65"
2022/12/16 23:10:21 [error] 15#15: *10 connect() failed (111: Connection refused) while connecting to upstream, client: 169.254.64.10, server: , request: "GET /api-v1/node-manager HTTP/1.0", upstream: "http://169.254.64.8:8000/api-v1/node-manager", host: "
2022/12/16 23:10:23 [error] 15#15: *12 connect() failed (111: Connection refused) while connecting to upstream, client: 10.64.0.67, server: , request: "GET /api-v1/node-manager/config-v2 HTTP/1.0", upstream: "http://169.254.64.8:8000/api-v1/node-manager/config-v2", host: "10.64.0.65"
2022/12/16 23:10:26 [error] 15#15: *14 connect() failed (111: Connection refused) while connecting to upstream, client: 169.254.64.10, server: , request: "GET /api-v1/node-manager HTTP/1.0", upstream: "http://169.254.64.8:8000/api-v1/node-manager", host: "titanium-frontend:8080"
2022/12/16 23:10:28 [error] 15#15: *16 connect() failed (111: Connection refused) while connecting to upstream, client: 10.64.0.66, server: , request: "POST /telegraf HTTP/1.0", subrequest: "/api-v1/node-manager/auth", upstream: "http://169.254.64.8:8000/api-v1/node-manager/auth", host: "10.64.0.65"
2022/12/16 23:11:02 [error] 15#15: *54 auth request unexpected status: 502 while sending to client, client: 169.254.64.10, server: , request: "POST /telegraf HTTP/1.0", host: "titanium-frontend:8080"
如果CTB管理器上的/var/lib/titan分割槽的利用率幾乎已滿(超過90%),則可能發生此行為。運行df -h 命令以檢查磁碟利用率:
root@mexsna-ctb-mgr-node:/home/admin# df -h
Filesystem Size Used Avail Use% Mounted on
udev 3.9G 0 3.9G 0% /dev
tmpfs 798M 1.4M 797M 1% /run
/dev/sda4 15G 3.6G 11G 26% /
tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/sda2 227M 146M 65M 70% /boot
/dev/sda6 49G 45G 1.5G 97% /var/lib/titan
/dev/sda5 15G 3.6G 11G 26% /mnt/alt_root
此行為的解決方案是擴展CTB管理器的磁碟大小。為此,請執行思科遙測代理v1.3.1使用手冊中介紹的擴展思科遙測代理管理器和代理節點磁碟大小過程。
一旦分配了更多的磁碟空間,並且您確認/var/lib/titan分割槽的利用率不再超過90%,就可以再次訪問CTB Manager Web UI。
注意:根據不同的有經驗行為,分配更多磁碟空間後,可能需要4小時才能再次訪問CTB Manager Web UI。
相關資訊