diff --git a/doc/postgresql_replication.md b/doc/postgresql_replication.md new file mode 100644 index 0000000..1abb906 --- /dev/null +++ b/doc/postgresql_replication.md @@ -0,0 +1,14 @@ +# Switch PostgreSQL primary + +Change the role in `./nodes/#{new_primary}.json`'s run list: + + - "role[postgresql_replica]", + + "role[postgresql_primary]", + +Delete the `role[postgresql_replica]` role from the old primary's run list. + +Run Chef on the new primary, then create the failover file to turn the server into the new primary: + + $ sudo touch /mnt/data/postgresql/failover.trigger + +Run Chef on servers that use PostgreSQL to change the IP of the primary server. \ No newline at end of file