简体   繁体   English

在PostgreSQL中同步/复制两个以上的数据库?

[英]Sync/ replicate more than two databases in postgresql?

I have 5 users which uses 5 different servers(using openerp), each one uses the same database copy. 我有5个用户使用5个不同的服务器(使用openerp),每个用户使用相同的数据库副本。 Whenever the user enters data to his database, then it should sync to the 6th server's database an then sync the data in the 6th database to all other 4 users databases. 每当用户将数据输入到他的数据库时,它都应该同步到第6个服务器的数据库,然后将第6个数据库中的数据同步到所有其他4个用户数据库。 So any data entry in any database should sync to the other databases running in different servers. 因此,任何数据库中的任何数据条目都应与运行在不同服务器上的其他数据库同步。 Is that possible? 那可能吗? how can I achieve it? 我该如何实现?

Edit: I found Bucardo, but it need primary key for every table. 编辑:我找到了Bucardo,但它需要每个表的主键。 But in openerp, there are many2many relation tables which doesn't have a primary key. 但是在openerp中,有很多很多没有主键的关系表。

This is called master-master or multi-master replication: 这称为主-主或多主复制:

http://en.wikipedia.org/wiki/Multi-master_replication#PostgreSQL http://en.wikipedia.org/wiki/Multi-master_replication#PostgreSQL

http://wiki.postgresql.org/wiki/Replication,_Clustering,_and_Connection_Pooling http://wiki.postgresql.org/wiki/Replication,_Clustering,_and_Connection_Pooling

You can also check out SymmetricDS or Daffodil which let you sync over HTTP. 您还可以检出SymmetricDS或Daffodil,它们使您可以通过HTTP进行同步。

A pure PostgreSQL installation supports currently only single master replication. 纯PostgreSQL安装目前仅支持单个主复​​制。 However you may achieve multi-master replication by installing additional tools http://wiki.postgresql.org/wiki/Clustering . 但是,您可以通过安装其他工具http://wiki.postgresql.org/wiki/Clustering来实现多主机复制。

You should also check out Pg documentation on this topic Chapter 25. High Availability, Load Balancing, and Replication 您还应该查看有关该主题的Pg文档第25章。高可用性,负载平衡和复制

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM