我正在使用Bucardo在数据库中复制数据。我有一个名为mydb的数据库和一个名为mydb2的数据库。它们都包含相同的表,在两种情况下都称为“数据”。按照this website上的步骤,我已经安装了Bucardo并添加了两个数据库:
bucardo_ctl add database mydb
bucardo_ctl add database mydb2并添加了以下表格:
bucardo_ctl add all tables现在,当我尝试使用以下命令添加同步时:
bucardo_ctl add sync testfc source=mydb targetdb=mydb2 type=pushdelta tables=data我得到以下错误:
DBD::Pg::st execute failed: ERROR: error :error usr function "herdcheck":在/usr/bin/bucardo_ctl第3346行,同一群(1)中不能有来自不同数据库的山羊。
有人有什么建议吗?任何人都将不胜感激。
发布于 2013-02-13 23:47:50
因此,在source选项中,您应该输入羊群的名称(据我所知,这是表的列表。然后,而不是:
bucardo_ctl add all tables使用
bucardo_ctl add all tables --herd=foobar而不是使用
bucardo_ctl add sync testfc source=mydb targetdb=mydb2 type=pushdelta tables=data
使用
bucardo_ctl add sync testfc source=foobar targetdb=mydb2 type=pushdelta tables=data问题是,source选项不是放置源数据库的位置,而是“羊群”或表的位置。
请记住,PK增量是针对具有主键的表,而完整副本是针对有没有PK的表。
希望这能有所帮助。
https://stackoverflow.com/questions/11785696
复制相似问题