简体   繁体   English

如果您有2个没有负载平衡服务器的virtmachine,则创建故障转移Postgresql集群

[英]Create failover postgresql cluster if you have 2 virtmachine without load balancing server

  1. Whats recommendation can you give me on setting up a database failover postgresql cluster? 您对建立数据库故障转移postgresql集群有什么建议? I have only 2 virtual machine. 我只有2个虚拟机。

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: 我对此有一些疑问:

  1. Where is it written in the configuration files when the second machine should turn on as an active one? 当第二台计算机作为活动计算机打开时,它在配置文件中的什么位置?
  2. How does the first car understand that the second car is active? 第一辆车如何理解第二辆车处于活动状态?
  3. Why does not the virtual IP address conflict? 为什么虚拟IP地址不冲突?
  4. When the main machine turns on, how will the system understand what needs to be done replication from the second server? 当主机打开时,系统如何理解需要从第二台服务器进行复制的内容?

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 关于文件的大多数评论都来自标准文档,并且不言自明,但是我仅在少数地方添加了自己的评论,它们是

  1. vip configuration. VIP配置。
  2. At one place I am using a different postgres password. 在一个地方,我使用了不同的postgres密码。
  3. note about recovery_1st_stage 关于recovery_1st_stage的说明
  4. note about key file referred by logdir 关于logdir引用的密钥文件的说明

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个文件

  1. recovery_1st_stage recovery_1st_stage
  2. pgpool_remote_start.sh pgpool_remote_start.sh
  3. failover.sh failover.sh
  4. promote_standby.sh promote_standby.sh

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.

相关问题 使用ldirectord平衡GIT服务器的负载 - using ldirectord for load balancing GIT servers PgPool Java / JDBC应用程序的负载平衡 - PgPool Load balancing for Java/JDBC application phpmyadmin-禁止-您无权访问此服务器上的/ phpmyadmin / - phpmyadmin - Forbidden - You don't have permission to access /phpmyadmin/ on this server 禁止:您无权访问 / 在此服务器上 (centos 7) - Forbidden: You don't have permission to access / on this server (centos 7) Laravel Forbidden 您无权访问此服务器上的 /storage/ - Laravel Forbidden You don't have permission to access /storage/ on this server 在Apache服务器上是否可以使用带有反向代理的负载均衡器? - is it possible to have load balancer with reverse proxy on apache server? Percona XtraDB Cluster:服务器退出而不更新PID文件...服务器启动失败 - Percona XtraDB Cluster : Server quit without updating PID file ... server startup failed 禁止您无权访问此服务器上的/ phpmyadmin - Forbidden You don't have permission to access /phpmyadmin on this server 您无权在CentOS7 VPS服务器上的此服务器上访问/ phpMyAdmin - You don't have permission to access /phpMyAdmin on this server in CentOS7 VPS server centos 6.4上的Apache全新安装说您无权访问此服务器上的/ - Apache fresh installation on centos 6.4 says You don't have permission to access / on this server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM