Data synchronization installation configuration method for rsync under Windows _win Server

Source: Internet
Author: User
Tags auth connection reset rsync

The configuration environment for rsync
Software platform: windows2003
Software version: Cwrsync_2.0.10_installer Cwrsync_server_2.0.10_installer
Hardware platform: dell2950 cpu1.6g*4 Memory: 4G hard drive: 1g*6 RAID5

= = = Install = = =

Install rsync in Windows environment to install server and client

Server-side installation: Running Cwrsync_server_2.0.10_installer
Client Installation: Running Cwrsync _2.0.10_installe

The installation steps are the same as the installation server side, which is not described in detail here.

= = = Configuration = = =
Configuration, as we did under Linux, locate the rsync.conf file in the installation directory for configuration:

rsync.conf file:

PID file =/var/run/rsyncd.pid

Lock file =/var/run/rsync.lock

Log file =/var/log/rsyncd.log

UID = Administrator

GID = Administrator

Use chroot = no

Max Connections =4

Syslog facility = LOCAL5

[Test]

Path =/CYGDRIVE/D/WLK

Comment=/cygdrive/d/wlk comment = BACKUP CLIENT is SOLARIS 8 E250
Ignore errors # can ignore some irrelevant IO errors
Read Only = yes # reading only
List = no # does not allow column files
Auth users = inburst # authenticated username, if not this line,

It means it's anonymous.
Secrets file = Etc/inburst.pas # Certified file name

Generate a password file on the server side Etc/inburst.pas

Open Notepad

Inburst:hack

The etc file saved under the installation path plus the following file is saved as Inburst.pas

Start the rsyncserver in the service, change the startup type to Automatic
So the server-side installation is set up.

Testing from the client side
The following command line in-VZRTOPG V is verbose,z is compressed, R is RECURSIVE,TOPG is to maintain the original attributes of the file, such as the owner, time
The parameters. –progress refers to the display

Detailed progress, –delete means that if the server side deleted the file, then the client also deleted the file, to maintain a true consensus.
In the back of the Inburst@ip,

Inburst is the username in the specified password file, followed by:: Inburst This inburst is the module name, which is the custom in/etc/rsyncd.conf
's name. The last/TMP is a backup
To the local directory name.
In this case, you can also use the e-ssh parameter to establish an encrypted connection. You can use –password-file=/password/path/file to specify the cipher text
So that you can make it in the script

Instead of having to enter the authentication password interactively, it should be noted that this password file permission attribute must be set to only the owner-readable.

Running CMD on the client

Rsync-av 10.0.0.16::401/cygdrive/h/401


Copy Code code as follows:

@echo off
RSYNC-ZTRUVOGLP--progress--delete--password-file=wtjb51.pas/cygdrive/f/webroot/jb51/wtjb51@221.192.1.1::d ddown

The content of Wtjb51.pas

Copy Code code as follows:
Jb51:www.jb51.net

JB51 is the username, followed by the password

The f in the/cygdrive/f/webroot/jb51/is the F disk, and the other discs can be modified by themselves.

Common problems when using rsync

Error 1:rsync:read error:connection reset by Peer (104)
Rsync Error:error in Rsync protocol The data Stream (code) at IO.C (794) [Receive r=3.0.2]
Workaround: It is likely that the server side did not turn on rsync services. Open the service.

Error 2: @ERROR: ChDir failed
Rsync Error:error starting Client-server Protocol (code 5) at MAIN.C (1495) [receiver=3.0.2]
Workaround: Server-side Sync directory does not have permissions, cwrsync Default User is Svcwrsync. Add user Svcwrsync permissions for the synchronization directory.

Error 3: @ERROR: Failed to open lock file
Rsync Error:error starting Client-server Protocol (code 5) at MAIN.C (1495) [receiver=3.0.2]
Workaround: Add lock file = Rsyncd.lock to the profile rsync.conf to resolve.

Error 4:rsync:could not open password file "/cygwin/e/setting/rsync/rsync_db.pwd": No such file or directory (2)
Resolution: The directory of password files must exist, and to use POSIX style:/cygdrive/e/setting/rsync/rsync_db.pwd

Error 5: @ERROR: Auth failed on module Data_backup rsync error:error starting Client-server Protocol (code 5) at MAIN.C (1506) [receiver=3.0.7]
Resolve: Password error, enter the correct password can be. If both the username and password are correct, the remote rsync server's account password file must have a permission of 600.

Error 6:password file must not is other-accessible
Workaround: This is because the Rsyncd.pwd rsyncd.sec permissions are not correct and should be set to 600. For example: chmod rsyncd.pwd, Windows should change the owner of the password file to the user who is running the program.

ERROR 7: @ERROR: Invalid UID nobody. Rsync Error:error starting Client-server Protocol (code 5) at MAIN.C (1506) [receiver=3.0.7]
Workaround: Add the following two lines to the rsyncd.conf file
UID = 0
GID = 0

Question 8: @ERROR: Chroot failed
Rsync Error:error starting Client-server Protocol (code 5) at MAIN.C (1522) [receiver=3.0.3]
Reason: The server-side directory does not exist or does not have permissions. Creating a directory and correcting permissions resolves the problem.

Question 9: @ERROR: Unknown module ' tee_nonexists '
Rsync Error:error starting Client-server Protocol (code 5) at MAIN.C (1522) [receiver=3.0.3]
Reason: The specified module is not present on the server. Provide the correct module name or modify the server side to the module you want to solve the problem.

Question 10:rsync:failed to connect to 218.107.243.2:no route to host (113)
Rsync error:error in Socket IO (code ten) at CLIENTSERVER.C [receiver=2.6.9]
Reason: The other side did not boot, firewall block, through the network firewall blocked, it is possible. Shutting down the firewall is actually opening the TCP UDP 873 or the specified rsync port.

Problem 11:rsync Error:error starting Client-server Protocol (code 5) at MAIN.C (1524) [receiver=3.0.7]
Reason:/etc/rsyncd.conf configuration file content has errors. Please check the configuration file correctly.

Question 12:rsync:chown "" failed:invalid argument (22)
Reason: Permission cannot be copied. Remove the parameters for the sync permission. (This happens more often when Linux is to Windows)

Question: @ERROR: Daemon Security Issue-contacts admin
Rsync Error:error starting Client-server Protocol (code 5) at MAIN.C (1530) [sender=3.0.6]
Cause: The synchronized directory has soft connection files that require server-side/etc/rsyncd.conf to open use Chroot = yes. Skim soft connection files.

Problem 14:rsync:read error:connection Reset by Peer (104)
Rsync Error:error in Rsync protocol The data Stream (code) at IO.C (794) [receiver=3.0.2]
Resolve: It is likely that the server side does not open Rsync services, open services.

Rsyncserver service startup times wrong "the Rsyncserver service started and stopped. Some services automatically stop if they have nothing to do, such as the Performance Logs and Alerts service. ”

Workaround: Remove the Rsyncd.pid file under the installation directory and restart the Rsyncserver service. is usually caused by abnormal shutdown.

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.