简体   繁体   English

CentOS上的PostgreSQL 9.6 Master,Ubuntu上的副本?

[英]PostgreSQL 9.6 Master on CentOS, Replica On Ubuntu?

I know it isn't ideal, but I'm wondering if there are any limitations preventing me from having a downstream replica be on Ubuntu (xenial), while its upstream replica is on CentOS? 我知道它不是理想的,但是我想知道是否有任何限制阻止我在Ubuntu(xenial)上安装下游副本,而在CentOS上安装下游副本?

I've got postgresql installed on the Ubuntu box and plan to set the $PGDATA dir and all of those settings the same as the CentOS boxes. 我在Ubuntu机器上安装了postgresql,并计划设置$ PGDATA目录,所有这些设置都与CentOS机器相同。

I'm just curious of anyone has tried this and run into any snags. 我只是好奇有人尝试过这种方法,遇到任何障碍。

In principle that would work as long as both Linuxen are running on the same architecture. 原则上,只要两个Linuxen都在同一体系结构上运行,它就可以工作。 But read this mailing list post for an example of what can go wrong: 但是,请阅读此邮件列表中的示例,以了解可能出现的问题:

PostgreSQL uses the operating system's collations for ordering indexes, and if the two versions of glibc installed on both machines have a different idea of how to order strings, the indexes on string columns will be corrupted on the standby. PostgreSQL使用操作系统的排序规则对索引进行排序,并且如果两台计算机上安装的glibc的两个版本对如何对字符串进行排序的想法不同,则字符串列上的索引将在备用数据库上损坏。

So if you need to replicate across distributions, make sure that one of the following applies: 因此,如果需要跨发行版进行复制,请确保以下条件之一适用:

  • You are using the C collation. 您正在使用C归类。

  • All indexes on string columns in your database are using the text_pattern_ops operator class. 数据库中字符串列上的所有索引都使用text_pattern_ops运算符类。

  • You have the same version of glibc on both machines. 两台计算机上都具有相同版本的glibc。

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

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