引用
# cd /usr/local/src/csync2
tar zxvf libgpg-error-1.7.tar.gz
cd libgpg-error-1.7
./configure && make && make install
tar zxvf libgcrypt-1.4.4.tar.gz
cd libgcrypt-1.4.4
./configure --with-gpg-error-prefix=/usr/local
make && make install
tar zxvf libtasn1-2.1.tar.gz
cd libtasn1-2.1
./configure && make && make install
tar zxvf sqlite-2.8.17.tar.gz
cd sqlite-2.8.17
./configure && make && make install
tar zxvf librsync-0.9.7.tar.gz
cd librsync-0.9.7
./configure
make && make install
tar jxvf gnutls-2.6.6.tar.bz2
cd gnutls-2.6.6
./configure --with-libgcrypt-prefix=/usr/local/
make && make install
echo "/usr/local/lib" >> /etc/ld.so.conf
ldconfig
tar zxvf csync2-1.34.tar.gz
cd csync2-1.34
./configure
make && make install
make cert
echo "csync2 30865/tcp" >> /etc/services
# vi /etc/xinetd.d/csync2
引用
service csync2
{
disable = no
protocol = tcp
flags = REUSE
socket_type = stream
wait = no
user = root
group = root
server = /usr/local/sbin/csync2
server_args = -i
#only_from = 192.168.169.112 192.168.169.113 192.168.169.114
}
二、利用inotify实现数据的实时同步更新.
1、
安装inotify-tools
# cd /usr/local/src/csync2
# tar zxvf inotify-tools-3.13.tar.gz
# inotify-tools-3.13
# ./configure && make && make install
2、配置inotify触发同步脚本.
# cd /usr/local/sbin
# vi csync2_bbs.sh