요구환경
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를 하게 되면 실행된다
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 5330 | 13년 전 | 775 | ||
| 5329 | 13년 전 | 711 | ||
| 5328 | 13년 전 | 642 | ||
| 5327 | 13년 전 | 886 | ||
| 5326 |
downmix
|
13년 전 | 1123 | |
| 5325 |
techer
|
13년 전 | 3149 | |
| 5324 |
techer
|
13년 전 | 979 | |
| 5323 | 13년 전 | 1190 | ||
| 5322 |
김준수사랑
|
13년 전 | 898 | |
| 5321 |
다케미카코
|
13년 전 | 759 | |
| 5320 |
|
13년 전 | 999 | |
| 5319 |
한번잘해보자
|
13년 전 | 1011 | |
| 5318 |
|
13년 전 | 1276 | |
| 5317 |
techer
|
13년 전 | 2707 | |
| 5316 |
techer
|
13년 전 | 3151 | |
| 5315 | 13년 전 | 1180 | ||
| 5314 |
티즈코리아
|
13년 전 | 1231 | |
| 5313 | 13년 전 | 712 | ||
| 5312 |
|
13년 전 | 1877 | |
| 5311 |
innis
|
13년 전 | 775 | |
| 5310 | 13년 전 | 864 | ||
| 5309 |
changho
|
13년 전 | 663 | |
| 5308 |
|
13년 전 | 1368 | |
| 5307 |
|
13년 전 | 805 | |
| 5306 | 13년 전 | 1189 | ||
| 5305 |
세상속으로
|
13년 전 | 1169 | |
| 5304 | 13년 전 | 673 | ||
| 5303 | 13년 전 | 2264 | ||
| 5302 | 13년 전 | 1400 | ||
| 5301 | 13년 전 | 1114 | ||
| 5300 |
프로프리랜서
|
13년 전 | 1093 | |
| 5299 | 13년 전 | 877 | ||
| 5298 | 13년 전 | 685 | ||
| 5297 |
나랑사귈래
|
13년 전 | 613 | |
| 5296 | 13년 전 | 1340 | ||
| 5295 | 13년 전 | 1121 | ||
| 5294 | 13년 전 | 732 | ||
| 5293 |
|
13년 전 | 5826 | |
| 5292 |
|
13년 전 | 794 | |
| 5291 | 13년 전 | 623 | ||
| 5290 | 13년 전 | 560 | ||
| 5289 | 13년 전 | 657 | ||
| 5288 | 13년 전 | 1174 | ||
| 5287 | 13년 전 | 767 | ||
| 5286 | 13년 전 | 980 | ||
| 5285 | 13년 전 | 1327 | ||
| 5284 |
미스홍당무
|
13년 전 | 864 | |
| 5283 |
basketball
|
13년 전 | 1767 | |
| 5282 | 13년 전 | 797 | ||
| 5281 |
|
13년 전 | 811 | |
| 5280 | 13년 전 | 1219 | ||
| 5279 | 13년 전 | 1389 | ||
| 5278 |
크라이스트
|
13년 전 | 2055 | |
| 5277 |
|
13년 전 | 734 | |
| 5276 |
그누보드환자이송
|
13년 전 | 792 | |
| 5275 | 13년 전 | 705 | ||
| 5274 | 13년 전 | 1377 | ||
| 5273 | 13년 전 | 2008 | ||
| 5272 | 13년 전 | 1121 | ||
| 5271 | 13년 전 | 1436 | ||
| 5270 | 13년 전 | 809 | ||
| 5269 | 13년 전 | 533 | ||
| 5268 | 13년 전 | 671 | ||
| 5267 | 13년 전 | 1193 | ||
| 5266 | 13년 전 | 1860 | ||
| 5265 | 13년 전 | 1631 | ||
| 5264 |
크라이스트
|
13년 전 | 1213 | |
| 5263 |
|
13년 전 | 1266 | |
| 5262 |
제이티37
|
13년 전 | 588 | |
| 5261 |
|
13년 전 | 785 | |
| 5260 |
quenya
|
13년 전 | 2076 | |
| 5259 | 13년 전 | 712 | ||
| 5258 | 13년 전 | 735 | ||
| 5257 |
크라이스트
|
13년 전 | 4600 | |
| 5256 | 13년 전 | 1259 | ||
| 5255 | 13년 전 | 3270 | ||
| 5254 |
|
13년 전 | 712 | |
| 5253 | 13년 전 | 773 | ||
| 5252 | 13년 전 | 774 | ||
| 5251 | 13년 전 | 730 | ||
| 5250 |
dudn1114
|
13년 전 | 1294 | |
| 5249 | 13년 전 | 673 | ||
| 5248 | 13년 전 | 743 | ||
| 5247 | 13년 전 | 2085 | ||
| 5246 | 13년 전 | 511 | ||
| 5245 | 13년 전 | 2201 | ||
| 5244 | 13년 전 | 1464 | ||
| 5243 |
|
13년 전 | 976 | |
| 5242 | 13년 전 | 770 | ||
| 5241 | 13년 전 | 1853 | ||
| 5240 |
|
13년 전 | 510 | |
| 5239 | 13년 전 | 1039 | ||
| 5238 | 13년 전 | 1226 | ||
| 5237 | 13년 전 | 1122 | ||
| 5236 | 13년 전 | 591 | ||
| 5235 |
|
13년 전 | 771 | |
| 5234 |
뭐먹고살지ㅠ
|
13년 전 | 1033 | |
| 5233 | 13년 전 | 3599 | ||
| 5232 | 13년 전 | 3143 | ||
| 5231 | 13년 전 | 3732 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기