14PowerLsyncd real-time synchronization tool service
1Powerlsyncd real-time synchronization tool
1) lsyncd is actually the lua language that encapsulates inotify and rsync tools, using the Linux kernel (since 2.6.13)
Inofify trigger mechanism and then through the rsync to differential synchronization, to achieve real-time effect, its most powerful place is the perfect solution
There are frequent file list problems caused by the massive file synchronization of inotify+rsync. Secondly, the configuration is simple.
2, install
Yum-y install lsyncd
3. Create a configuration file (originally useless information in the configuration file)
1) profile information resolution:
Reference blog: https://www.cnblogs.com/zxci/p/6243574.html
4, start
Systemctl start lsyncd
5. Test:
Nfs side test
Cd / data for i in {1... 1000}; do echo "${I}"; echo "${I}" > ${I} .txt; sleep 0.1 done
Backup side test
Cd / data while true; do ls | wc-lest sleep 0.1 done
Troubleshooting idea: if the lsyncd on the nfs server cannot be synchronized to the rsync in real time, first check whether the NFS side can synchronize to the rsync side, consider the storage directory problem on the rsync side, the permission problem of the directory, the password file problem during synchronization, and then troubleshoot the synchronization directory problem on the lsynd side, the purpose pointing problem, the password file problem.