Send feedback
Handling a PostgreSQL database failover
Edge for Private Cloud v4.19.01
Perform the following during a PostgreSQL database failover:
Stop apigee-postgresql
on the current master if it is still running:
/opt/apigee/apigee-service/bin/apigee-service apigee-postgresql stop
Go to standby node and invoke the following command to make it the master:
/opt/apigee/apigee-service/bin/apigee-service apigee-postgresql promote-standby-to-master IPorDNSofOldMaster
If old master is restored at some time in the future, make it a standby node:
On the current master, edit the config file to set:
PG_MASTER=IPorDNSofNewMaster
PG_STANDBY=IPorDNSofOldMaster
Note: Apigee strongly recommends that you use IP
addresses rather than host names for the PG_MASTER
and PG_STANDBY
properties in your silent configuration file. In addition, you should be consistent on both
nodes.
If you use host names rather than IP addresses, you must be sure sure that the host names
properly resolve using DNS.
Enable replication on the new master:
/opt/apigee/apigee-service/bin/apigee-service apigee-postgresql setup-replication-on-master -f configFIle
On the old master, edit the config file to set:
PG_MASTER=IPorDNSofNewMaster
PG_STANDBY=IPorDNSofOldMaster
Stop apigee-postgresql
on the old master:
/opt/apigee/apigee-service/bin/apigee-service apigee-postgresql stop
On the old master, clean out any old Postgres data:
rm -rf /opt/apigee/data/apigee-postgresql/
Note : If necessary, you can backup this data before
deleting it.
Configure the old master as a standby:
/opt/apigee/apigee-service/bin/apigee-service apigee-postgresql setup-replication-on-standby -f configFile
On completion of replication, verify the replication status by issuing the following
scripts on both servers. The system should display identical results on both servers to ensure
a successful replication:
On the master node, run:
/opt/apigee/apigee-service/bin/apigee-service apigee-postgresql postgres-check-master
Verify that it says it is the master.
On the standby node:
/opt/apigee/apigee-service/bin/apigee-service apigee-postgresql postgres-check-standby
Verify that it says it is the standby.
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-04-30 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
Need to tell us more?
{"lastModified": "Last updated 2024-04-30 UTC."}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-04-30 UTC."],[],[]]