요구환경
kernel 2.6.13 이상 버전
rsync package
libxml2 package
libxml2-devel package
rsync package
libxml2 package
libxml2-devel package
lsync 사용법
lsyncd [OPTION]... [SOURCE] [TARGET 1] [TARGET 2] ...
[SOURCE] => 동기화시 원본이 존제하는 위치 /home/test/
[TARGET X] => 동기화가 필요한 서버 192.168.0.3::HOME/test
[OPTION]
--binary FILE rsync 실행 파일 위치
--conf FILE 실행시 로드할 설정 파일명 (DEFAULT: /etc/lsyncd.conf.xml)
--debug 디버그를 위한 로그
--exclude-from FILE 동기화시 제외시킬 패턴의 옵섭
--logfile FILE 로그 파일위치
--no-daemon 포그라운드로 실행 시킴
--pidfile FILE pid 파일 생성위치
설정방법
슬레이브 서버
rsyncd를 서비스에 추가시켜 rsync접속이 가능하도록 한다
/etc/rsyncd.conf -->
[HOME]
path = /home/test
uid = root
gid = root
use chroot = yes
read only = no # 마스터에서 배포시 쓰기가 가능해야 한다
max connections = 4
hosts allow = 192.168.0.1 # 마스터 서버에서만 접속이 가능하도록 설정
위와 같이 마스터서버에서만 rsync 데몬만 이용할수있도록 하며 마스터에서 파일을 슬레이브로 쓰는 형태이므로 쓰기원한을 주어야한다
세팅후 rsync 데몬을 시작한다 .
마스터 서버
데몬 직접 띄우기
# lsyncd /home/test/ 192.168.0.3::HOME/test
설정파일을 이용하여 실행시키기
/etc/lsyncd.conf.xml 파일을 생성하여
<lsyncd version="1">
<settings>
<logfile filename="/var/log/lsyncd"/>
<binary filename="/usr/bin/rsync"/>
<callopts>
<option text="-az%r"/>
<option text="--delete"/>
</callopts>
</settings>
<directory>
<source path="/home/test/"/>
<target path="192.168.0.2::HOME/"/>
</directory>
</lsyncd>
설정 파일을 작성하고
/etc/rc.d/init.d/lsyncd 파일을 생성하여
#!/bin/bash
# description: lsyncd auto start script
start() {
pid=`pidof lsyncd`
if [ $? -eq 0 ]; then
echo "lsyncd (pid $pid) is running..."
echo " "
else
echo "Starting lsyncd..."
echo " "
/usr/bin/lsyncd
fi
}
stop() {
echo "Stopping lsyncd..."
echo " "
/bin/kill -9 `/sbin/pidof lsyncd`
until [ -z $(/sbin/pidof lsyncd) ]; do :; done
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
status)
pid=`pidof lsyncd`
if [ $? -eq 0 ]; then
echo "lsyncd (pid $pid) is running..."
echo " "
else
echo "lsyncd is not running"
echo " "
fi
;;
*)
echo "Usage: lsyncd {start|stop|restart|status}"
exit 1
esac
exit $?
/etc/rc.d/init.d/lsyncd start를 하게 되면 실행된다
lsyncd [OPTION]... [SOURCE] [TARGET 1] [TARGET 2] ...
[SOURCE] => 동기화시 원본이 존제하는 위치 /home/test/
[TARGET X] => 동기화가 필요한 서버 192.168.0.3::HOME/test
[OPTION]
--binary FILE rsync 실행 파일 위치
--conf FILE 실행시 로드할 설정 파일명 (DEFAULT: /etc/lsyncd.conf.xml)
--debug 디버그를 위한 로그
--exclude-from FILE 동기화시 제외시킬 패턴의 옵섭
--logfile FILE 로그 파일위치
--no-daemon 포그라운드로 실행 시킴
--pidfile FILE pid 파일 생성위치
설정방법
슬레이브 서버
rsyncd를 서비스에 추가시켜 rsync접속이 가능하도록 한다
/etc/rsyncd.conf -->
[HOME]
path = /home/test
uid = root
gid = root
use chroot = yes
read only = no # 마스터에서 배포시 쓰기가 가능해야 한다
max connections = 4
hosts allow = 192.168.0.1 # 마스터 서버에서만 접속이 가능하도록 설정
위와 같이 마스터서버에서만 rsync 데몬만 이용할수있도록 하며 마스터에서 파일을 슬레이브로 쓰는 형태이므로 쓰기원한을 주어야한다
세팅후 rsync 데몬을 시작한다 .
마스터 서버
데몬 직접 띄우기
# lsyncd /home/test/ 192.168.0.3::HOME/test
설정파일을 이용하여 실행시키기
/etc/lsyncd.conf.xml 파일을 생성하여
<lsyncd version="1">
<settings>
<logfile filename="/var/log/lsyncd"/>
<binary filename="/usr/bin/rsync"/>
<callopts>
<option text="-az%r"/>
<option text="--delete"/>
</callopts>
</settings>
<directory>
<source path="/home/test/"/>
<target path="192.168.0.2::HOME/"/>
</directory>
</lsyncd>
설정 파일을 작성하고
/etc/rc.d/init.d/lsyncd 파일을 생성하여
#!/bin/bash
# description: lsyncd auto start script
start() {
pid=`pidof lsyncd`
if [ $? -eq 0 ]; then
echo "lsyncd (pid $pid) is running..."
echo " "
else
echo "Starting lsyncd..."
echo " "
/usr/bin/lsyncd
fi
}
stop() {
echo "Stopping lsyncd..."
echo " "
/bin/kill -9 `/sbin/pidof lsyncd`
until [ -z $(/sbin/pidof lsyncd) ]; do :; done
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
status)
pid=`pidof lsyncd`
if [ $? -eq 0 ]; then
echo "lsyncd (pid $pid) is running..."
echo " "
else
echo "lsyncd is not running"
echo " "
fi
;;
*)
echo "Usage: lsyncd {start|stop|restart|status}"
exit 1
esac
exit $?
/etc/rc.d/init.d/lsyncd start를 하게 되면 실행된다
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 5130 | 13년 전 | 750 | ||
| 5129 | 13년 전 | 1759 | ||
| 5128 | 13년 전 | 927 | ||
| 5127 | 13년 전 | 504 | ||
| 5126 | 13년 전 | 743 | ||
| 5125 | 13년 전 | 1348 | ||
| 5124 | 13년 전 | 817 | ||
| 5123 | 13년 전 | 454 | ||
| 5122 | 13년 전 | 993 | ||
| 5121 |
|
13년 전 | 1379 | |
| 5120 | 13년 전 | 496 | ||
| 5119 | 13년 전 | 472 | ||
| 5118 | 13년 전 | 400 | ||
| 5117 | 13년 전 | 714 | ||
| 5116 | 13년 전 | 449 | ||
| 5115 | 13년 전 | 904 | ||
| 5114 | 13년 전 | 937 | ||
| 5113 |
cookieyou
|
13년 전 | 1345 | |
| 5112 | 13년 전 | 528 | ||
| 5111 | 13년 전 | 817 | ||
| 5110 | 13년 전 | 4440 | ||
| 5109 | 13년 전 | 1061 | ||
| 5108 | 13년 전 | 403 | ||
| 5107 | 13년 전 | 474 | ||
| 5106 | 13년 전 | 631 | ||
| 5105 | 13년 전 | 1096 | ||
| 5104 | 13년 전 | 411 | ||
| 5103 |
프로프리랜서
|
13년 전 | 1339 | |
| 5102 | 13년 전 | 1582 | ||
| 5101 | 13년 전 | 457 | ||
| 5100 | 13년 전 | 367 | ||
| 5099 | 13년 전 | 518 | ||
| 5098 | 13년 전 | 2127 | ||
| 5097 | 13년 전 | 374 | ||
| 5096 | 13년 전 | 521 | ||
| 5095 | 13년 전 | 383 | ||
| 5094 | 13년 전 | 388 | ||
| 5093 | 13년 전 | 873 | ||
| 5092 | 13년 전 | 1052 | ||
| 5091 | 13년 전 | 405 | ||
| 5090 | 13년 전 | 505 | ||
| 5089 | 13년 전 | 949 | ||
| 5088 | 13년 전 | 401 | ||
| 5087 | 13년 전 | 1152 | ||
| 5086 | 13년 전 | 1477 | ||
| 5085 |
|
13년 전 | 3923 | |
| 5084 |
alexseo
|
13년 전 | 907 | |
| 5083 | 13년 전 | 1121 | ||
| 5082 | 13년 전 | 597 | ||
| 5081 | 13년 전 | 519 | ||
| 5080 | 13년 전 | 592 | ||
| 5079 | 13년 전 | 964 | ||
| 5078 | 13년 전 | 2175 | ||
| 5077 | 13년 전 | 664 | ||
| 5076 |
몰보는거야
|
13년 전 | 1687 | |
| 5075 |
|
13년 전 | 1764 | |
| 5074 | 13년 전 | 2005 | ||
| 5073 |
|
13년 전 | 763 | |
| 5072 |
프로프리랜서
|
13년 전 | 1035 | |
| 5071 |
프로프리랜서
|
13년 전 | 762 | |
| 5070 |
프로프리랜서
|
13년 전 | 873 | |
| 5069 |
뭐먹고살지ㅠ
|
13년 전 | 781 | |
| 5068 |
danielle
|
13년 전 | 643 | |
| 5067 | 13년 전 | 758 | ||
| 5066 | 13년 전 | 833 | ||
| 5065 | 13년 전 | 902 | ||
| 5064 | 13년 전 | 1715 | ||
| 5063 | 13년 전 | 430 | ||
| 5062 | 13년 전 | 801 | ||
| 5061 | 13년 전 | 575 | ||
| 5060 | 13년 전 | 379 | ||
| 5059 |
senseme
|
13년 전 | 835 | |
| 5058 | 13년 전 | 2843 | ||
| 5057 | 13년 전 | 1909 | ||
| 5056 | 13년 전 | 1479 | ||
| 5055 | 13년 전 | 437 | ||
| 5054 |
senseme
|
13년 전 | 1060 | |
| 5053 |
senseme
|
13년 전 | 1903 | |
| 5052 |
senseme
|
13년 전 | 1035 | |
| 5051 |
senseme
|
13년 전 | 1057 | |
| 5050 |
senseme
|
13년 전 | 796 | |
| 5049 |
senseme
|
13년 전 | 974 | |
| 5048 | 13년 전 | 1982 | ||
| 5047 | 13년 전 | 487 | ||
| 5046 |
우렁찬우렁이
|
13년 전 | 853 | |
| 5045 |
크라이스트
|
13년 전 | 2145 | |
| 5044 | 13년 전 | 958 | ||
| 5043 | 13년 전 | 523 | ||
| 5042 | 13년 전 | 964 | ||
| 5041 |
|
13년 전 | 803 | |
| 5040 |
스마일라니
|
13년 전 | 865 | |
| 5039 | 13년 전 | 1129 | ||
| 5038 | 13년 전 | 1920 | ||
| 5037 | 13년 전 | 1041 | ||
| 5036 |
cookieyou
|
13년 전 | 1397 | |
| 5035 | 13년 전 | 492 | ||
| 5034 | 13년 전 | 553 | ||
| 5033 | 13년 전 | 485 | ||
| 5032 | 13년 전 | 430 | ||
| 5031 | 13년 전 | 727 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기