When testing failover or failback of the Appliance Database, validate that the database was replicated correctly.

About this task

After configuring the Appliance Database on designated master and replica appliance host machines, test that the database on either machine can function with your system.

Prerequisites

Procedure

  1. Log in to the appliance that contains the primary or master database.
  2. Run the ps -ef |grep wal command to validate that the WAL process is running.
    # ps -ef |grep wal
    postgres  4784  4779  0 21:42 ?        00:00:00 postgres: wal writer process                                                  
    postgres 20901  4779  0 22:49 ?        00:00:00 postgres: wal sender process replicate 10.26.36.64(55887) streaming 0/70000B8
    
  3. Run the pg_is_in_recovery command to validate that the master appliance database is ready for read-write connections.
    su - postgres
    /opt/vmware/vpostgres/current/bin/psql vcac
    SELECT pg_is_in_recovery () ;

    The command returns f for false.

    vcac=# SELECT pg_is_in_recovery () ;
    pg_is_in_recovery
    --------------------
    f
    (1 row)
  4. Quit psql using the \q command.
  5. Log in to the secondary appliance with the replica database using SSH.
  6. Run the pg_is_in_recovery command to validate that the replica database is read only.
    su - postgres
    /opt/vmware/vpostgres/current/bin/psql vcac
    SELECT pg_is_in_recovery () ;

    The command returns t for true.

    vcac=# SELECT pg_is_in_recovery () ;
    pg_is_in_recovery
    ----------------------
    t
    (1 row)
  7. Quit psql using the \q command.