Primary Server

On your Primary server, perform the following actions:

  1. Install both the “postgresql-server” and “postgresql” rpm packages if they do not exist on your system. Apply any required dependencies as well

 # yum install postgresql postgresql-server

  1. Verify that your Shared iSCSI LUN is still mounted at /var/lib/pgsql via the “df” command
  1. If this is a fresh PostgreSQL install, initialize a sample PostgreSQL database:

# su – postgres

 # initdb —pgdata=/var/lib/pgsql/data

  1. Ensure that all files in your PostgreSQL data directory (/var/lib/pgsql) have correct permissions and ownership

 # chown –R postgres:postgres /var/lib/pgsql

 # chmod 755 /var/lib/pgsql

  1. Finally, manually start the PostgreSQL daemon from the command line. Note: Do Not start it via the “service” command, or the /etc/init.d/ scripts

 # su – postgres

 # pg_ctl start -D /var/lib/pgsql/data -l /var/lib/pgsql/pgstartup.log -o “-p 5432” -w

  1. Verify PostgreSQL is running by connecting with the psql client (ensure you are still running as the “postgres” linux user):

-bash-3.2$ psql

Welcome to psql 8.1.22, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms

\h for help with SQL commands

\? for help with psql commands

\g or terminate with semicolon to execute query

\q to quit

postgres=# \q

-bash-3.2$

Secondary Server

On your Secondary Server:

  1. install both the “postgresql” and “postgresql-server” rpm packages if they do not exist on your system. Apply any required dependencies as well

 # yum install postgresql postgresql-server

  1. Ensure that the PostgreSQL data directory (/var/lib/pgsql) has correct permissions and ownership

 # chown –R postgres:postgres /var/lib/pgsql

 # chmod 755 /var/lib/pgsql

  1. There is no need to perform any of the additional steps taken on the Primary Server

Feedback

Thanks for your feedback.

Post your comment on this topic.

Post Comment