Configure the secondary or failover virtual appliance to support appliance database replication.

About this task

Set up database replication on the designated secondary appliance so that the appliance database on the primary appliance is replicated on the secondary appliance in the case of failover.

Prerequisites

The appliance database is installed and configured as described in vRealize Automation Installation and Configuration.

Procedure

  1. Log in to the virtual appliance as root using SSH with the su - postgres command.
  2. Configure replication as the postgres user using the following command.

    ./run_as_replica -h <Primary Appliance> -b -W -U replicate

    Replace the parameters with the following values.

    Option

    Value

    [-h]

    Hostname of the master database server. Port 5432 is assumed.

    [-b]

    Take a base backup from the master. This option destroys the current contents of the data directory.

    [-W]

    Prompt for the password of the user performing the replication.

    [-U]

    The user performing the replication. Generally this user is replicate.

    For example:

    # su - postgres
      /opt/vmware/vpostgres/current/share/run_as_replica -h app1.domain.local -b -W -U replicate

  3. Enter the replicate user password when prompted.
  4. Type "yes" after verifying the thumb print of the primary machine when prompted.
  5. Enter the postgres user password when prompted.
  6. Type "yes" in response to the following message.

    "Type yes to enable WAL archiving on primary."

  7. Type "yes" in response to the following message.

    "WARNING: the base backup operation will replace the current contents of the data directory. Please confirm by typing yes."

What to do next

Validate that the replication was successful. See Validate Appliance Database Replication.