简体   繁体   English

AutoScaleGroup中的AWS EC2 CloudWatch Mem Util和磁盘Util

[英]AWS EC2 CloudWatch Mem Util and Disk Util in AutoScaleGroup

Recently, I've been investigating how to setup CloudWatch Monitoring in our AWS instances to include Mem Util and Disk Util. 最近,我一直在研究如何在我们的AWS实例中设置CloudWatch Monitoring,以包括Mem Util和Disk Util。

I've followed this guide . 我遵循了本指南 It worked like a charm. 它像魅力一样运作。

I have everything working on our Production-REF (Reference) box. 我在Production-REF(参考)框上进行了所有工作。 I create an Image, and add it to our Launch Configuration for our AutoScaleGroup. 我创建一个图像,并将其添加到AutoScaleGroup的启动配置中。 Everything deploys fine, and all the scripts run. 一切部署良好,所有脚本运行。

The Problem : The instance-id is cached on the AutoScale boxes, so it sends all information back as the Production-REF box. 问题 :实例ID缓存在AutoScale框上,因此它将所有信息作为Production-REF框发送回去。

I don't really want to tweak the out of the box AWS script, but I see in CloudWatchClient.pm it calls get_instance_id, which calls get_meta_data, which uses cache [ http://169.254.169.254/latest/meta-data ]. 我并不是真的想调整现成的AWS脚本,但是我在CloudWatchClient.pm中看到它调用了get_instance_id,后者调用了使用缓存[ http://169.254.169.254/latest/meta-data ]的get_meta_data。

Anyway to clear http://169.254.169.254/latest/meta-data cache? 无论如何要清除http://169.254.169.254/latest/meta-data缓存? Preferably just the first time its called on that instance. 最好是第一次在该实例上调用它。 Maybe another way? 也许是另一种方式?

Any help is appreciated! 任何帮助表示赞赏!

I found the cached file: /var/tmp/aws-mon/instance-id 我找到了缓存的文件: /var/tmp/aws-mon/instance-id

If you remove that, it'll auto replace it with the correct (AutoScaled Box's Instance Id). 如果您删除了它,它将自动将其替换为正确的(AutoScaled Box的实例ID)。

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

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