源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

Win2003下cwRsyncServer服务端与cwRsync客户端数据同步实例教程

  • 时间:2021-12-25 18:39 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:Win2003下cwRsyncServer服务端与cwRsync客户端数据同步实例教程
[b]说明:[/b] cwRsyncServer服务端   IP:192.168.21.128 cwRsync客户端   IP:192.168.21.129 [b]实现目的:[/b] 把服务端D:\data目录中的数据通过任务计划定期同步到客户端D:\data目录中 [b]附件:[/b] cwRsyncServer下载地址与cwRsync下载地址:[url=http://s.jb51.net]http://s.jb51.net[/url] [b]具体操作:[/b] [b]一、在服务端安装cwRsyncServer[/b] 解压cwRsyncServer_4.0.3_Installer.zip,双击cwRsyncServer_4.0.3_Installer.exe [img]http://files.jb51.net/file_images/article/201507/2015070916374634.jpg[/img] Next [img]http://files.jb51.net/file_images/article/201507/2015070916374635.jpg[/img] I Agre(同意) [img]http://files.jb51.net/file_images/article/201507/2015070916374736.jpg[/img] 安装路径,默认即可 Next [img]http://files.jb51.net/file_images/article/201507/2015070916374737.jpg[/img] Service account:SvcCWRSYNC    (新建的一个系统账户) Type password:密码 Confirm password:密码 备注:系统会自动创建一个账户:SvcCWRSYNC来运行cwRsyncServer服务端程序 以上信息默认即可 Install (安装) [img]http://files.jb51.net/file_images/article/201507/2015070916374738.jpg[/img] Close(关闭),安装完成 [img]http://files.jb51.net/file_images/article/201507/2015070916374739.jpg[/img] 开始-设置-控制面板-管理工具-服务 找到RsyncSever选项,双击打开 启动类型:自动 点“启动” [img]http://files.jb51.net/file_images/article/201507/2015070916374740.jpg[/img] 服务启动成功,点关闭 [img]http://files.jb51.net/file_images/article/201507/2015070916374741.jpg[/img] 确定 [img]http://files.jb51.net/file_images/article/201507/2015070916374742.jpg[/img] 打开D盘,右键单击data文件夹,选择属性,切换到安全选项,点添加 输入:SvcCWRSYNC 确定 [img]http://files.jb51.net/file_images/article/201507/2015070916374743.jpg[/img] 允许所有权限 应用,确定 [img]http://files.jb51.net/file_images/article/201507/2015070916374744.jpg[/img] 打开C:\Program Files\ICW目录 用记事本打开rsyncd.conf,修改添加以下内容(修改之前先备份文件为rsyncd.confbak) use chroot = false strict modes = false hosts allow = * log file = rsyncd.log # Module definitions # Remember cygwin naming conventions : c:\work becomes /cygwin/c/work # #[test] #path = /cygdrive/c/work #read only = false #transfer logging = yes [data] path = /cygdrive/d/data read only = true #客户端只读 list = no  #不允许列出文件 hosts allow=192.168.21.129  #允许连接IP,多个IP中间用英文状态下逗号隔,不限制IP填写 *即可 auth users =userdata  #允许连接的用户名 secrets file = etc/rsyncd.secrets  #存放用户名密码的认证文件路径 修好完成之后,保存退出 [img]http://files.jb51.net/file_images/article/201507/2015070916374745.jpg[/img] 在C:\Program Files\ICW\etc目录下面新建rsyncd.secrets文件 用记事本打开,输入以下内容 userdata:123456    #用户名:密码 最后保存退出 [b]cwRsyncServer服务端安装设置完成[/b] [b]二、在客户端安装cwRsync[/b] 解压cwRsync_4.0.3_Installer.zip,双击cwRsync_4.0.3_Installer.exe [img]http://files.jb51.net/file_images/article/201507/2015070916374746.jpg[/img] Next [img]http://files.jb51.net/file_images/article/201507/2015070916374747.jpg[/img] I Agree [img]http://files.jb51.net/file_images/article/201507/2015070916374748.jpg[/img] Next [img]http://files.jb51.net/file_images/article/201507/2015070916374849.jpg[/img] 安装路径,默认即可 Install(安装) [img]http://files.jb51.net/file_images/article/201507/2015070916374850.jpg[/img] Close(关闭),安装完成 [img]http://files.jb51.net/file_images/article/201507/2015070916374851.jpg[/img] 开始-运行-cmd 输入telnet 192.168.21.128 873   #测试客户端是否与服务端连接成功 出现下面的界面,说明连接成功 [b]注意:cwRsyncServer服务端必须开启防火墙873端口[/b] [img]http://files.jb51.net/file_images/article/201507/2015070916374852.jpg[/img] 测试完成之后,关闭命令行窗口 [img]http://files.jb51.net/file_images/article/201507/2015070916374853.jpg[/img] 开始-运行-cmd 确定 [img]http://files.jb51.net/file_images/article/201507/2015070916374854.jpg[/img] 输入:cd C:\Program Files\cwRsync\bin 继续输入:rsync -vzrtopg --port=873 --progress --delete [email protected]::data /cygdrive/d/data 提示输入密码:123456 开始同步数据 [img]http://files.jb51.net/file_images/article/201507/2015070916374855.jpg[/img] 数据同步完成 [img]http://files.jb51.net/file_images/article/201507/2015070916374856.jpg[/img] 打开C:\Program Files\cwRsync\bin目录 新建passwd.txt 输入:123456 保存退出 [img]http://files.jb51.net/file_images/article/201507/2015070916374857.jpg[/img] 继续在C:\Program Files\cwRsync\bin目录新建 data.bat文件 用记事本打开,输入以下内容 @echo off echo. echo 开始同步数据,请稍等... echo. cd C:\Program Files\cwRsync\bin rsync -vzrtopg --port=873 --progress --delete [email protected]::data /cygdrive/d/data < passwd.txt echo. echo 数据同步完成 echo. 最后保存退出 [img]http://files.jb51.net/file_images/article/201507/2015070916374858.jpg[/img] 开始-设置-控制面板-任务计划 双击”添加任务计划“ 下一步 [img]http://files.jb51.net/file_images/article/201507/2015070916374859.jpg[/img] 浏览打开C:\Program Files\cwRsync\bin\data.bat [img]http://files.jb51.net/file_images/article/201507/2015070916374860.jpg[/img] 每天 下一步 [img]http://files.jb51.net/file_images/article/201507/2015070916374961.jpg[/img] 选择每天执行的时间 下一步 [img]http://files.jb51.net/file_images/article/201507/2015070916374962.jpg[/img] 输入系统管理员的密码 下一步 [img]http://files.jb51.net/file_images/article/201507/2015070916374963.jpg[/img] 完成 任务计划添加完成,客户端每天13:59分会自动同步服务端D:\data目录中的数据到自己的D:\data中 [img]http://files.jb51.net/file_images/article/201507/2015070916374964.jpg[/img] 打开任务计划,右键data,属性,切换到日程安排,选择高级 可以设置每隔多长时间执行一次 [b]至此,Windows Server 2003下cwRsyncServer服务端与cwRsync客户端数据同步实例教程完成[/b]    
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部