• linux Sersync 上配置客户端


    1、安装 Rsync 并配置相关权限

    在 SERSYNC 上配置 RSYNC 客户端相关权限认证:

    [root@SERSYNC /]# yum install rsync -y

    [root@SERSYNC /]# echo "redhat" > /etc/rsync.password

    [root@SERSYNC /]# chmod 600 /etc/rsync.password

    [root@SERSYNC /]# cat /etc/rsync.password

    Redhat

    [root@SERSYNC ~]# ll /etc/rsync.password

    -rw-------. 1 root root 7 Jun 4 00:20 /etc/rsync.password

    2、在 SERSYNC 上手动测试 rsync 的同步情况

    特别强调:此步很关键,如果这不能同步,后面的 SERSYNC 配好了也不会同步数据。

    1分别创建待同步数据

    [root@SERSYNC ~]# touch /data/{web/index.html,download/a.jpg}

    [root@SERSYNC ~]# tree /data

    /data

    ├── download

    │  └── a.jpg

    └── web

    └── index.html

    2 directories, 2 files

    3执行同步命令

    针对 SWEB1(172.16.100.1):

    [root@SERSYNC ~]# rsync -avzP /data/web rsync_bak@172.16.100.1::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

    [root@SERSYNC ~]# rsync -avzP /data/download/ rsync_bak@172.16.100.1::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

    [root@SERSYNC ~]# rsync -avzP /data/web rsync_bak@172.16.100.2::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

    [root@SERSYNC ~]# rsync -avzP /data/download/ rsync_bak@172.16.100.2::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 才能调用这些命令来自动推送。

    [root@SWEB1 ~]# tree /data/

    /data/

    ├── download

    │  └── a.jpg

    └── web

    └── web

    └── index.html

  • 相关阅读:
    Cdnbest的cdn程序默认支持web Socket
    在winsshd 中添加id_rsa.pub 实现Windows 服务器主机自动信任Linux 客户端
    Excel 如何排序与多关键字排序
    JZOJ 6316. djq的朋友圈(状压DP)
    JZOJ 6309. 完全背包(矩阵max)
    JZOJ 6307. 安排(归并排序+分治)
    JZOJ 6299. 2019.08.12【NOIP提高组A】工厂(二分图+状压DP)
    JZOJ 6276. 【noip提高组模拟1】树(DFS序+扫描线)
    JZOJ 6278. 2019.8.5【NOIP提高组A】跳房子 (分块模拟)
    JZOJ 6278. 2019.8.5【NOIP提高组A】跳房子 (分块模拟)
  • 原文地址:https://www.cnblogs.com/fanweisheng/p/11327343.html
Copyright © 2020-2023  润新知