linuxサーバrsyslogは100%CPUを占有する

2187 ワード

関連資料を調べる

メッセージログの表示

[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%ではありません.
CentOS 6再起動方法
/etc/init.d/rsyslog restart

その他の再起動方法
systemctl restart rsyslog

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