Linux 日志中出现报错的原因非常广泛,通常可以分为几大类。下面我按常见原因 → 排查思路 → 典型示例来说明,你可以对照自己的情况判断。
No space left on device)典型日志:
No space left on device
Out of memory: Kill process
Too many open files
典型日志:
Failed to start nginx.service
Permission denied
Address already in use
典型日志:
error while loading shared libraries
command not found
syntax error near unexpected token
典型日志:
Could not resolve host
Connection timed out
No route to host
典型日志:
I/O error
kernel panic
segfault at ...
典型日志:
authentication failure
Failed password for root
journalctl -xe
或
less /var/log/messages
less /var/log/syslog
journalctl -u nginx
tail -f /var/log/messages
df -h
free -h
top
如果你愿意,可以告诉我:
我可以直接帮你分析具体原因和解决办法。