lsyncd ½Ç½Ã°£ µ¿±âÈ­

   Á¶È¸ 9256   Ãßõ 0    

https://www.ehostidc.co.kr/cscenter/technical.php?ptype=view&idx=271&¡¦ (611)
https://www.ehostidc.co.kr/cscenter/consulting.php (529)


Lsycnd server: x.x.x.107

Lsyncd client: x.x.x.108 

 

1) Client rsync 설치 

yum install -y rsync xinetd

 

2) Client rsync 설정 



vi /etc/rsyncd.conf

[SYNC] 

comment = web_02 (hostname) 

path=/var/www/html (path)

hosts allow = x.x.x.107 (lsyncd server IP) 

uid = 0 

gid = 0

use chroot = yes 

read only = no

 

3) Client iptables 설정 및 적용 

vi /etc/sysconfig/iptables

-A INPUT -m state --state NEW -m udp -p udp --dport 873 -j ACCEPT 

-A INPUT -m state --state NEW -m tcp -p tcp --dport 873 -j ACCEPT 

wq!

service iptables restart

 

4) Client rsyncd 설정 및 확인 

service xinetd restart

chkconfig xinetd on

 

5) Server lsyncd 설치 

Yum install –y lsyncd

 

6) Server ssh 인증키 생성 및 이동

Ssh-keygen

cp /root/.ssh/id_rsa.pub /root/

 

7) ssh 접속 테스트 

8) Server lsync 설정 

vi /etc/lsyncd.conf

settings { 

        logfile = "/var/log/lsyncd/lsyncd.log",

        statusFile = "/var/log/lsyncd/lsyncd-status.log", 

        statusInterval = 20

     } 

sync { 

    default.rsync,

    source="/var/www/html", 

    target="x.x.x.108:/var/www/html",

    delay = 1, 

    rsync = {

         compress = true, 

         acls = true,

         verbose = true, 

         rsh = "/usr/bin/ssh -p 22 -o StrictHostKeyChecking=no" }

 }

 

9) Server iptables 설정 및 적용 

vi /etc/sysconfig/iptables

-A INPUT -m state --state NEW -m udp -p udp --dport 873 -j ACCEPT 

-A INPUT -m state --state NEW -m tcp -p tcp --dport 873 -j ACCEPT

wq! 

service iptables restart

 

10) Server lsyncd 설정 및 확인 

Service lsyncd start

Chkconfig lsyncd on

 

11) TEST






























ªÀº±Û Àϼö·Ï ½ÅÁßÇϰÔ.


PDS
Á¦¸ñPage 20/80
01-26   114837   UPDF
2015-12   2339923   ¹é¸Þ°¡
2019-01   10398   ȲÁø¿ì
2021-03   10415   ¹«¾Æ
2024-02   10433   Å볪¹«
2021-10   10444   ÀÌõdz
2019-12   10474   ½ºÄµl¹ÎÇö±â
2020-02   10480   ±èȲÁß
2018-08   10485   FOXBI
2019-05   10489   isaiah
2019-11   10520   µö·¯´×¼­¹ö
2017-06   10575   ¹«¾Æ
2020-07   10614   È­Á¤Å¥»ï
2020-10   10625   È­Á¤Å¥»ï
2022-01   10650   ½ºÄµl¹ÎÇö±â
2019-02   10655   Æä¸£¼¼¿ì½º
2025-09   10667   »õÃÑ
2019-03   10697   ¿¥ºê¸®¿À
2018-07   10712   mt22
2017-06   10726   ±èȲÁß
2015-12   10745   ¼Ò¸Á»ç¶û71
2020-06   10767   µö·¯´×¼­¹ö