Lsyncd – conf.d like setup on Ubuntu

On Ubuntu 14 (version 2.1.x)

Create configuration files

-> it should be /etc/lsyncd/lsyncd.conf.lua

Backup the original file and create a new conf file

 

Create the config file for 2 web nodes called w01 and w02.
These 2 nodes have the following IPs:
10.180.3.201 w01
10.180.3.322 w02

Now let’s create the exclusions file. This will be the list of paths that won’t be sync’d.

NOTE! For exclusions, please remember to put the relative path, NOT the full path. In this case, it excludes www.mytestsite.com/ from /var/www/vhosts

Set up a logrotate conf file

 

Troubleshoot

Test Lsyncd

 

Error log – inotify issue

ERROR: Terminating since out of inotify watches//Consider increasing /proc/sys/fs/inotify/max_user_watches

Temporary fix:

Permanent fix (ALSO write sysctl.conf):