-
Lab topology
- Experimental Procedure
(1) Configuration rsync configuration file
editing configuration files vim /etc/rsyncd.conf, default is not the configuration file, and then add the following:Rsyncserver
gid = rsync # set to run permissions for rsync user
# default is true, modified to no, increase the backup file soft link directory of
timeout = 600 # Set the timeout time
ignoreErrors
List = false # do not show rsync server resource list
# for customer data synchronization client IP address, may be a plurality, with; separated
authusers = rsync_backup
secretsfile = /etc/rsync.passwd
[backup] # custom backup name
(2) arranged to create an account and password used, as follows:
[root @ web01backup] # useradd rsync -s / sbin / nologin -M # and consistent user profiles
[@ web01backup the root] # the rsync ID
UID = 502 (the rsync) GID = 502 (the rsync) 502 group = (the rsync)
[the root @ web01backup] # vim /etc/rsync.passwd # above profile name consistent
rsync_backup: synchronize user data hjm ## to the format username: password br /> [root @ web01backup] #
(3) create shared directory (/ backup), do the following:
[root @ web01backup] # mkdir / Backup # create a directory
# set the file belongs to those who
[root @ web01backup] # ll -d / backup / # to view the directory attribute br /> [root @ web01backup] #
(4) to start the service, if there failed to create pid file / var / run / rsyncd.pid: File exists such an error, you can use the command rm-f /var/run/rsyncd.pid delete it before you run this command.
[root @ web01backup] # netstat -tunlp | grep rsync
tcp 0 0 0.0.0.0:873 0.0.0.0: LISTEN 7076 / rsync
tcp 0 0 ::: 873 ::: LISTEN 7076 / rsync - Sersync server Configuration
(1) Configuration switched password, as follows
[root @ web02hjm] # vim /etc/rsync.password # Set Password switched br /> HJM
[@ web02hjm the root] #
(2) Test server Sersync test whether sersync can pull or push operation, first of all, we first create in the backup directory resync service end of a few folders, and then see if you can perform push or pull in sersync end, if possible, to get into sersync + resync of actual, as follows:
A) the Resync server
[root @ web01 ~] # cd / backup / # enter the directory
[the root @ web01backup] Touch # {1..4} .txt
[the root @ web01backup] LS #
1.txt 3.txt 4.txt 2.txt br /> [@ web01backup the root] #
B) sersync server
[root @ web02hjm] # rsync -azv [email protected] :: backup / hjm / --password-file = / etc / rsync.password
receivingincremental File List
./
1.txt
2.txt
3.txt
4.txt
Received 143bytes 294 bytes 874.00 Sent bytes / sec
totalSize Speedup IS IS 0 0.00
[the root @ web02hjm] LS #
1.txt 2.txt 3.txt 4.txt 5.txt hahha br /> [@ web02hjm the root] #
(. 3) sersync install software
sersync package, can be downloaded to the internet, we are here to advance good sersync have downloaded the package, then extract them, and move them in place. Specific operation
is as follows:
[the root @ web02tools] the tar xvf sersync_64bit_binary_stable_final.tar.gz -C # / usr / local /
the GNU-the Linux-the x86 / sersync2
[@ web02tools the root] # LL / usr / local / the GNU-the Linux-the x86 /
- rwxr-xr-x.1 root root 2214 2011 confxml.xml 10 Yue 26 br /> [root @ web02tools] #
(4) sersync edit the configuration file
editing configuration files, vim / usr / local / GNU -Linux-x86 / confxml .xml, and then modify the following places:
(5) start sersync service
set thesystem param
execute:echo 50000000 >/proc/sys/fs/inotify/max_user_watches
parse thecommand param
daemonthread num: 10
host ip :localhost host port: 8008
daemonstart,sersyncrun behind the console
user is rsync_backup
configxml parse success
pleaseaccording your cpu ,use-n param to adjust the cpu rate
rsync thedirectory recursivly to the remote servers once
-file=/etc/rsync.password>/dev/null 2>&1 run the sersync:
[root@web02GNU-Linux-x86]# - The experimental results
(1) Rsync server configuration
[root @ web02hjm] # LS br /> [root @ web02hjm] #
[root @ web01backup] # LS br /> [root @ web01backup] #
QQ online Zabbix Q group 177,428,068
Previous: Why Nginx high overall performance than Apache?