For this recipe, we will use the same two PostgreSQL nodes: pg1 and pg2. We will also continue to assume that our PostgreSQL data is located at /db/pgdata.
On Red-Hat-based systems, follow these steps on both servers as a root-capable user:
- Prevent the PostgreSQL service from starting automatically with this command:
sudo chkconfig postgresql off
- Do the same for the DRBD service with this command:
sudo chkconfig drbd off
- Create a file named /etc/sysconfig/postgresql with the following line:
PGDATA=/db/pgdata
On Debian-based systems, follow these steps on both servers as a root-capable user:
- Prevent the PostgreSQL service from starting automatically with this command:
sudo update-rc.d postgresql disable
- Do ...