AWS:没有一个实例在发送数据 [英] AWS: None of the Instances are sending data

查看:19
本文介绍了AWS:没有一个实例在发送数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Amazon Web Services 设置 Elastic Beanstalk 应用程序,但是我收到了大量错误消息,消息 None of the instances are sent data.我已经尝试使用示例应用程序多次删除 Elastic Beanstalk 应用程序和 EC2 实例,然后再试一次,但我遇到了同样的错误.

I'm trying to set up an Elastic Beanstalk application with Amazon Web Services however I'm receiving a load of errors with the message None of the instances are sending data. I've tried deleting the Elastic Beanstalk Application and the EC2 instance several times with the sample application and trying again but I get the same error.

我还尝试使用 AWS Elastic Beanstalk 命令行工具上传烧瓶应用程序,但随后收到以下错误:

I also tried uploading a flask application with AWS Elastic Beanstalk command line tools but then I received the error below:

Environment health has transitioned from Pending to Severe. 100.0 % of the requests to the ELB are failing with HTTP 5xx. Insufficient request rate (0.5 requests/min) to determine application health (7 minutes ago). ELB health is failing or not available for all instances. None of the instances are sending data

为什么我会收到这个错误,我该如何解决?谢谢.

Why do I get this error and how do I fix it? Thanks.

推荐答案

您正在使用 增强型健康监测.通过增强的健康监控,agent 安装在您的 EC2 实例上,监控重要的系统和应用程序级别的健康指标,并将它们直接发送到 Elastic Beanstalk.

You are using Enhanced Health Monitoring. With enhanced health monitoring an agent installed on your EC2 instance monitors vital system and application level health metrics and sends them directly to Elastic Beanstalk.

当您看到没有任何实例正在发送数据"之类的错误消息时,这意味着实例上的代理已崩溃,或者由于网络错误或其他一些错误而无法将数据发布到 Elastic Beanstalk.

When you see an error message like "None of the instances are sending data", it means either the agent on the instance has crashed or it is unable to post data to Elastic Beanstalk due to networking error or some other error.

为了调试这个,我建议从 AWS 控制台下载完整日志".您可以按照从 Elastic Beanstalk 控制台下载捆绑日志"部分中的说明获取日志 这里.如果由于任何原因无法使用控制台下载日志,您还可以通过 ssh 连接到实例并查看 /var/log 中的日志.

For debugging this, I would recommend downloading "Full logs" from the AWS console. You can follow the instructions for getting logs in the section "Downloading Bundle Logs from Elastic Beanstalk Console" here. If you are unable to download logs using the console for any reason you can also ssh to the instance and look at the logs in /var/log.

您将在 /var/log/healthd/daemon.log 中找到健康代理的日志.对这种情况有用的其他日志是 /var/log/cfn-init.log/var/log/eb-cfn-init.log/var/log/eb-activity.log.您能否查看日志并提供您看到的错误的更多详细信息?这有望为您提供有关没有任何实例正在发送数据"错误的更多详细信息.

You will find logs for the health agent in /var/log/healthd/daemon.log. Additional logs useful for this situation are /var/log/cfn-init.log, /var/log/eb-cfn-init.log and /var/log/eb-activity.log. Can you look at the logs and give more details of the errors you see? This should hopefully give you more details regarding the error "None of the instances are sending data".

关于您看到的其他健康原因":

Regarding other health "causes" you are seeing:

  • 环境健康状况已从待定转变为严重 - 这是因为最初您的环境健康状况是待定.如果实例在宽限期内未恢复正常,则健康状态将转换为严重.在您的情况下,由于没有一个实例是健康的/正在发送数据,因此健康状况转变为严重.

  • Environment health has transitioned from Pending to Severe - This is because initially your environment health status is Pending. If the instances do not go healthy within grace period health status transitions to Severe. In your case since none of the instances is healthy / sending data, the health transitioned to Severe.

100.0% 的 ELB 请求失败,HTTP 5xx.请求率(0.5 个请求/分钟)不足以确定应用程序运行状况(7 分钟前).使用增强的运行状况监控时,Elastic Beanstalk 会监控除您的 EC2 实例之外的其他资源.例如,它监控 ELB 的 cloudwatch 指标.此错误意味着发送到您的环境 CNAME/负载平衡器的所有请求都因 HTTP 5xx 错误而失败.同时请求率非常低,每分钟只有 0.5 个请求,所以这表明即使所有请求都失败了,请求率也很低.7 分钟前"意味着有关 ELB 指标的信息有点旧.因为 Elastic Beanstalk 每隔几分钟监控一次 cloudwatch 指标,所以数据可能会稍微过时.这与我们直接从 EC2 实例获得的近乎实时"的健康数据相反.在您的情况下,由于实例未发送数据,因此唯一可用的运行状况来源是延迟了大约 7 分钟的 ELB 指标.

100.0 % of the requests to the ELB are failing with HTTP 5xx. Insufficient request rate (0.5 requests/min) to determine application health (7 minutes ago). Elastic Beanstalk monitors other resources in addition to your EC2 instances when using enhanced health monitoring. For example, it monitors cloudwatch metrics for your ELB. This error means that all requests sent to your environment CNAME/load balancer are failing with HTTP 5xx errors. At the same time the request rate is very low only 0.5 requests per minute, so this indicates that even though all requests are failing, the request rate is pretty low. "7 minutes ago" means that information about ELB metrics is slightly old. Because Elastic Beanstalk monitors cloudwatch metrics every few minutes, so the data can be slightly stale. This is as opposed to health data we get directly from the EC2 instances which is "near real time". In your case since the instances are not sending data the only available source for health is ELB metrics which is delayed by about 7 minutes.

ELB 运行状况失败或不适用于所有实例Elastic Beanstalk 正在查看您的 ELB 的健康状况,即它正在检查 ELB 后面有多少实例正在服务中.在您的情况下,ELB 后面的所有实例都已停止服务,或者由于其他原因无法使用运行状况.您应该仔细检查您的服务角色是否配置正确.您可以在此处文档.您的应用程序可能无法启动.

ELB health is failing or not available for all instances Elastic Beanstalk is looking at the health of your ELB, i.e. it is checking how many instances are in service behind ELB. In your case either all instances behind ELB are out of service or the health is not available for some other reason. You should double check that your service role is correctly configured. You can read how to configure service role correctly here or in the documentation. It is possible that your application failed to start.

在您的情况下,我建议您关注第一个错误没有任何实例正在发送数据".为此,您需要查看上述日志.让我知道你在日志中看到了什么.代理在实例的引导过程中相当早地启动.因此,如果您看到没有任何实例正在发送数据"之类的错误,很可能是引导程序失败或代理因某种原因无法启动.日志应该会告诉你更多.

In your case I would suggest focusing on the first error "None of the instances are sending data". For this you need to look at the logs as outlined above. Let me know what you see in the logs. The agent is started fairly early in the bootstrap process on the instance. So if you see an error like "None of the instances are sending data", it is very likely that bootstrap failed or the agent failed to start for some reason. The logs should tell you more.

还要确保在您的环境中使用实例配置文件.实例配置文件允许在您的 EC2 实例上运行的运行状况代理使用 Elastic Beanstalk 进行身份验证.如果实例配置文件未与您的环境关联,则代理将无法将数据发送到 Elastic Beanstalk.在 此处阅读有关使用 Elastic Beanstalk 的实例配置文件的更多信息.

Also make sure you are using an instance profile with your environment. Instance profile allows the health agent running on your EC2 instance to authenticate with Elastic Beanstalk. If instance profile is not associated with your environment then the agent will not be able to send data to Elastic Beanstalk. Read more about Instance Profiles with Elastic Beanstalk here.

更新健康原因所有实例均未发送数据"的一个常见原因可能是您的实例位于 VPC 中,而您的 VPC 不允许 NTP 访问.此问题的典型指示是 /var/log/messages 中的以下消息:ntpdate:与时间服务器同步:[FAILED].发生这种情况时,您的 EC2 实例上的时钟可能会不同步,数据将被视为无效.您还应该在 AWS Web 控制台的运行状况页面上的实例上看到运行状况原因,告诉您实例时钟不同步.解决方法是确保您的 VPC 允许访问 NTP.

Update One common reason for the health cause "None of the instances are sending data" can be that your instance is in a VPC and your VPC does not allow NTP access. Typical indicator of this problem is the following message in /var/log/messages: ntpdate: Synchronizing with time server: [FAILED]. When this happens the clock on your EC2 instance can get out of sync and the data is considered invalid. You should also see a health cause on the instances on the health page on the AWS web console that tells you that instance clock is out-of-sync. The fix is to make sure that your VPC allows access to NTP.

这篇关于AWS:没有一个实例在发送数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆