Sersync2 for file synchronization between servers

Source: Internet
Author: User
Tags rsync
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

  1. UId= Root
  2. Gid = root
  3. Max connections =36000
  4. Use chroot = no
  5. LogFile=/Var/log/rsyncd. log
  6. Pid file =/var/run/rsyncd. pid
  7. Lock file =/var/run/rsyncd. lock
  8. [Tongbu1]
  9. Path =/opt/tongbu1
  10. Comment = xoyo video files
  11. Ignore errors = yes
  12. Read only = no
  13. Hosts allow =192.168.0.100/24
  14. 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:

  1. "/Opt/tongbu" >
  2. "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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.