【以下的问题经过翻译处理】 我为我的Elastic Beanstalk 环境开启了增强健康报告。环境是:
- 在“Amazon Linux 2”上运行多容器 Docker 设置。
- 它有一个 nginx 代理(配置 > 软件显示:日志流:已禁用 / 代理服务器:nginx / 轮换日志:已禁用 / X-Ray 守护程序:已禁用)。
- 开启了增强监控(才用了一下操作:配置 > 监控显示:CloudWatch 自定义指标-环境:CloudWatch 自定义指标-实例:/ 健康事件日志流:已禁用 / 忽略 HTTP 4xx:已启用 / 忽略负载均衡器 4xx:已禁用 系统:增强)。
但是在健康页面上,请求、响应或延迟字段都没有被填充,而负载和 CPU 利用率被填充了。我理解这些数据是从写入“/var/log/nginx/healthd/”目录下的日志文件中填充的,但是这个目录是空的。这好像是一个 bug 或某种错误配置。有人知道是怎么回事吗?
以下是一些相关信息:
healthd 配置文件(我注释掉了实际文件中的 UUID 的 group_id
):
$ cat /etc/healthd/config.yaml
group_id: XXXX
log_to_file: true
endpoint: https://elasticbeanstalk-health.us-east-2.amazonaws.com
appstat_log_path: /var/log/nginx/healthd/application.log
appstat_unit: sec
appstat_timestamp_on: completion
healthd 守护程序日志的输出,显示未找到先前的 application.log.YYYY-MM-DD-HH 文件的警告:
$ head /var/log/healthd/daemon.log
# Logfile created on 2022-04-02 21:02:22 +0000 by logger .rb/66358
A, [2022-04-02T21:02:24.123304 #4122] ANY -- : healthd daemon 1.0.6 initialized
W, [2022-04-02T21:02:24.266469 #4122] WARN -- : log file "/var/log/nginx/healthd/application.log.2022-04-02-21" does not exist
W, [2022-04-02T21:02:29.266806 #4122] WARN -- : log file "/var/log/nginx/healthd/application.log.2022-04-02-21" does not exist
W, [2022-04-02T21:02:34.404332 #4122] WARN -- : log file "/var/log/nginx/healthd/application.log.2022-04-02-21" does not exist
W, [2022-04-02T21:02:39.406846 #4122] WARN -- : log file "/var/log/nginx/healthd/application.log.2022-04-02-21" does not exist
W, [2022-04-02T21:02:44.410108 #4122] WARN -- : log file "/var/log/nginx/healthd/application.log.2022-04-02-21" does not exist
W, [2022-04-02T21:02:49.410342 #4122] WARN -- : log file "/var/log/nginx/healthd/application.log.2022-04-02-21" does not exist
W, [2022-04-02T21:02:54.410611 #4122] WARN -- : log file "/var/log/nginx/healthd/application.log.2022-04-02-21" does not exist
W, [2022-04-02T21:02:59.410860 #4122] WARN -- : log file "/var/log/nginx/healthd/application.log.2022-04-02-21" does not exist
/var/logs/nginx/ 路径以及他的perms和ownership。Nginx应不应该有healthd呢?
$ ls -l /var/log/nginx/
total 12
-rw-r--r-- 1 root root 11493 Apr 4 21:15 access.log
drwxr-xr-x 2 nginx nginx 6 Apr 2 21:01 healthd
drwxr-xr-x 2 root root 6 Apr 2 21:02 rotated
/var/logs/nginx/healthd/路径是空的
$ ls /var/log/nginx/healthd/
# this directory is empty