linux Sersync 上配置客户端
1、安装 Rsync 并配置相关权限 ? 在 SERSYNC 上配置 RSYNC 客户端相关权限认证: ? ? [[email?protected] /]# yum install rsync -y ? ? [[email?protected] /]# echo "redhat" > /etc/rsync.password ? ? [[email?protected] /]# chmod 600 /etc/rsync.password ? [[email?protected] /]# cat /etc/rsync.password ? Redhat ? [[email?protected] ~]# ll /etc/rsync.password ? -rw-------. 1 root root 7 Jun 4 00:20 /etc/rsync.password ? 2、在 SERSYNC 上手动测试 rsync 的同步情况 ? 特别强调:此步很关键,如果这不能同步,后面的 SERSYNC 配好了也不会同步数据。 ? 1)分别创建待同步数据 ? ? [[email?protected] ~]# touch /data/{web/index.html,download/a.jpg} ? [[email?protected] ~]# tree /data ? /data ? ├── download ? │ ?└── a.jpg ? └── web ? ? └── index.html ? ? 2 directories,2 files ? 3)执行同步命令 ? 针对 SWEB1(172.16.100.1): ? ? [[email?protected] ~]# rsync -avzP /data/web [email?protected]::web/ --password-fil ? ? e=/etc/rsync.password ? ? sending incremental file list ? ? web/ ? ? web/index.html ? ? 0 100%??? 0.00kB/s??? 0:00:00 (xfer#1,to-check=0/2) ? ? sent 92 bytes received 31 bytes 246.00 bytes/sec ? ? total size is 0 speedup is 0.00 ? ? [[email?protected] ~]# rsync -avzP /data/download/ [email?protected]::download/ -- ? ? password-file=/etc/rsync.password ? sending incremental file list ? ./ ? a.jpg ? 0 100%??? 0.00kB/s??? 0:00:00 (xfer#1,to-check=0/2) ? sent 75 bytes received 30 bytes 210.00 bytes/sec total size is 0 speedup is 0.00 ? ? [[email?protected] ~]# rsync -avzP /data/web [email?protected]::web/ --password-fil ? e=/etc/rsync.password sending incremental file list web/ web/index.html ? 0 100%??? 0.00kB/s??? 0:00:00 (xfer#1,to-check=0/2) ? ? sent 92 bytes received 31 bytes 246.00 bytes/sec ? ? total size is 0 speedup is 0.00 ? ? [[email?protected] ~]# rsync -avzP /data/download/ [email?protected]::download/ -- ? ? password-file=/etc/rsync.password ? ? sending incremental file list ? ? ./ ? ? a.jpg ? ? 0 100%??? 0.00kB/s??? 0:00:00 (xfer#1,to-check=0/2) ? ? sent 75 bytes received 30 bytes 70.00 bytes/sec ? ? total size is 0 speedup is 0.0 同步完之后,分别对 SWEB1,SWEB2 的相应目录进行查看!此处以 SWEB1 为例:提示: 在后面进行部署 SERSYNC 之前,SERSYNC 主服务器(即 SERSYNC)上必须要确保手动可以把 文件推送到 SWEB1,SWEB2 上,这样后续 SERSYNC 才能调用这些命令来自动推送。 ? ? [[email?protected] ~]# tree /data/ ? /data/ ? ├── download ? │ ?└── a.jpg ? └── web ? └── web ? └── index.html (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |