In Linux system, Rsync+sersync can realize real-time synchronization of system data, which is more practical than Rsync+Inotify-tools architecture. The following small series will give you a detailed introduction to the Linux installation and configuration of Rsync+sersync.
First, why use Rsync + sersync architecture?
1,sersync is based on Inotify, similar to the Inotify-tools tool
2, sersync can record changes in the monitored directory (including add, delete, modify) specific The name of a file or a directory, and then use rsync to synchronize, only synchronize the changed file or this directory.
Second, what is the difference between Rsync+Inotify-tools and Rsync+sersync?
1, Rsync+Inotify-tools
(1): Inotify-tools can only record changes to the directory being monitored (including adding, deleting, modifying), and did not put specific Which file or which directory has changed and recorded;
(2): When rsync is synchronized, it does not know which file or which directory has changed, each time the entire directory is changed. Synchronization, when the amount of data is large, the entire directory synchronization is very time consuming (rsync has to traverse the entire directory to find the comparison file), so the efficiency is very low.
2, Rsync+sersync
(1): sersync can record changes in the directory being listened to (including adding, deleting, modifying) the name of a specific file or a directory. ;
(2): When rsync is synchronized, only the changed file or this directory is synchronized (the data changed every time is small relative to the entire synchronous directory data, rsync is traversed to find When comparing files, it is very fast), so it is very efficient.
System Home Xiaobian reminder: When the amount of synchronized directory data is not large, it is recommended to use Rsync+Inotify-tools; when the amount of data is large (several hundred G or even more than 1T), many files, it is recommended Use Rsync+sersync.
Description:
Operating System: CentOS 5.X
Source Server: 192.168.21.129
Target Server: 192.168.21.127,192.168.21.128< Br>
Purpose: Synchronize the /home/www.jb51.net directory on the source server to /home/www.jb51.net in real time.
Specific operations:
The first part: operate on two target servers 192.168.21.127, 192.168.21.128
First, install the Rsync server on the target server in two
1. Close SELINUX
vi /etc/selinux/config #Edit Firewall Configuration File
The code is as follows:
#SELINUX=enforcing #注了
#SELINUXTYPE=targeted #Comment out
SELINUX=disabled #增增
:wq! #Save, exit
setenforce 0 #immediately
2, open the firewall tcp port 873 (Rsync default port)
vi /etc/sysconfig/iptables #edit firewall configuration The file
is as follows:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 873 -j ACCEPT
:wq! #SaveExit
/etc/init.d/iptables restart #Restart the firewall to make the configuration take effect
3. Install the Rsync server software
yum install rsync xinetd #Install
vi /etc/xinetd.d/rsync #Edit the configuration file, set the boot rsync
code as follows:
disable = no #change to no
:wq! #SaveExit
/etc/init.d/xinetd start #Startup (CentOS is xinetd to manage Rsync service)
Previous123456Next page Total 6 pages
In Linux systems, VLANs, Layer 3 switching, and trunks are three confusing concepts
Some computers with dual hard drives will prompt boot/efi when there is no space allocated when inst
Usually when we start the Linux ISO image, we need to burn to the CD first. This wi
ifconfig is a command for Linux to display network devices. It can set the status o
Under the CentOS pure-ftpd server error 530 login authentication how to do?
Docker container usage examples in Linux
Ubuntu download and install j2ee development environment steps
How to put the files deleted by the Linux rm command into the garbage bin
How to use Ubuntu command management authority
Linux file default permissions and hidden permissions resolution
How to identify Linux system rpm and yum tools
Linux prompts when you use Mkdir can not create directory ‘test’?
Solution with fstab file error causing Linux to fail to start
Win7 teaches you a simple way to quickly switch power supply
What should I do if the Windows 8 system prompts "IME is disabled"?
Win7 sp1 can not be installed solution
How to fix Win7 SP1 can not sleep normally
How to install Win7 under Win8?
The easiest way to crack the speed of telecommunications starry sky
Win7 notebook keyboard failure is also useless how to solve?
Win8 new member, Win8 new SKU list added "China" version
How to build Debian apt-get source on redhat
The secret base of CF9 Yuelan is coming again. The best props zero yuan purchase