I have three node cluster.
Now, I want to reduce the max_connections
field from 300
to 100
. I have changed the value in both master and replica in postgresql.conf
file. I have restarted my master first than the other replica nodes. everything seems ok in master but replicas are shutting down automatically.
Here is the error: hot standby is not possible because max_connections = 100 is a lower setting than on the master server (its value was 300)
I have found a solution where need to start as hot_standby=off
.
Is there any other solution rather than this?
So Basically what happened we can't start Replica with less max_connections
value than Primary when we have set hot_standby = on
.
Though i have updated The Primary server's max_connections
The information didn't arrive in Replica side. Normally, Primary server's config changes are notified with wal log changes. For this reason, after restarting the primary with lower max_connections
we need to wait for write operations and then change the Replica's max_connecions
.
But i think this one is not a feasible solution.
Better Solution:
hot_standby = off
(if the server stucked in starting state, after few second don't wait for start)hot_standby = on