Score:0

How to switch standby to master on postgresql 13?

je flag

For High Availability on DB was build Active-Standby(replica) cluster on Postgresql-13. Inserting data correctly transfer to 'replica' server, it is ok. Now, I want check case, how i can make change roles on two servers. for this I the /var/lib/postgresql/13/main/standby.signal was delete, also for apply changes restarted postgrsql.service Something tells me what I'm doing wrong. So,

  1. how to make a master out of a replica,
  2. how then from the old master (which was temporarily not available) to make the master back, without losing data?

Sorry for my English.

cn flag
In a HA, you should be able to turn off a switch port on the primary, initiate your failover process, and do the reverse to fail back. https://www.postgresql.org/docs/current/app-pgrewind.html "A typical scenario is to bring an old primary server back online after failover as a standby that follows the new primary."
Red Hat avatar
je flag
thx sir, data was success transfer to old-master, but i have one issue, how now to make a replica-srv a replica? (I made changes on the master, but this data did not go to the replica)
Red Hat avatar
je flag
now I created a slot on the master, and again reconnected the replica, and it works. I don’t know if I’m configure true(according to the documentation), but now the changes in the master appear in the replica
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.