简体   繁体   English

AWS Cloudwatch 监控 - 将 EC2 服务器迁移到另一个区域

[英]AWS Cloudwatch Monitoring - Migrated the EC2 server in another region

I was using the cloud watch monitoring script (aws-scripts-mon) and it was working fine.我正在使用云监控脚本 (aws-scripts-mon),它运行良好。 but I recently migrated my server to a different region (from Singapore to Mumbai).但我最近将我的服务器迁移到了不同的地区(从新加坡到孟买)。

now ec2 server is pushing the data to the previous region, even I have changed the default region to Mumbai.现在 ec2 服务器正在将数据推送到以前的区域,即使我已经将默认区域更改为孟买。

while running this command./mon-put-instance-data.pl --mem-util --verify --verbose, it shows an endpoint that is of the Singapore region.在运行此命令时。/mon-put-instance-data.pl --mem-util --verify --verbose,它显示了新加坡地区的端点。

No credential methods are specified.未指定凭据方法。 Trying default IAM role.尝试默认 IAM 角色。 Using IAM role使用 IAM 角色

Endpoint: https://monitoring.**ap-southeast-1**.amazonaws.com
Payload: {"MetricData":[{".......................................

How can I change this endpoint?如何更改此端点?

Thank you.谢谢你。

From the AWS doc .来自 AWS 文档

Troubleshoot疑难解答

The CloudWatchClient.pm module caches instance metadata locally. CloudWatchClient.pm 模块在本地缓存实例元数据。 If you create an AMI from an instance where you have run the monitoring scripts, any instances launched from the AMI within the cache TTL (default: six hours, 24 hours for Auto Scaling groups) emit metrics using the instance ID of the original instance.如果您从已运行监控脚本的实例创建 AMI,则从缓存 TTL 内的 AMI 启动的任何实例(默认值:6 小时,对于 Auto Scaling 组为 24 小时)使用原始实例的实例 ID 发出指标。 After the cache TTL time period passes, the script retrieves fresh data and the monitoring scripts use the instance ID of the current instance.缓存 TTL 时间段过去后,脚本检索新数据,监控脚本使用当前实例的实例 ID。 To immediately correct this, remove the cached data using the following command:要立即更正此问题,请使用以下命令删除缓存数据:

rm /var/tmp/aws-mon/instance-id rm /var/tmp/aws-mon/instance-id

Remove the cache or wait six hours.删除缓存或等待六个小时。

Also the CloudWatch monitoring script is deprecated.此外,不推荐使用 CloudWatch 监控脚本。 Better to use CloudWatch agent instead of script for collecting the logs and metrics.最好使用 CloudWatch 代理而不是脚本来收集日志和指标。

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

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