CwRsyncServer enables Real-time Data Synchronization from Windows to Linux servers
Because the company has two Windows servers, the development usually uploads some data or modifies some things on these two servers during operation, the Linux server must be consistent with the data on Windows without human implementation. Based on this process, it took some time yesterday, after completing the basic test implementation process, we will record the process today to facilitate future viewing, hoping to help the still confused friends.
Monitor host files and directories using inotifywait
Using inotify + rsync for Linux File batch update
Inotify-tools + rsync real-time file synchronization installation and configuration
Complete rsync synchronization Configuration
Step 1: Install cwRsyncServer4.1.0 on Windows and the configuration process:
Download the installation package cwRsyncServer4.1.0 on Windows. If you want to install a Windows server on a virtual machine and your Windows Server cannot be connected to the Internet, download the package on the local machine and copy it, if you do not know how to copy the file to Windows, create an ftp server on Linux and share the file.
For cwRsyncServer4.1.0, see the following connection:
------------------------------------------ Split line ------------------------------------------
Free in http://linux.bkjia.com/
The username and password are both www.bkjia.com
The specific download directory is in/July/8/13cwRsyncServer to synchronize data from Windows to Linux server in real time.
For the download method, see
------------------------------------------ Split line ------------------------------------------
If this problem occurs during copying: Windows 2003's current security settings do not allow file download from this location:
You only need to set the Internet option --> Security --> Custom Level to find "File Download" in the download item and enable it.
The following figure shows the cwRsyncServer installation process. You can click the next step and paste it here:
Create an account and use the default one. Set your own password.
After the installation is complete, start the configuration below, open the file directory under the installation directory: C: \ Program Files (x86) \ ICW, modify the content of the rsyncd. conf configuration file to the following configuration;
Note that, if uid = 0 and gid = 0 are not specified, the following situations may occur during remote connection:
At this point, we need to create a new rsyncdata directory under drive F, which means that all the data in it is synchronized to the specified directory in linux, that is, rsyncd in Windows. the file corresponding to the [rsyncdata] module of the conf configuration file. After the configuration is created, we need to modify the configuration:
1234567
[Rsyncdata] # specify the module header information
Path =/cygdrive/f/rsyncdata # directory for data synchronization. This directory is the rsyncdata directory under drive f.
Read only = true # whether it is read-only
List = no
Hosts allow = 10.17.1.200, 10.17.1.88, 10.17.1.60 # accessible hosts separated by commas
Auth users = rsync # specify the authenticated user name
Secrets file =/cygdrive/f/rsyncd. secrets # specify the path for storing the password file of the authenticated user. This path refers to rsyncd. secrets under drive f. You need to create this file later.
You also need to modify the attributes of the rsyncdata directory, right-click the file and select the attributes:
After entering the SvcCWRSYNC user name, click "Check name" to match the user name. Then click "OK.
Finally, modify the access permission of the file to the user:
Select My computer-right-click Management-services and applications-services, find RsyncSever, double-click-start, and start the server:
It should be said that the configuration in Windows is complete, but it should be noted that if you need to use telnet to connect to Windows in linux, remember to disable the firewall in Windows, otherwise, you may not be able to connect to the Windows service. You can test it in this document. The following cases indicate that you can connect to the Windows service.
Enter your local Windows Address and rsync listening port in cmd. The default listening port is 873. Press Enter:
If @ RSYNCD: 30.0 is displayed, it indicates that it can be connected.
For more details, please continue to read the highlights on the next page: