티스토리 뷰

Linux

LSYNCD

CHOMAN 2016. 12. 22. 13:15

LSYNCD



실시간 파일 동기화 유틸, 리눅스 전용, RSYNC 와 연동하여 같이 구동함




LSYNCD 홈페이지


 

https://axkibe.github.io/lsyncd/





원본서버 (lsyncd) --> 복사서버 (rsyncd.conf, xinetd)




원본서버 작업


 

yum install lsyncd -y





Inotify 파일 시스템을 감지하는 커널모듈 확인



[root@localhost ~]# grep -i inotify /boot/config-`uname -r`

CONFIG_INOTIFY=y

CONFIG_INOTIFY_USER=y




Inotify 설정 (디렉토리가 8000개 넘어가는 경우는 파일 동기화가 되지 않았다.)


 

cat /proc/sys/fs/inotify/max_user_watches

8192




위 기본값 수정하기 위해 /etc/sysctl.conf 파일에 추가해준다.



fs.inotify.max_user_watches = 24000 (라인추가)

 



커널 파라메타 적용



sysctl -p





/etc/lsyncd.conf



settings

{

logfile = '/var/log/lsync'

}


sync{default.rsync, source="/home/xe/",delay = 0,  target="아이피::xe"}

 


delay = 0 --> 실시간으로 동기화, 



lsyncd 데몬 시작



/etc/init.d/lsyncd start

 




프로세스 확인



root     16609     1  0 12:03 ?        00:00:00 /usr/bin/lsyncd -pidfile /var/run/lsyncd.pid /etc/lsyncd.conf

 





복사본 설정



 

[xe]

path = /home/xe

comment = lsyncd test

uid = root

gid = root

use chroot = yes

read only = no

hosts allow = 접근 허용 아이피

max connections = 100

timeout 600





/etc/xinetd.d/rsync


 

service rsync

{

        disable = no

        flags           = IPv6

        socket_type     = stream

        wait            = no

        user            = root

        server          = /usr/bin/rsync

        server_args     = --daemon

        log_on_failure  += USERID




슈퍼데몬 시작


 

/etc/init.d/xinetd start




LSYNCD 로그 점검 (Calling --> 호출, Finished --> 동기화 완료 의미인듯)



Thu Jan 19 10:01:14 2017 Normal: Calling rsync with filter-list of new/modified files/dirs

/kjh

/

Thu Jan 19 10:01:14 2017 Normal: Calling rsync with filter-list of new/modified files/dirs

/kjh

/

Thu Jan 19 10:01:14 2017 Normal: Calling rsync with filter-list of new/modified files/dirs

/kjh

/

Thu Jan 19 10:01:14 2017 Normal: Calling rsync with filter-list of new/modified files/dirs

/kjh

/

Thu Jan 19 10:01:14 2017 Normal: Calling rsync with filter-list of new/modified files/dirs

/kjh

/

Thu Jan 19 10:01:14 2017 Normal: Calling rsync with filter-list of new/modified files/dirs

/kjh

/

Thu Jan 19 10:01:14 2017 Normal: Calling rsync with filter-list of new/modified files/dirs

/kjh

/

Thu Jan 19 10:01:14 2017 Normal: Finished a list after exitcode: 0

Thu Jan 19 10:01:14 2017 Normal: Finished a list after exitcode: 0

Thu Jan 19 10:01:34 2017 Normal: Finished a list after exitcode: 0

Thu Jan 19 10:01:34 2017 Normal: Finished a list after exitcode: 0

Thu Jan 19 10:01:34 2017 Normal: Finished a list after exitcode: 0

Thu Jan 19 10:01:34 2017 Normal: Finished a list after exitcode: 0

Thu Jan 19 10:01:34 2017 Normal: Finished a list after exitcode: 0

 


위 로그를 보면 14초 --> 34초 에 완료된게 보이는데 20초의 Term 이 보인다.


우선은 rsyncd.conf 의 옵션중 max connection 이랑 timeout 옵션을 제거하고 다시 테스팅... 진행



'Linux' 카테고리의 다른 글

리눅스 UUID 로 디스크 추가 / 삭제  (0) 2017.02.21
MongoDB Driver for PHP  (0) 2017.02.02
MRTG 송 수신 그래프 바꾸기  (0) 2016.09.29
sudoers 설정  (0) 2016.08.05
커널패닉시 자동 리부팅 하기  (0) 2016.05.04
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/04   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30
글 보관함