PostgreSQL 复制策略
现在,我们使用 PostgreSQL 8.3(在 Linux 上)作为 Ruby on Rails Web 应用程序的数据库后端。
考虑到在 PostgreSQL 数据库上我们积极使用行级阻塞和 PL/PGSQL,我们可以使用什么来保护我们的数据(我的意思是工具、包、脚本、策略)来成功复制数据库并构建多主组合?
我也会感谢主从建议。
例如,如果我放置几台运行Apache/Ruby的应用服务器以获得更高的性能,最后部署几台数据库服务器,有没有办法在PostgreSQL中构建多主复制?
现在我们使用PostgreSQL WAL机制将数据备份到文件系统。
多谢。
Right now we are using PostgreSQL 8.3 (on Linux) as a database backend to our Ruby on Rails web application.
Considering that on PostgreSQL database we actively use row level blocking and PL/PGSQL, what can we employ to secure our data -- I mean tools, packages, scripts, strategies -- to successfully replicate the database and build multi-master combination?
I will appreciate master-slave suggestions as well.
For example, if I put several application servers running Apache/Ruby to achieve higher performance and at the end deploy several database servers, is there any way to build multi-master replication in PostgreSQL?
Right now we use PostgreSQL WAL mechanism to backup data to file system.
Thanks a lot.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
有一些用于主从(和主多从)场景的工具,通常基于触发器。 Slony-I 已经提到过(稳定可靠,但操作起来有点困难)。 对 Slony 有问题的人-我写的
Londiste(由 Skype 团队提供)和 PyReplica。 呸,我刚刚发现
Mammoth 已开源
对于多主机,有 Bucardo (注意:它还没有那么精致)
或商业产品 - 例如 Continuent 或 CyberTec。
There are a few tools for master-slave (and master-multislave) scenarios, usually trigger-based. Slony-I has already been mentioned (is stable and solid, but a bit difficult to operate). People having problems with Slony-I wrote
Londiste (by Skype team) and PyReplica. Bah, and I just spotted
Mammoth has been open-sourced
For multimaster there is Bucardo (note: it is not that polished)
or commercial offerings - for example by Continuent or CyberTec.
如果您还没有,我建议您查看 High PostgreSQL 手册的可用性、负载平衡和复制章节。 它清晰地概述了可用的技术及其特性。
If you haven't already, I'd suggest a look at the High Availability, Load Balancing, and Replication chapter of the PostgreSQL manual. It gives a clear overview of the available techiques and their features.
嗯,与这里的其他人相比,Bucardo 确实很好而且稳定。 它是一个基于 Perl 的复制系统,并且支持主从以及多主复制,并具有有趣的冲突解决概念。
如果您需要简单的主从代表,我会推荐 Londiste,但对于多主需求,恕我直言,Bucardo 是唯一可接受的解决方案。
Hm, Bucardo is really good and stable, in comparison to the others here. It is as polished as can be a Perl-based replication system, and supports master-slave as well as multi-master replication, with interesting conflict resolution concepts.
If you need simple master-slave rep I'd recommend Londiste, but for the multi-master needs, Bucardo is the only acceptable solution IMHO.
我虽然 Postgres-R 看起来很有希望,但是,它仍在开发中。
据说它已经稳定下来,并且有可能与标准问题整合,但它尚未实现。
I though Postgres-R looked promising, however, its still in development.
It was supposedly stabilised and purported to be a potential for integration with the standard issue, but its yet to come to fruition.
迟到的答案,但有一个新的开源软件用于 PostgreSQL 的异步主主复制(也适用于 MySQL):
rubyrep
重点是轻松设置。
披露:我写的。
Late answer but there is a new open source software for asynchronous master-master replication of PostgreSQL (also works for MySQL):
rubyrep
Focus is on easy setup.
Disclosure: I wrote it.
你可以看看slony。
You can have a look at slony.
PGCluster 看起来很有前途——我们在有限的情况下使用它,没有太多问题。
http://pgfoundry.org/projects/pgcluster/
PGCluster looks promising - we use it in limited situations without much problems.
http://pgfoundry.org/projects/pgcluster/