只有在我的 Amazon Linux AMI 上使用 sudo python ./awslogs-agent-setup.py --region us-east-1
后,我才从 AWS 文档中发现了这条警告信息:
Do not update the CloudWatch Logs agent using the RPM installation method if you previously used the Python script to install the agent. Doing so may cause configuration issues that prevent the CloudWatch Logs agent from sending your logs to CloudWatch.
现在,如何卸载python版本以使用RPM安装?
最佳答案
有一篇关于 removing awslogs on CentOS 的文章,我猜你也可以在 Amazon Linux 上应用它。我认为没有比手动操作更简单的方法了。
编辑为无法访问以上链接:
应该执行这些步骤:
#Stop the awslogs service.
service awslogs stop
#Remove cloud watch related files.
rm -rf /var/awslogs
rm /etc/cron.d/awslogs*
rm /etc/init.d/awslogs
rm /var/log/awslogs*
rm -rf /home/ubuntu/awslogs-agent-setup.py
然后根据需要重新启动服务器。
CloudWatch 日志代理现在应该已从系统中删除。确保您登录到 CloudWatch AWS 控制台以删除日志组: AWS 控制台 -> CloudWatch -> 日志 -> 选择日志组并单击“删除日志组”。
关于python - 如何卸载awslogs-agent-setup.py?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35387097/