如何卸载 awslogs-agent-setup.py? [英] How to uninstall awslogs-agent-setup.py?

查看:12
本文介绍了如何卸载 awslogs-agent-setup.py?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

仅在我的 Amazon Linux AMI 上使用 sudo python ./awslogs-agent-setup.py --region us-east-1 后,我才从 AWS 文档中发现了此警告:><块引用>

不要使用 RPM 安装更新 CloudWatch Logs 代理方法,如果您之前使用 Python 脚本安装代理.这样做可能会导致配置问题,从而阻止 CloudWatch将您的日志发送到 CloudWatch 的日志代理.

现在,如何卸载python版本以使用RPM安装?

解决方案

有一篇关于 在 CentOS 上删除 awslogs,我想你也可以在 Amazon Linux 上应用它.我认为没有比手动操作更简单的方法了.

已编辑,因为上面的链接无法访问:

应该执行这些步骤:

#停止 awslogs 服务.服务 awslogs 停止#删除云表相关文件.rm -rf/var/awslogsrm/etc/cron.d/awslogs*rm/etc/init.d/awslogsrm/var/log/awslogs*rm -rf/home/ubuntu/awslogs-agent-setup.py

然后根据需要重新启动服务器.

现在应该从系统中删除 CloudWatch 日志代理.确保您登录 CloudWatch AWS 控制台以删除日志组:AWS 控制台 -> CloudWatch -> 日志 -> 选择日志组并单击删除日志组".

Only after using sudo python ./awslogs-agent-setup.py --region us-east-1 on my Amazon Linux AMI, I found this tidbyte of Caution from AWS docs:

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.

Now, how can I uninstall the python version to use the RPM installation?

解决方案

There is a writeup about removing awslogs on CentOS, I guess you can apply this on Amazon Linux as well. I don't think there is an easier way than doing it manually.

Edited as the link above is not reachable:

These steps should be executed:

#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

Then restart the server if required.

The CloudWatch logs agent should now be removed from the system. Ensure you log into the CloudWatch AWS Console to remove the log group: AWS Console -> CloudWatch -> Logs -> Select the Log Group and click on "Delete Log Group".

这篇关于如何卸载 awslogs-agent-setup.py?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆