ssh - Lsync not processing files in the correct order in a master-master/bi-directional setup -


i'm using lsync synchronize web root 2 separate centos 7 servers running apache. far, seems running decently, every often, notice lsync doesn't process files properly.

an example of issue i'm having - if have file called hello-world.txt on server01 , server02, , delete server01, when lsync runs, instead of deleting server02, re-creates on server01.

i haven't found online this, , i'm new using lsync, i'm not quite sure how go fixing this.

not sure it's needed, here's lsync configuration file (/etc/lsyncd.conf):

settings {     logfile = "/var/log/lsyncd.log",     statusfile = "/var/log/lsyncd.stat",     statusinterval = 2 }  sync {     default.rsync,     source="/var/www/",     target="192.168.1.36:/var/www/",     rsync={         rsh = "/usr/bin/ssh -l lsync -i /etc/lsync/.ssh/id_rsa",      } } 

any appreciate! thanks!

lsyncd not bidirectional synchronization; purpose make that directory this directory, continuously.

you achieve same effect running rsync cron job. difference lsyncd more responsive when files changed, , more efficient when files idle.

with extreme care, set lsyncd on both servers, syncing in both directions, , might want, relies on updates being not rapid (when server01 sends update server02, server02 detect change , attempt send right server01, harmless long file has not changed again). i'd not recommend setup; use syncthing, or make edits "master" server.


Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -