linux 服务器 rsyslog占用100%CPU

查到相关资料

查看 messages 日志

[root@10 ~ ]# less /var/log/messages 

日志

Jul  9 12:42:20 10 rsyslogd: imklog: error reading kernel log - shutting down: Bad file descriptor
Jul  9 12:42:20 10 rsyslogd: imklog: error reading kernel log - shutting down: Bad file descriptor
Jul  9 12:42:20 10 rsyslogd: imklog: error reading kernel log - shutting down: Bad file descriptor
Jul  9 12:42:20 10 rsyslogd: imklog: error reading kernel log - shutting down: Bad file descriptor
Jul  9 12:42:20 10 rsyslogd: imklog: error reading kernel log - shutting down: Bad file descriptor
Jul  9 12:42:20 10 rsyslogd: imklog: error reading kernel log - shutting down: Bad file descriptor
Jul  9 12:42:20 10 rsyslogd: imklog: error reading kernel log - shutting down: Bad file descriptor
Jul  9 12:42:20 10 rsyslogd: imklog: error reading kernel log - shutting down: Bad file descriptor
Jul  9 12:42:20 10 rsyslogd: imklog: error reading kernel log - shutting down: Bad file descriptor
Jul  9 12:42:20 10 rsyslogd: imklog: error reading kernel log - shutting down: Bad file descriptor
Jul  9 12:42:20 10 rsyslogd: imklog: error reading kernel log - shutting down: Bad file descriptor
Jul  9 12:42:20 10 rsyslogd: imklog: error reading kernel log - shutting down: Bad file descriptor
Jul  9 12:42:20 10 rsyslogd: imklog: error reading kernel log - shutting down: Bad file descriptor
Jul  9 12:42:20 10 rsyslogd: imklog: error reading kernel log - shutting down: Bad file descriptor
Jul  9 12:42:20 10 rsyslogd: imklog: error reading kernel log - shutting down: Bad file descriptor
Jul  9 12:42:20 10 rsyslogd: imklog: error reading kernel log - shutting down: Bad file descriptor
Jul  9 12:42:20 10 rsyslogd: imklog: error reading kernel log - shutting down: Bad file descriptor

解决方法

打开/etc/rsyslog.conf并找到 $ModLoad imklog
把他注释掉,然后重新启动rsyslog。现在CPU使用正常了,不再是100%。

CentOS6 重启方法

/etc/init.d/rsyslog restart

其它重启方法

systemctl restart rsyslog

参考:
https://isempty.me/archives/319
https://blog.csdn.net/younger_china/article/details/52355799

你可能感兴趣的:(linux 服务器 rsyslog占用100%CPU)