Postgres流式复制中主要滞后于恢复 [英] primary lagging behind recovery in postgres streaming replication

查看:710
本文介绍了Postgres流式复制中主要滞后于恢复的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在postgresql-9.5的3个节点之间进行流复制。
1个主服务器和2个从属服务器
我正在尝试配置自动故障转移
,但是当我切换回原始主服务器并重新启动postgres服务时,出现以下错误:-

I was doing a streaming replication between 3 nodes of postgresql-9.5 . 1 master and 2 slaves I was trying to configure auto failover but when i switched back to my original master, and restarted the postgres service, I am getting the following error:-

主要数据库的最高时间轴1落后于恢复时间轴11

有人可以帮忙吗。预先感谢

Can somebody please help. Thanx in advance

推荐答案

我不确定当我切换回原始主人时的确切含义,但是看来您在PostgreSQL流复制中做的是最错误的事情-引入了第二个主复制。

I'm not sure what you exactly mean by "when i switched back to my original master", but it looks that you are doing the wrongest possible thing in PostgreSQL streaming replication - introducing the second master.

关于PostgreSQL复制您应该知道的最重要的事情是一旦故障转移执行后,您不能简单地切换回原始母版-集群中现在有一个新的母版,并且存在两个母版会造成损害。

The most important thing you should know about PostgreSQL replication is that once the failover is performed, you cannot simply "switch back to original master" - there's now a new master in cluster, and existence of two masters will make damage.

将奴隶提升为主人之后,重新加入旧主人的唯一方法是:

After a slave is promoted to master, the only way for you to re-join the old master is to:


  1. 销毁它(删除数据目录);

  2. 作为奴隶加入。

如果您希望它再次成为高手,则将继续执行以下操作:

If you want it to be master again you'll continue with the following:


  1. 让它运行暂时作为从站,以便它可以同步数据;

  2. 杀死临时主站并故障转移到旧的主站;

  3. 再次作为临时从站重新加入临时主站

您不能简单地切换主服务器!只能通过故障转移(提升从属)来创建主节点。

您还应该知道,无论何时执行故障转移(无论何时更换主节点),所有奴隶(除了被提升的奴隶之外)需要重新配置以针对新的主人。

You should also know that whenever you are performing failover (whenever the master is changed), all slaves (except for the one that is promoted) need to be reconfigured to target the new master.

我建议您阅读本教程-会帮上忙。

I suggest you reading this tutorial - it'll help.

这篇关于Postgres流式复制中主要滞后于恢复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆