Objectives: The master server program synchronizes the program to multiple subservers. configure the synchronization source to install rsync: yum-yinstallrsyncxinetd to enable rsync: vim/etc/xinetd. d/rsync change disable = no to disable = yes configuration: vim/etc/rsyncd. conf # Synchronization source id. you can change the [si
Objective: to synchronize a master server program with multiple subservers
1. configure the synchronization source
Install rsync: yum-y install rsync xinetd
Enable rsync: vim/etc/xinetd. d/rsync to change disable = no to disable = yes
Configuration: vim/etc/rsyncd. conf
# Synchronization source ID, which can be changed at will
[Site]
# Program path
Path =/home/backup
# Synchronized hosts
Hosts allow = 192.168.1.14
Hosts deny = *
List = true
Uid = root
Gid = root
Read only = false
2. configure the synchronization server
Install rsync, set the filter list, and run the following command:
Rsync-avz -- delete -- exclude-from =/etc/rsync_exclude.lst/var/www/html/Server_ip::Site
Server_ip is the server IP address or domain name, and the site is the synchronization Source ID.
In addition, set the timing script. In this way, the station group of the synchronization server can be synchronized from the master server rsync in a timely manner.