|
Often recently deployed on a new server environment, a lot of things can be directly from other servers back up without having to re-download the installation.
Is to use the rsync command: first to download rsync and install to the "source server", the specific process of the connection at the end of this article.
Then configure the rsync.conf file in the "source server", typically in /etc/rsyncd.conf.
Add the following statement to the file:
[test]
Path = / data1 / test/
Uid = root
Gid = root
Read only = no
Hosts allow = 127.0.0.1/16 ***** / 255.255.255.0
Save and run the command: usr / bin / rsync --daemon --config = / etc / rsyncd.conf
And then run the command in the target server: rsync -avzP root @ **. **. **. **: test/ data1 / test/ test / (where ******* is the "source server" IP)
Then if there is no problem will see the progress bar.
Clear the rsync error report
Rsync configure:
Configuration 1:
Ignore errors
Note: This option is best to add, or a lot of crontab often wrong when you do not know, because you can not see every day to see every moment of the log, without the probability of this error will be relatively high , Because any large point of the project and system, disk IO is a bottleneck
Rsync error:
Error one:
@ERROR: auth failed on module xxxxx
Rsync: connection unexpectedly closed (90 bytes read so far)
Rsync error: error in rsync protocol data stream (code 12) at io.c (150)
Description: This is because the password is set wrong, can not log in successfully, check rsync.pwd, to see whether the customer service match. There is no server-side services will start rsync This happens.
Error two:
Password file must not be other-accessible
Continuing without password file
Password:
Explanation: This is because rsyncd.pwd rsyncd.sec permissions are wrong, it should be set to 600. For example: chmod 600 rsyncd.pwd
Error three:
@ERROR: chroot failed
Rsync: connection unexpectedly closed (75 bytes read so far)
Rsync error: error in rsync protocol data stream (code 12) at io.c (150)
Note: This is because you set the path in rsync.conf path does not exist, to create a new directory to start synchronization
Error four:
Rsync: failed to connect to 218.107.243.2: No route to host (113)
Rsync error: error in socket IO (code 10) at clientserver.c (104) [receiver = 2.6.9]
Note: Firewall problems, this is best to completely turn off the firewall, the basic method of troubleshooting is the case, whether it is S or C, as well as ignore errors option problem will lead to
Error 5:
@ERROR: access denied to www from unknown (192.168.1.123)
Rsync: connection unexpectedly closed (0 bytes received so far) [receiver]
Rsync error: error in rsync protocol data stream (code 12) at io.c (359)
Note: This problem is obvious, is the configuration option host allow problem, beginners like to allow a segment into a configuration, and then the module is the same, resulting in
Error six:
Rsync error: received SIGINT, SIGTERM, or SIGHUP (code 20) at rsync.c (244) [generator = 2.6.9]
Rsync error: received SIGUSR1 (code 19) at main.c (1182) [receiver = 2.6.9]
Note: Most of this problem is caused by the server does not start the normal service to the server up to check whether the service is started, and then check / var / run / rsync.pid file exists, the most simple way is to kill has started Service, and then start the service again or allow the script to join the system startup service level and then shutdown-r now server
Error seven:
Rsync: read error: Connection reset by peer (104)
Rsync error: error in rsync protocol data stream (code 12) at io.c (604) [sender = 2.6.9]
Explanation: There is no data in the original data directory |
|
|
|