ben*_*phy 2 postgresql replication
所以我有一个像 Master -> Slave1 -> Slave2 这样的设置。Slave1 从 Master 复制,Slave2 从 Slave1 复制。如果我将 Slave1 提升为 master,Slave2 是否可以继续从 Slave1 进行复制。这是我将 Slave1 提升为 master 后在 Slave2 上看到的日志:
2014-06-13 04:28:11 UTC LOG: replication terminated by primary server
2014-06-13 04:28:11 UTC DETAIL: End of WAL reached on timeline 3 at 3E/62B2C758.
2014-06-13 04:28:11 UTC LOG: fetching timeline history file for timeline 4 from primary server
2014-06-13 04:28:11 UTC LOG: invalid record length at 3E/62B2C758
2014-06-13 04:28:11 UTC LOG: restarted WAL streaming at 3E/62000000 on timeline 3
2014-06-13 04:28:11 UTC LOG: replication terminated by primary server
2014-06-13 04:28:11 UTC DETAIL: End of WAL reached on timeline 3 at 3E/62B2C758.
2014-06-13 04:28:16 UTC LOG: restarted WAL streaming at 3E/62000000 on timeline 3
2014-06-13 04:28:16 UTC LOG: replication terminated by primary server
Run Code Online (Sandbox Code Playgroud)
您应该能够recovery_target_timeline='latest'
在您的recovery.conf
,如恢复目标设置文档中所述
如果您使用的是 PostgreSQL 9.1 或 9.2 并使用流式复制,则还需要设置 WAL 存档,如果您希望在故障转移后自动继续,或者如@amacvar 所述,复制必要的 WAL 段以便副本可以继续沿较新的时间线流式传输。
在 9.3 及更高版本中,这不需要额外的 WAL 存档即可发生,因为时间线开关现在包含在复制流中。Michael Paquier 在他的博客文章中详细介绍了这种行为,没有档案的从节点时间线切换
归档时间: |
|
查看次数: |
2683 次 |
最近记录: |