系统:centos5.1 结构: 三台服务器引用# vi /etc/hosts192.168.4.188csync1192.168.4.190csync2192.168.4.191csync3
1、创建下载文件列表引用cd /usr/local/src/ vi list //以下内容: ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-1.7.tar.gz ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.4.4.tar.gz ftp://ftp.gnutls.org/pub/gnutls/libtasn1/libtasn1-2.1.tar.gz http://www.sqlite.org/sqlite-2.8.17.tar.gz http://internode.dl.sourceforge.net/sourceforge/librsync/librsync-0.9.7.tar.gz ftp://ftp.gnu.org/pub/gnu/gnutls/gnutls-2.6.6.tar.bz2 http://oss.linbit.com/csync2/csync2-1.34.tar.gz http://jaist.dl.sourceforge.net/sourceforge/inotify-tools/inotify-tools-3.13.tar.gz 2、创建安装脚本并执行引用vi install.sh //以下内容: wget –i list cd /usr/local/src/ tar zxvf libgpg-error-1.7.tar.gz cd libgpg-error-1.7 ./configure && make && make install cd .. tar zxvf libgcrypt-1.4.4.tar.gz cd libgcrypt-1.4.4 ./configure --with-gpg-error-prefix=/usr/local && make && make install cd .. tar zxvf libtasn1-2.1.tar.gz cd libtasn1-2.1 ./configure && make && make install cd .. tar zxvf sqlite-2.8.17.tar.gz cd sqlite-2.8.17 ./configure && make && make install cd .. tar zxvf librsync-0.9.7.tar.gz cd librsync-0.9.7 ./configure && make && make install cd .. tar jxvf gnutls-2.6.6.tar.bz2 cd gnutls-2.6.6 ./configure --with-libgcrypt-prefix=/usr/local/ && make && make install cd .. echo "/usr/local/lib" >> /etc/ld.so.confldconfig tar zxvf csync2-1.34.tar.gz cd csync2-1.34 ./configure && make && make install && make cert cd .. tar zxvf inotify-tools-3.13.tar.gz cd inotify-tools-3.13 ./configure && make && make install cd .. echo "csync2 30865/tcp" >> /etc/services echo "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.10.50 192.168.10.51 }" > /etc/xinetd.d/csync2 chkconfig xinetd on 3、赋予脚本可执行权限并执行:引用(注:需要在每个节点执行脚本)chmod 755 install.sh ./install.sh4、编辑hosts文件如下内容:引用vi /etc/hosts 192.168.4.188csync1192.168.4.190csync2192.168.4.191csync3(三台主机都要修改)