Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Practical practice of cwRsync synchronization tool

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

The company's website is about to be launched, and it has been decided to use F5 for load balancing, but how to solve the problem of data synchronization between website servers?

Under the Linux platform, there is no problem with the rsync service. Not only can the files be synchronized in real time, but their properties and permissions will not change. Is there such software under the Windows platform? Google, discovered cwRsync.

Needless to say, start testing synchronization settings between windows and the windows server.

1. First download the software from the official website (http://www.itefix.no/i2/node/10650). The latest version is 3.0.8, but I am using the old version 2.0.10.

2. First prepare two machines:

Server:192.168.71.134

Client:192.168.71.135

3. Installation and configuration

Server side:

(1) install cwRsync_Server_2.0.10_Installer.zip

Open the "start a unix bash shell" program in the starter program:

Enter a terminal similar to cmd and enter the following command:

$/ bin/activate-user.sh

Enter l

Enter administrator

Press it all back in the back.

(2) start opensshd

Open Control Panel-- > Administrative tools-- > Services:

Find an opensshd service and start it.

(3) configure rsyncd.conf configuration file

Edit C:\ Program Files\ cwRsyncServer\ rsyncd.conf as follows:

Use chroot = false

Strict modes = false

Hosts allow = *

Log file = rsyncd.log

Pid file = rsyncd.pid

# Module definitions

# Remember cygwin naming conventions: C:\ work becomes / cygwin/c/work

#

[wwwroot]

Path = / cygdrive/c/Inetpub/wwwroot (here the path represents the c:\ Inetpub\ wwwroot directory)

Read only = yes

Transfer logging = yes

# secrets file = / cygdrive/f/rsyncd.secrets (no verification required)

(4) start the rsync service

Open Control Panel-- > Administrative tools-- > Services:

Find a RsyncServer service and start it.

This is the end of the server side configuration, and then the client side is configured.

CLIENT:

(1) install client software package: cwRsync_2.0.10_Installer.zip

(2) Open cmd and perform the following operations to test whether the server has started the service normally:

Cd C:\ Program Files\ cwRsync\ bin

Telnet 192.168.71.134 22

Telnet 192.168.71.134 873

If the above test is successful, you can execute the synchronization plan at this time:

Rsync-vzrtopg-progress-delete 192.168.71.134::wwwroot / cygdrive/c/Inetpub/wwwroot

Or:

Rsync-vzrtopg-progress-delete 192.168.71.134:/cygdrive/d/rsync / cygdrive/c/Inetpub/wwwroot

(at this point, you will be prompted for a password, the user name is administrator, and the password is 192.168.0.201 administrator login password)

At this point, you have completed the synchronization of the installation configuration from windows to windows.

If you regularly synchronize files on the server, you can add them to the task schedule.

Rsync-test.bat

@ echo off

Set RSYNC_HOME=c:\ Program Files\ cwRsync\ bin

Cd RSYNC_HOME%

C:

Rsync-vzrtopg-progress-delete 192.168.71.134::wwwroot / cygdrive/c/Inetpub/wwwroot

Example of the command:

+ + +

Rsync-vzrtopg-delete-exclude "count/"-exclude "index.html"-progress 192.168.0.1::imdac / cygdrive/d/imdac

In the command line-vzrtopg, v is verbose,z is compressed, r is recursive,topg are parameters that keep the original attributes of the file, such as owner and time. -- progress means to show detailed progress.-- delete means that if the server deletes the file, then the client deletes the file accordingly to maintain true consistency. -- exclude "count/" means that files in the count directory are not backed up. -- exclude "windex.html" means that welcome.html files are not backed up.

+ + +

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report