我正在使用 Unison 在多个服务器之间同步文件。我运行的确切命令是:
/bin/unison-text-2.40 /etc/asterisk/dynamic_configs ssh://filesync/opt/dynamic_configs -batch -confirmbigdel=false -force newer -times
我这样设置,这样任何服务器都可以更改文件,然后让“集群中”的所有其他服务器获得更新。因此,如果 ServerA 删除了一个文件,那么该文件也会在 ServerB、ServerC 等上被删除。我在每个框上都有一个 cron 作业,每分钟运行此脚本来同步它们的配置。我有 10 台服务器,其中 5 台抛出了以下错误
Looking for changes
Fatal error: Internal error: On-disk archives are not identical.
This can happen when both machines have the same hostname.
If this is not the case and you get this message repeatedly, please:
a) Send a bug report to [email protected] (you may need
to join the group before you will be allowed to post).
b) Move the archive files on each machine to some other directory
(in case they may be useful for debugging).
The archive files on this machine are in the directory
/home/user/.unison
and have names of the form
arXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
where the X's are a hexidecimal number .
c) Run unison again to synchronize from scratch.
解决此问题的正确方法是什么?我正在同步几个目录,所以我不想删除 ~/.unison 中的所有内容。但我知道 ~/.unison 中的哪个文件负责此目录
[root@mp1-nyc1 .unison]# ll
total 252
-rw------- 1 user user 8530 Feb 15 10:02 ar2223c1cdad791fd3b63d47747cef6bb6
-rw------- 1 user user 75701 Feb 17 12:40 ar347b0a3f8cb288e9f59e66e952f4ce38
-rw------- 1 user user 4595 Feb 17 04:59 ara01ec9241285b8afccd32b051233ba2d
-rw------- 1 user user 138468 Feb 16 21:45 ard15c71a6505af1748d399a34104be1fd
-rw------- 1 user user 26 Feb 11 22:32 default.prf
-rw------- 1 user user 34 Feb 15 10:03 fp2223c1cdad791fd3b63d47747cef6bb6
-rw------- 1 user user 34 Feb 17 15:20 fp347b0a3f8cb288e9f59e66e952f4ce38
-rw------- 1 user user 34 Feb 17 15:20 fpa01ec9241285b8afccd32b051233ba2d
-rw------- 1 tuser user 34 Feb 17 15:20 fpd15c71a6505af1748d399a34104be1fd
[root@mp1-nyc1 .unison]# grep dynamic_configs *
Binary file ar2223c1cdad791fd3b63d47747cef6bb6 matches
[root@mp1-nyc1 .unison]#
过去我只是删除了服务器和 unison 服务器上该目录的二进制文件,似乎可以正常工作,但是过去曾出现过文件“丢失”的问题。有没有办法告诉 unison 忽略我拥有的内容,只从主服务器获取所有最新内容?