CloudWatch Agent ec2metadata not available

0

I have 3 EC2 instances which do not have a public IP address and are connected via a VPN to a private network. I have installed the CloudWatch agent on them. When I try to start them using the following command:

$ sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -c file:/opt/aws/amazon-cloudwatch-agent/bin/config.json -s

I receive the following error:
ec2metadata is not available
I! detect region from ecs
Unable to determine aws-region.
Please check if you can access the metadata service. For exampe, on linux, run 'wget -q -O - http://169.254.169.254/latest/meta-data/instance-id && echo'
Fail to fetch the config!

When I try to run the specified wget command I get a 503 Service Unavailable error.

I am at a loss for how to troubleshoot this further. Is there a way to specify the Region in the config files for the agent?

mhatch1
質問済み 3年前2331ビュー
1回答
0

Hello,

thank you for sending this message.

it's possible that this might be a metadata issue and not a region issue. I see that you are using VPN, so I suspect this instances needs to get access to ec2 endpoints.

Here is link that might be helpful : This should help https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Agent-Configuration-File-Details.html#CloudWatch-Agent-Configuration-File-Metricssection

Get back to us if you need anything.

回答済み 3年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ