【问题标题】:Bucardo add sync to replicate dataBucardo 添加同步以复制数据
【发布时间】:2012-08-02 21:00:22
【问题描述】:

我正在使用 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 执行失败:错误:来自 Perl 函数“herdcheck”的错误:在第 17 行的同一群 (1) 中不能有来自不同数据库的山羊。在 /usr/bin/bucardo_ctl 第 3346 行。

有人有什么建议吗?任何将不胜感激。

【问题讨论】:

    标签: database postgresql perl database-replication bucardo


    【解决方案1】:

    因此,在源选项中,您应该输入牛群的名称(据我所知,它是表格列表。 然后,而不是:

    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
    

    问题是源选项不是你放置源数据库的地方,而是“群”或表。

    请记住,pushdelta 适用于具有主键的表,而完整副本适用于与是否有 PK 无关的表。

    希望对您有所帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-01-19
      • 2016-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多