SymmetricDS和“注册

时间:2011-11-14 08:00:58

标签: database replication symmetricds

我正在尝试使用SymmetricDS v 2.4配置复制的备份数据库。

我使用2个文件:master.properties for main database

db.driver=org.postgresql.Driver
db.url=jdbc:postgresql://localhost/oscaddb
db.user=oscaddb
db.password=oscaddb
registration.url=http://localhost:31415/sync
sync.url=http://localhost:31415/sync
group.id=master
external.id=10000
job.purge.period.time.ms=7200000
auto.registration=true
auto.reload=true
http.basic.auth.username=sds_user
http.basic.auth.password=sds_pass-2131njwuifn4uhsd
sync.table.prefix=sym

和备份数据库的slave.proerties

db.driver=org.postgresql.Driver
db.url=jdbc:postgresql://localhost/oscad-redundancja
db.user=oscaddb
db.password=oscaddb
registration.url=http://172.20.50.5:31415/sync
sync.url=http://localhost:31415/sync
group.id=slave
external.id=1
job.routing.period.time.ms=2000
job.push.period.time.ms=5000
job.pull.period.time.ms=5000
auto.registration=true
auto.reload=true
#http.basic.auth.username=sds_user
#http.basic.auth.password=sds_pass-2131njwuifn4uhsd
sync.table.prefix=sym

我在“用户指南”中做了其他所有操作,但是当我运行主服务器然后是从服务器时,我会在从服务器上获得“在此节点有initil load之前不允许注册”错误。

我做错了什么?

1 个答案:

答案 0 :(得分:6)

如果主/从运行在不同的计算机上,则registration.url和sync.url都必须包含外部IP地址,例如在你的情况下:

master.properties

..
registration.url=http://<external_**master**_ip_address>:31415/sync
sync.url=http://<external_**master**_ip_address>:31415/sync

slave.properties

..
registration.url=http://<external_**master**_ip_address>:31415/sync
sync.url=http://<external_**slave**_ip_address>:31415/sync

您还需要在两个主/从数据库中相应地修改* sym_node *表。

希望这有帮助。