> [!CAUTION]
> **Caution:** This documentation covers Edge for Private Cloud 4.17.09, which is no longer supported. Google does not provide security patches, bug fixes, or technical support for this version. The current supported version is 4.54.00. See the [Edge for Private Cloud documentation](https://docs.apigee.com/private-cloud/latest/overview) for the current version, or [All versions](https://docs.apigee.com/private-cloud/versions) to compare releases.

*Edge for Private Cloud v. 4.17.09*

By default, Edge installs all Postgres nodes in master mode. However, in production systems
with multiple Postgres nodes, you configure them to use master-standby replication so that if the
master node fails, the standby node can continue to server traffic.

If the master node ever fails, you can promote the standby server to the master. See [Handling a PostgreSQL Database Failover](https://docs.apigee.com/private-cloud/v4.17.09/handling-postgressql-database-failover) for
more information.

> [!NOTE]
> **Note:** Master-Standby replication is not supported for the Developer Services portal. The portal only supports a single Postgres node.

## Configure Master-Standby Replication at
install time

You can configure master-standby replication at install time by including the following
properties in the config file for the two Postgres nodes:

```postgresql
PG_MASTER=IPorDNSofNewMaster
PG_STANDBY=IPorDNSofNewStandby
```

The installer automatically configures the two Postgres node to function as master-standby
with replication.

## Configure Master-Standby Replication
after installation

You can configure master-standby replication after installation by by using the following
procedure:

1. Identify which Postgres node will be the master and which will be the standby server.
2. On the master node, edit the config file to set:  
   PG_MASTER=***IPorDNSofNewMaster***   
   PG_STANDBY=***IPorDNSofNewStandby***
3. Enable replication on the new master:  
   \> /opt/apigee/apigee-service/bin/apigee-service apigee-postgresql setup-replication-on-master -f ***configFIle***
4. On the standby node, edit the config file to set:  
   PG_MASTER=***IPorDNSofNewMaster***   
   PG_STANDBY=***IPorDNSofNewStandby***
5. Stop the standby node: \> /opt/apigee/apigee-service/bin/apigee-service apigee-postgresql stop
6. On the standby node, delete any existing Postgres data:  
   \> rm -rf /opt/apigee/data/apigee-postgresql/  
   **Note**: If necessary, you can backup this data before deleting it.
7. Configure the standby node:  
   \> /opt/apigee/apigee-service/bin/apigee-service apigee-postgresql setup-replication-on-standby -f ***configFile***

## Test Master-Standby Replication

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:

1. On the master node, run:  
   \> /opt/apigee/apigee-service/bin/apigee-service apigee-postgresql postgres-check-master  
   Validate that it says it is the master.
2. On the standby node:  
   \> /opt/apigee/apigee-service/bin/apigee-service apigee-postgresql postgres-check-standby  
   Validate that it says it is the standby.