gpt4 book ai didi

amazon-web-services - AWS CloudWatch代理未启动

转载 作者:行者123 更新时间:2023-12-03 15:44:13 28 4
gpt4 key购买 nike

我有一个Ubuntu EC2实例。我在以下位置手动创建了以下基本CloudWatch Agent配置文件:

/opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.json


{
"metrics": {
"metrics_collected": {
"collectd": {},
"mem": {
"measurement": [
"used_percent",
"total"
]
},
"disk": {
"measurement": [
"used_percent",
"total"
]
}
}
}
}

我正在尝试使用以下命令启动CloudWatch代理。
sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -m ec2 -a start

然后,我使用下面的命令检查状态以确认其正在运行。
sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -m ec2 -a status

但是我得到下面的输出,该输出显示代理处于停止状态。
{
"status": "stopped",
"starttime": "",
"version": "1.223987.0"
}

我检查了下面的日志文件。

/var/log/amazon/amazon-cloudwatch-agent



它包含:
2019/07/23 06:51:04 I! I! Detected the instance is EC2
2019/07/23 06:51:04 Reading json config file path: /opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.json ...
Valid Json input schema.
I! Detecting runasuser...
No csm configuration found.
No log configuration found.
No structuredlog configuration found.
Configuration validation first phase succeeded

2019/07/23 06:51:04 I! Config has been translated into TOML /opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.toml
2019/07/23 06:51:04 Reading json config file path: /opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.json ...
2019/07/23 06:51:04 I! Detected runAsUser: root

我需要做什么才能运行CloudWatch Agent?

最佳答案

对于CentOS

yum update && yum install epel-release && yum install collectd
对于Ubuntu
sudo apt-get update && sudo apt-get install collectd 

关于amazon-web-services - AWS CloudWatch代理未启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57158302/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com