To set up the database replication:
- If you'll need to migrate data from an existing database, make copies of the following files:
postgresql.conf
pg_hba.conf
- Prepare RHEL/CentOS hosts for the two databases. If PostgreSQL 8.x is included, remove it (as PostgreSQL 8.x does not support asynchronous log shipping).
- On both database hosts, download and un-tar (unzip) this database installation script (attached at the bottom).
- On the active database host, from within the installation script's directory, run:
postgres_ha-0.3.sh master <standby> <postgres password> <intigua password>
where
<standby>
is the IP address or resolvable name of the standby database host;<postgres password>
is a new password for the database system user; and<intigua password>
is a new password for the JetPatch Agent Manager database. - With the active database already installed, run:
postgres_ha-0.3.sh slave <master> <master postgres password>
where
<master>
is the IP address or resolvable name of the active database host; and<postgres password>
is the password you set for the active database system user.Running the script on the standby database host before the active database host will result in a failed installation.
- Configure a passwordless SSH connection for the postgres user from the active database to the standby database.
- To confirm that database replication is successful, compare the following file on the two database hosts:
/var/lib/pgsql/9.3/data/pg_log/
- If you need to migrate data from an existing database, append the contents of the files you copied in Step 1 to the newly-created ones in both databases.
Comments
0 comments
Please sign in to leave a comment.