Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Install and configure Lsyncd (CentOS)

Symptoms

The customer wants to sync directory or files between to computers.

Explanation

A quick start for setup on Lsyncd …

...

Lsyncd is especially useful for synchronizing data from a secure area to a less secure area. To accomplish this, Lsyncd uses Rsync to automate the replication of files from one master server to one or more subordinate servers. Lsyncd transfers only files that have changed.

Resolution

Install and configure Lsyncd

Complete the following steps to install and configure Lsyncd.

...

  • Two or more Linux servers
  • Ability to run the installation and configuration commands while logged in as the root user or from a super-user account
  • Public and private IP addresses for the master server
  • Public and private IP addresses for the subordinate servers

Install Lsyncd on Master Server

  1. On the master server, run the following command:

...

        # yum -y install lua lua-devel pkgconfig gcc asciidoc 

Install Lsyncd on Destination Server

Important: Be sure to manually check the destination directory on the subordinate server. If you have NFS or CloudFuse mount your Cloud Files, these could be deleted by the Lsyncd process.

...

       # chkconfig lsyncd on

 


Configure log rotation

 After Lsyncd has an assigned log area, it will create a log event if an error occurs during replication. Log files can become large and unruly when not properly monitored, causing a hard disk to fill up. To ensure this does not happen, add Lsyncd to logrotate.

...

  1. To verify that the file was replicated, use SSH to log in to the subordinate server and run the ls command.

         # ls /var/www

 


Notes: 


References:

  1. Article: Install and configure lsyncd