9/20/2016

ERROR: Cannot add watch /Dir (28:No space left on device)

Today I got the lsyncd problem and found the following error in /var/log/lsyncd.
 ===
Wed Sep 21 03:48:24 2016: ERROR: Cannot add watch /Dir_name/file_name (28:No space left on device)
 ===
I googled the error message and found the solution. The max_user_watches reached its limit. I need to increase the value of max_user_watches. 

At first, checked the current value.
 [root@host ~]# cat /proc/sys/fs/inotify/max_user_watches
 32768


To increase the max_user_watches, I edited the /etc/sysctl.cnf.
 [root@host ~]# vi /etc/sysctl.confadded the folowing line.
 fs.inotify.max_user_watches = 500000

To take a effect, I did the following command.
[root@host ~]# sysctl -p


That's it!

Temporary solution
  echo 65536 >/proc/sys/fs/inotify/max_user_watches

 [root@host ~]# cat /proc/sys/fs/inotify/max_user_watches
 65536


Finally I got around the error. :)