Friday , April 26 2024

Creating A Hot Standby In EDB PostgreSQL

In today’s article, I will tell you Creating A Hot Standby In EDB PostgreSQL.

EDB PostgreSQL Installation link:

We need two servers with EDB Postgresql installed to create Stanby. If you have not installed, you can install from the link above.

There are operations that need to be done on both the master and standby server.

We will start with the operations that need to be done on the master server.

Actions to be taken on the Master Server:

1. We check if the master database is in archive mode.

2. Since the database is not in archive mode, we put the database in archive mode.

We ensure that our archives are sent to the standby database with the archive_command parameter.

With vi, we change the contents of the postgresql.conf file as follows.

3. Since we will create stanby later, we also set the following parameters in the postgresql.conf file.

4. We must restart the postgresql service for the changes we made in the postgresql.conf file to take effect.

5. We create the Replication user.

6. To access the database from outside, we must set the listen address as below and the following changes should be made in pg_hba.conf.

7. Add the following line to the pga_hba.conf file. (The IP of the standby server is set.)

8. After the change is made, the service is restarted.

Actions to be taken on Standby Server:

1. We stop the service.

2. We back up the data directory.

3. We connect to the master server, take a backup and restore it.

4. We create the standby.signal file.

5. We start the service.

When we complete the above steps, we will have the standby database. If you want to test it, you can query a table on the master server on the standby server, or you can check the standby with the query below.

I hope it will be a useful document for you.

 

Loading

About Melek Durdu

Leave a Reply

Your email address will not be published. Required fields are marked *

Categories