简体   繁体   English

AWS 目标组节点监控

[英]AWS Target group nodes monitoring

i set up an elastic load balancer on AWS to reach a target group made of 3 EC2 instances, in 3 different zones.我在 AWS 上设置了一个弹性负载均衡器,以达到由 3 个不同区域中的 3 个 EC2 实例组成的目标组。

I saw I can see CloudWatch load balancer metric, target group metric, or EC2 metric.我看到我可以看到 CloudWatch 负载均衡器指标、目标组指标或 EC2 指标。 I'd like to know if exists a kind of plugin to display metrics for all the hosts available in the target group, like grafana/prometheus.我想知道是否存在一种插件来显示目标组中所有可用主机的指标,例如 grafana/prometheus。

In addition I'd like to know if the are best practise to gather application logs from EC2 instances to consult them, if some error occur.此外,我想知道如果发生一些错误,从 EC2 实例收集应用程序日志以查阅它们是否是最佳实践。

Thank you very much非常感谢

It depends on what kind of monitoring you want to use, but assuming you just want to gather logs, you can do the following:这取决于您要使用哪种监控,但假设您只想收集日志,您可以执行以下操作:

  1. Pre-bake the AMI, based on your OS, with Cloudwatch Logs agent.根据您的操作系统,使用 Cloudwatch Logs 代理预烘焙 AMI。
  2. Specify log group name in agent configuration, enable agent on startup在代理配置中指定日志组名称,启动时启用代理
  3. Launch instance group from that AMI从该 AMI 启动实例组

This way logs from different instances should be collected in one log group under different streams corresponding to instance.这样来自不同实例的日志应该被收集在一个日志组中,在对应于实例的不同流下。

You can also use 3rd-party services, like ELK stack, but the idea is the same - AMI with log agent.您还可以使用 3rd-party 服务,例如 ELK 堆栈,但想法是一样的 - 带有日志代理的 AMI。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM