Đây là lỗi tôi đã gặp quá trình quản trị web server trên CentOS 7.4 64bit. Sau đây là các thông tin lỗi cụ thể và cách khắc phục.
1. Biểu hiện lỗi
– khi thực hiện các lệnh linux (tail, systemctl,…) hoặc check log /var/log/messages đều xuất hiện lỗi: No space left on device
tail -f /var/log/dmesg
tail: cannot watch '/var/log/dmsg': No space left on device
– Có thể thêm log lỗi Max open file, mặc dù khi ta check open file trên server đều không quá cao, chưa vượt qua giá trị mà ta đã set trong limit.conf.
Error: too max open file hoặc out of inotify watches
2 Cách khắc phục
Đầu tiên, ta cần view giá trị hiện tại của các tham số sau:
[root@web01 ~]# cat /proc/sys/fs/inotify/max_user_watches
[root@web01 ~]# cat /proc/sys/fs/inotify/max_user_instances
Tùy theo hệ thống mà ta set tăng giá trị này lên (trường hợp của tôi, tăng lên 512000), cách tăng như sau:
sysctl fs.inotify.max_user_watches=512000
sysctl fs.inotify.max_user_instances=512000
hoặc
vim /etc/sysctl.conf
Add: fs.inotify.max_user_watches=512000
fs.inotify.max_user_instances=512000
sysctl -p
Sau đó, kiểm tra lại hệ thống.
Thanks,
Nice article, i like it!