The current version of sersync depends on rsync for synchronization. As shown in, enable sersync on the synchronization master server to synchronize files in the monitoring path to the target server. Therefore, you must configure sersync on the master server and configure rsync on the synchronization target server. For rsync configuration, you can find a lot of information on google. The following are just some necessary configurations:
Current version of sersyNcDependent on rSync. As shown in, enableSersyncTo synchronize files in the monitoring path to the target server. Therefore, you must configure sersync on the master server and rsync on the target server. For rsync configuration, you can find a lot of information on google. The following are only some necessary configurations and instructions for use, for your reference only. Please modify them according to your actual situation.
You need to configure sersync on the synchronization master server, configure rsync on the synchronization target server, and enable the rsync waiting process on the target server. In this way, the files generated on the master server are, sersync synchronizes data to multiple target servers in real time. By default, rsync has been installed in centos. You only need to configure and enable rsync.
Configure rsync for the target synchronization server
Configure the following on multiple target servers:
Vi/etc/rsynCd. Conf
Java code
- UId= Root
- Gid = root
- Max connections =36000
- Use chroot = no
- LogFile=/Var/log/rsyncd. log
- Pid file =/var/run/rsyncd. pid
- Lock file =/var/run/rsyncd. lock
- [Tongbu1]
- Path =/opt/tongbu1
- Comment = xoyo video files
- Ignore errors = yes
- Read only = no
- Hosts allow =192.168.0.100/24
- Hosts deny = *
The Configuration File above indicates that the master server is allowed (assuming the ip address is 192.168.0.100) access, the rsync synchronization module is named [tongbu1], and the synchronized files are placed in the directory/opt/tongbu1 specified by path.
If multiple slave servers exist, a similar configuration is required for each server.
After configuration, use the followingCommandTo enable the rsync daemon:
Rsync -- daemon
Install and configure sresync on the master server
Download the executable file version of sersync from google code, which contains the configuration file and executable file. Here we use sersync2.5 to describe it. The configuration form of the new version is similar.
Vi confxml. xml
Modify the following parts:
- "/Opt/tongbu" >
- "192.168.0.104" Name = "Tongbu1" />
Indicates that the files in the local/opt/tongbu path on the master server must be synchronized to the tongbu1 module on the remote server 192.168.0.104.
Enable sersync:
/Usr/local/sersync/sersync25/sersync2-o/usr/local/sersync/sersync25/confxml. xml-d