简介
本文档介绍当用户登录到思科遥测代理(CTB)Web用户界面(UI)时,对“502”错误进行故障排除的过程。
先决条件
步骤
有时,用户无法在完成软件更新后立即登录到CTB Manager Web UI。Web UI显示Request failed with status code 502 错误:
当telegraf服务出现错误时会发生这种情况。要确认这是您的案例,请按照以下步骤操作:
- 使用admin凭证通过SSH登录CTB管理器节点。
- 运行sudo su命令并输入admin的密码,以获得作为根用户的完全访问权限。
- 当您拥有root权限后,请查看telegraf-collector和titi-frontend容器服务的最新日志。为此,请运行以下两个命令:
- docker logs -f telegraf-collector
- docker logs -f titan-frontend
- 从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记录身份验证请求意外状态: 502,同时向客户端发送,并显示连接拒绝错误:
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管理器的磁盘大小。为此,请执行Cisco遥测代理v1.3.1用户指南中所述的扩展思科遥测代理管理器和代理节点磁盘大小过程。
一旦分配了更多的磁盘空间,并且您确认/var/lib/titan分区的利用率不再超过90%,即可再次访问CTB管理器Web UI。
注意:根据不同的经验行为,分配更多磁盘空间后,可能需要4小时才能再次访问CTB管理器Web UI。
相关信息