Failed to start CloudWatch agent on ubuntu server

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

/opt/aws/amazon-cloudwatch-agent/bin/config-downloader --output-dir /opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.d --download-source file:/opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.json --mode onPrem --config /opt/aws/amazon-cloudwatch-agent/etc/common-config.toml --multi-config default
Got Home directory: /root
I! Set home dir Linux: /root
I! SDKRegionWithCredsMap region:
Unable to determine aws-region.
Please make sure the credentials and region set correctly on your hosts.
Refer to http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html
Fail to fetch the config!

/root/.aws/credentials

[default]
aws_access_key_id = *****************
aws_secret_access_key = ************************

/root/.aws/config

[default]
region = us-gov-west-1

sudo aws configure list

      Name                    Value             Type    Location
      ----                    -----             ----    --------
   profile                <not set>             None    None
access_key     ****************  shared-credentials-file
secret_key     ****************  shared-credentials-file
    region            us-gov-west-1      config-file    ~/.aws/config

export AWS_REGION=us-gov-west-1

How can I solve this problem?

DD-Boom
已提问 6 个月前398 查看次数
1 回答
0

I solved the problem by running "sudo aws configure --profile AmazonCloudWatchAgent", but a new problem appeared, the "amazon-cloudwatch-agent.json" parameter was wrong

DD-Boom
已回答 6 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则