AWS ElasticBeanstalk增强的运行状况不报告Tomcat 7上的数据

时间:2018-07-20 14:52:27

标签: apache amazon-web-services tomcat7 elastic-beanstalk amazon-cloudwatch

AWS ElasticBeanstalk没有显示我的环境的任何请求或延迟数据:

Environment enhanced health dashboard

我已经按照文档中所述配置了环境,即启用了增强的运行状况报告和CloudWatch日志流:

Environment enhanced health configuration

我通过SSH进入实例以确认CloudWatch代理正在运行:

[ec2-user@ip-10-0-103-254 ~]$ sudo service awslogs status awslogs (pid 4955) is running...

这是代理的版本:

[ec2-user@ip-10-0-103-254 ~]$ sudo yum info awslogs Loaded plugins: priorities, update-motd, upgrade-helper Installed Packages Name : awslogs Arch : noarch Version : 1.1.2 Release : 1.10.amzn1 Size : 11 k Repo : installed From repo : amzn-main Summary : Scripts for CloudWatch Logs Daemon URL : http://aws.amazon.com/cloudwatch License : Amazon Software License Description : Scripts to run Amazon CloudWatch Logs as a daemon.

/var/log/awslogs.log 文件显示如下:

2018-07-19 03:59:12,011 - cwlogs.push.stream - WARNING - 3188 - Thread-1 - No file is found with given path '/var/log/httpd/error_log*'. 2018-07-19 03:59:12,011 - cwlogs.push.stream - WARNING - 3188 - Thread-1 - No file is found with given path '/var/log/httpd/access_log*'. 2018-07-19 03:59:12,012 - cwlogs.push.stream - WARNING - 3188 - Thread-1 - No file is found with given path '/var/log/nginx/error.log*'. 2018-07-19 03:59:12,012 - cwlogs.push.stream - WARNING - 3188 - Thread-1 - No file is found with given path '/var/log/nginx/access.log*'.

我正在使用Apache,因此不必担心找不到Nginx文件。事实是,文件 [...] / httpd / error_log access_log DO 存在于该目录中。但是,它们始终为空:

Empty log group for environment

由于我将Tomcat 7与Apache一起使用,因此我认为将 /var/log/tomcat7/localhost_access.txt 日志添加到CloudWatch流中可能会允许数据出现。这是我添加到流中的日志:

[/var/log/tomcat7/localhost_access_log.txt] log_group_name = `{"Fn::Join":["/", ["/aws/elasticbeanstalk", { "Ref":"AWSEBEnvironmentName" }, "var/log/tomcat7/localhost_access_log.txt"]]}` log_stream_name = {instance_id} file = /var/log/tomcat7/localhost_access_log*

然后,我重新启动了代理,但是它也不起作用。日志确实出现在CloudWatch上,但是没有向ElasticBeanstalk报告数据。

对其他地方有什么想法吗?我现在有点迷路了。

编辑

这是EB CLI的环境健康状况仪表板,用于我们其中一项服务的生产工作负载(使用eb health --refresh):

EB CLI health dashboard for production workload

0 个答案:

没有答案