Environment:

ocaml
unison
inotify
two servers base on CentOS 7
Server A: 192.168.37.140
Server B: 192.168.37.138

1.Setup SSH Without password

Follow the link.

2.Install ocaml+unison+inotify

Install those on two servers.

Server A:
Install ocaml:

Install unison:

Install inotify:

Server B follow the same.

3.Solution of cannot open shared object file

Error:
inotifywait: error while loading shared libraries: libinotifytools.so.0: cannot open shared object file: No such file or directory

Solution:

4.Synchronize script

Specify the script name and directory, IP, source and destination directory, ssh port, inotify log of yours.

Server A:
A->B

Server B:
B->A:

5.Three servers plan

A->B
A->C
B->A
C->A
But it can’t control easily and get a weak point, it can’t start on boot. So, I use NFS to replace above plan.

发表评论

电子邮件地址不会被公开。 必填项已用*标注