DAP - ' FATAL: number of requested standby connections exceeds max_wal_senders' when configuring follower/standby
Symptom
DAP standby or follower node fails to configure. The following appears in the log:
Environment
11.1;11;11.2;11.3;11.4;11.5;11.6;11.7;12.0
DAP version 11 and higher
Cause
This error indicates that Postgres does not have enough available connections for replication to occur. That means the Standby/Follower node fails to configure successfully.
There are two possible causes:
-
Prior to
v11.4, there was a bug in the Seed Service endpoint that did not close database connections. This would cause the connection pool to become exhausted. -
By default, DAP is configured for
16total of standbys and followers. If another standby or master is connected beyond 16, the user will see the above error.
Resolution
a. Upgrade to a DAP version >= 11.4
b. Master and Standby nodes will need to be updated to support more than 16 standbys and/or followers.
In order to upgrade to 11.4 or any latest version due to above stated issue kindly perform below steps
1. Create a json file to load in configuration
ii. vi conjur.json
Add in the desired values (think expansion and design considerations of environment):
"postgresql": {
"config": {
"max_connections": 155,
"max_wal_senders": 55
}
}
}
2. Initiate Backup/Restore process before removing the existing containers
The steps to perform the backup can be found on the online documentation link as given below –
https://docs.cyberark.com/Product-Doc/OnlineHelp/AAM-DAP/Latest/en/Content/Deployment/HighAvailability/backup-restore.htm
3. Rebuild the DAP Environment
i. Rebuild container
ii. Along with loading the Backup into new container, load conjur.json as below
-
docker cp conjur.json dap:/opt/conjur/backup
iii. Unpack and Restore the backup and start the replication
iv. Validate the value matches your conjur.json
-
Docker exec -it <container_name> bash
-
cat /etc/postgresql/9.4/main/postgresql.conf | grep -i “max_wal_senders”
4. Once verified, proceed with rest of the steps of building DAP cluster - Reseed standby members