2.1、安装编译工具:Objective Caml compiler
[root@Server1 soft]# cd ocaml-3.10.2+rc1/
[root@Server1 ocaml-3.10.2+rc1]# ./configure
[root@Server1 ocaml-3.10.2+rc1]# make world opt
[root@Server1 ocaml-3.10.2+rc1]# make install && echo OK
2.2、安装Unison:
[root@Server1 unison-2.13.16]# cd ../unison-2.13.16
[root@Server1 unison-2.13.16]# make UISTYLE=text THREADS=true
此时会产生一个错误:
/bin/sh: etags: command not found
make[1]: [tags] Error 127 (ignored)
make[1]: Leaving directory `/soft/unison-2.13.16' 解决方法:
yum -y install ctags-etags
重新编译:
[root@Server1 unison-2.13.16]# make UISTYLE=text THREADS=true
[root@Server1 unison-2.13.16]# make install && echo OK
此时如果报错:
mv /root/bin//unison /tmp/unison-10301
mv: cannot stat `/root/bin//unison': No such file or directory
make: [doinstall] Error 1 (ignored)
cp unison /root/bin/
cp: cannot create regular file `/root/bin/': Is a directory
make: *** [doinstall] Error 1 解决方法: [root@Server2 unison-2.13.16]# mkdir /root/bin [root@Server2 unison-2.13.16]# cp unison /root/bin/
重新编译:
[root@Server1 unison-2.13.16]# make install && echo OK
2.6、测试同步
[root@Server1 ~]# unison -servercmd
[root@Server1 data]# unison -servercmd=/root/bin/unison
Contacting server...
Looking for changes
Waiting for changes from server
Reconciling changes local Server2
new file ----> bb.txt
local : new file modified on 2015-08-19 at 14:42:45 size 5 rw-r--r-- user=0 group=0
Server2 : absent
Propagating updates
UNISON started propagating changes at 14:43:10 on 19 Aug 2015
[BGN] Copying bb.txt
from /data
to //Server2//data
[END] Copying bb.txt
UNISON finished propagating changes at 14:43:10 on 19 Aug 2015