[英]Create failover postgresql cluster if you have 2 virtmachine without load balancing server
Right now i read this https://wiki.clusterlabs.org/wiki/PgSQL_Replicated_Cluster 现在我读了这个https://wiki.clusterlabs.org/wiki/PgSQL_Replicated_Cluster
I have some questions about it: 我对此有一些疑问:
Sorry for my bad English 对不起,我的英语不好
Its almost 2 months you asked it but it seems you are in same boat as I was in few weeks back. 您询问了将近2个月,但似乎您和几周前的情况一样。 I have gone through your link and it explains that you need to use corosync + pacemaker + pcs. 我浏览了您的链接,它说明您需要使用corosync +起搏器+ pc。 Frankly, I have no experience on any of them but I used pgpool2 4.0.4 (latest at the time of writing) with PostgreSQL 9.5.14 and 10.7, successfully able to brought up 2 clusters in last 2 months. 坦率地说,我没有任何经验,但是我在PostgreSQL 9.5.14和10.7上使用了pgpool2 4.0.4(在撰写本文时为最新),在过去的两个月中成功地建立了两个集群。
With pgpool you do not need to use any other tool/library and all configuration goes to one file pgpool.conf along with few password (1 liners) in pool_password and pcp.conf. 使用pgpool,您不需要使用任何其他工具/库,并且所有配置都进入一个文件pgpool.conf,并且pool_password和pcp.conf中只有很少的密码(1个衬里)。 All the needed configuration of watchdog(component of pgpool cluster) to find out the live/dead status of cluster comes with pgpool and merely need configuration to handle it. pgpool附带了看门狗(pgpool集群的组件)所需的所有配置,以查找集群的运行/停止状态,只需要进行配置即可进行处理。
You may find more information on pgpool2 at here and about latest version at here . 您可以在此处找到有关pgpool2的更多信息,并在此处找到有关最新版本的信息 。 Also you may refer (just read first to get a gist of whole process) at link which is super useful and quite detailed on how the whole process goes. 您也可以在链接上参考(首先阅读以获取整个过程的要旨),它非常有用,并且非常详细地介绍了整个过程的过程。
Also let us know if you were able to setup cluster with mentioned technologies at your link. 另外,请让我们知道您是否能够在链接上使用上述技术设置集群。
Edit: you may find extracted configurations of pgpool.conf at my gist page I have kept only the settings which I changed. 编辑:在我的要点页面上 ,您可能会找到pgpool.conf的提取配置, 我仅保留了更改的设置。 Rest have been left as default , or may be i forgot to add 1-2 to this. 其余部分保留为默认设置,或者可能我忘记为此添加1-2。 Most of the comment on the file come right from standard documentation and self-explanatory but few places I have added my own comment and they are 关于文件的大多数评论都来自标准文档,并且不言自明,但是我仅在少数地方添加了自己的评论,它们是
Also most important things is , sit back and read through original links referring to std. 同样,最重要的事情是,坐下来阅读指向std的原始链接。 documentation to just a gist of what the whole thing/process is. 文档只是整个事物/过程的要旨。 It will be easier for you to modify it as per your needs later. 您以后可以根据需要轻松修改它。 I read it , 3-4 times ( slow learner ) both the documentation and then used a mix of both approaches. 我阅读了3-4次文档(学习缓慢),然后混合使用了两种方法。 Also there are 4 files, i created 我也创建了4个文件
You will find guidance on these at both the places : std. 您将在以下两个地方找到有关这些方面的指南:std。 documentation and other tutorial. 文档和其他教程。 they are plain sh file with a bunch of ssh and psql commands. 它们是普通的sh文件,带有一堆ssh和psql命令。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.