요구환경
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를 하게 되면 실행된다
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 4830 |
임페리얼웹
|
13년 전 | 1356 | |
| 4829 |
임페리얼웹
|
13년 전 | 703 | |
| 4828 | 13년 전 | 3461 | ||
| 4827 |
|
13년 전 | 1222 | |
| 4826 | 13년 전 | 2730 | ||
| 4825 | 13년 전 | 1065 | ||
| 4824 |
gnuskin쩜net
|
13년 전 | 757 | |
| 4823 | 13년 전 | 809 | ||
| 4822 |
visualp
|
13년 전 | 681 | |
| 4821 |
다케미카코
|
13년 전 | 1256 | |
| 4820 | 13년 전 | 1344 | ||
| 4819 | 13년 전 | 2657 | ||
| 4818 |
크라이스트
|
13년 전 | 4235 | |
| 4817 |
임페리얼웹
|
13년 전 | 698 | |
| 4816 | 13년 전 | 3257 | ||
| 4815 |
하모니칼수
|
13년 전 | 642 | |
| 4814 | 13년 전 | 1104 | ||
| 4813 | 13년 전 | 701 | ||
| 4812 |
임페리얼웹
|
13년 전 | 1083 | |
| 4811 |
임페리얼웹
|
13년 전 | 1831 | |
| 4810 | 13년 전 | 1144 | ||
| 4809 | 13년 전 | 622 | ||
| 4808 | 13년 전 | 1277 | ||
| 4807 |
너는나의봄이다
|
13년 전 | 895 | |
| 4806 | 13년 전 | 1290 | ||
| 4805 | 13년 전 | 1772 | ||
| 4804 | 13년 전 | 1067 | ||
| 4803 |
한번잘해보자
|
13년 전 | 715 | |
| 4802 | 13년 전 | 1904 | ||
| 4801 |
꼬꼬아부지
|
13년 전 | 1182 | |
| 4800 | 13년 전 | 766 | ||
| 4799 |
|
13년 전 | 705 | |
| 4798 | 13년 전 | 1066 | ||
| 4797 |
한번잘해보자
|
13년 전 | 605 | |
| 4796 | 13년 전 | 1718 | ||
| 4795 | 13년 전 | 995 | ||
| 4794 |
|
13년 전 | 1014 | |
| 4793 |
|
13년 전 | 650 | |
| 4792 | 13년 전 | 1288 | ||
| 4791 | 13년 전 | 2096 | ||
| 4790 |
|
13년 전 | 616 | |
| 4789 |
한번잘해보자
|
13년 전 | 510 | |
| 4788 |
|
13년 전 | 683 | |
| 4787 | 13년 전 | 3277 | ||
| 4786 |
한번잘해보자
|
13년 전 | 747 | |
| 4785 | 13년 전 | 1300 | ||
| 4784 | 13년 전 | 1075 | ||
| 4783 |
|
13년 전 | 719 | |
| 4782 | 13년 전 | 7730 | ||
| 4781 |
크라운엠버서더
|
13년 전 | 1102 | |
| 4780 | 13년 전 | 1751 | ||
| 4779 | 13년 전 | 751 | ||
| 4778 | 13년 전 | 1088 | ||
| 4777 | 13년 전 | 915 | ||
| 4776 | 13년 전 | 1887 | ||
| 4775 | 13년 전 | 3318 | ||
| 4774 | 13년 전 | 1530 | ||
| 4773 | 13년 전 | 3237 | ||
| 4772 | 13년 전 | 1409 | ||
| 4771 | 13년 전 | 3855 | ||
| 4770 | 13년 전 | 1402 | ||
| 4769 | 13년 전 | 894 | ||
| 4768 | 13년 전 | 1867 | ||
| 4767 | 13년 전 | 2647 | ||
| 4766 | 13년 전 | 1562 | ||
| 4765 | 13년 전 | 1375 | ||
| 4764 | 13년 전 | 3137 | ||
| 4763 | 13년 전 | 1161 | ||
| 4762 |
|
13년 전 | 717 | |
| 4761 | 13년 전 | 1608 | ||
| 4760 | 13년 전 | 843 | ||
| 4759 |
NTYPE
|
13년 전 | 5167 | |
| 4758 |
프로프리랜서
|
13년 전 | 823 | |
| 4757 |
프로프리랜서
|
13년 전 | 1211 | |
| 4756 | 13년 전 | 810 | ||
| 4755 |
원시인교주
|
13년 전 | 835 | |
| 4754 |
there007
|
13년 전 | 948 | |
| 4753 | 13년 전 | 1765 | ||
| 4752 |
세상의중심
|
13년 전 | 1574 | |
| 4751 | 13년 전 | 1298 | ||
| 4750 | 13년 전 | 1499 | ||
| 4749 |
또다른세상
|
13년 전 | 3652 | |
| 4748 | 13년 전 | 762 | ||
| 4747 |
cula100jak
|
13년 전 | 1647 | |
| 4746 | 13년 전 | 1474 | ||
| 4745 |
|
13년 전 | 613 | |
| 4744 |
designcity
|
13년 전 | 739 | |
| 4743 | 13년 전 | 616 | ||
| 4742 |
|
13년 전 | 8346 | |
| 4741 | 13년 전 | 833 | ||
| 4740 | 13년 전 | 1637 | ||
| 4739 | 13년 전 | 1311 | ||
| 4738 |
|
13년 전 | 741 | |
| 4737 |
Xerro
|
13년 전 | 483 | |
| 4736 | 13년 전 | 3720 | ||
| 4735 |
keith
|
13년 전 | 535 | |
| 4734 |
|
13년 전 | 689 | |
| 4733 | 13년 전 | 1744 | ||
| 4732 |
|
13년 전 | 1244 | |
| 4731 |
|
13년 전 | 1294 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기