Configuring an Active - Standby Replication

You can configure a two-node, active - standby replication, which uses a virtual IP address.

The following figure depicts an active - standby setup, with example IP addresses that will be used throughout this topic.

Active - Standby Replication

The steps below show you how to configure this type of cluster. It is assumed that you have already deployed two Cloudpath ES systems with the same .OVA file.

  1. On the Cloudpath system that you want to be the "active" system (192.168.94.243 in the figure), open a terminal window and log in to the service account:
    • Port 8022 with SSH unless you change the port number
    • Username: cpn_service
    • Password: Enter the password.

    The command-line configuration utility prompt (#) should display.

  2. Enter the command: replication setup
  3. When presented with cluster-type options, select Active-Standby and continue.
  4. When you are asked if you want the node you are on to be the primary database node, answer yes and continue:
    Do you want this node (192.168.94.243) to be the primary database node? [y/n]
  5. Enter the IP address of the standby node when you are prompted for the "Secondary node IP:"
    Secondary database cluster node configuration:
    
      Secondary node IP: 192.168.94.244
  6. Enter 8022 for the SSH port of the standby node when prompted (unless you have changed this port number):
    Secondary node SSH Port: 8022
  7. When presented with the following warning, you can answer yes and proceed:
     ------------------------------------------------------------------------------
       WARNINGS:
         Configuring the cluster will cause any data existing on 192.168.94.244 be
         deleted and replaced with the data currently on 192.168.94.243
     ------------------------------------------------------------------------------
    
      Do you want to continue? [y/n]
  8. You will then be presented with the following to confirm that your setup is what you expect:
     192.168.94.244 will be the secondary database cluster node.
    
     ------------------------------------------------------------------------------
       Database cluster has been defined:
         Primary: 192.168.94.243   ssh port# 8022
         Secondary: 192.168.94.244   ssh port# 8022
    
         Cluster Type: Active-Standby
     ------------------------------------------------------------------------------
    
      Is this correct? [y/n]

    If the information above is correct (as it is for this example), answer yes and proceed.

  9. You are then prompted to enter the Virtual IP address. Be sure that the Virtual IP you enter is in the same domain as the primary and secondary nodes and that you enter an IP address not currently in use, then proceed:
     Virtual IP: 192.168.94.245
  10. You are then presented with the following:
     ------------------------------------------------------------------------------
      Cluster DNS Name - The cluster as a whole must have a single unified DNS name
                         it is known as.  This is most likely the fully qualified
                         domain name (FQDN) of the HTTPS certificate for the
                         enrollment portal as a whole.
    
                         This DNS name in most cases will resolve to the load
                         balancer fronting the cluster. Example:
                         Node 1 : node1.my-company.com
                         Node 2 : node2.my-company.com
                         Cluster DNS Name : wifi-onboarding.my-compandy.com
    
      IMPORTANT: If certificate based enrollments already exist you must re-use
                 the hostname that was in place at the time of the enrollments
                 occurred as the "Cluster DNS Name".  If this name is modified,
                 all existing certificates will be invalidated as their OCSP URL
                 will no longer match the answering address of the CA (which must
                 be the cluster as a whole.)
    
      Cluster DNS Name: jeff243.cloudpath.net
        - Please ensure this is correct.
        - This name should match up with the host portion of the "OCSP URL" within
          the browser based Admin UI.  See "Certificate Authority > Manage CAs"
          If this is a new install you may want to create a new root CA if this
          does not match.
        - This value may not be changed after certificate based enrollments occur
          without requiring users to re-enroll.
     ------------------------------------------------------------------------------
    
      Do you want to keep jeff243.cloudpath.net? [y/n]

    It is recommended to enter yes and proceed.

    Note: If you enter no and proceed, you will later need to follow instructions from the command dialogue to update certificates.

  11. You are then presented with the following:
     ------------------------------------------------------------------------------
       Cluster Name is set: jeff243.cloudpath.net.
       At later time, you will need to make DNS changes:
         Assign jeff243.cloudpath.net to 192.168.94.245 (Virtual IP).
         Rename hostname of the primary Database node.
     ------------------------------------------------------------------------------
    
      Do you want to continue? [y/n]

    Enter yes to proceed.

    Note: The dialogue informs you that you will need to make some DNS changes. This is described following these numbered steps.
  12. The process completes, as shown in the following example. Check that you receive "Replication cluster setup complete:"
    Will establish ssh 192.168.94.244:8022 ...
     ------------------------------------------------------------------------------
        * You will be prompted for the password of the remote VM 192.168.94.244.
     ------------------------------------------------------------------------------
    yes: standard output: Broken pipe
    yes: write error
    /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/repl_user/.ssh/id_rsa.pub"
    cpn_service@192.168.94.244's password:
    id_rsa.pub                                                                                                100%  406     1.1MB/s   00:00
    Checking remote host 192.168.94.244 ...
    Will copy cluster configuration to node 192.168.94.244 ...
    Will establish ssh from 192.168.94.244 to 192.168.94.243 ...
    SSH connection from 192.168.94.244 to 192.168.94.243: SSH test succeeded
    Will update network configuration ...
    Will update database server configuration ...
    Will stop local application service ...
    Will restart database service...
    Will configure local database service permission ...
    Will transfer application database to the secondary database node at 192.168.94.244 ...
    Will restart local application service ...
    Will provision new remote node 192.168.94.244 ...
    Done provisioning new remote node 192.168.94.244 :
    Will replicate web cluster name jeff243.cloudpath.net ...
    Will replicate web cluster name jeff243.cloudpath.net on 192.168.94.244 ...
    Done replicating web cluster name.
    Will configure keepalived on 192.168.94.243 ...
    Created symlink from /etc/systemd/system/multi-user.target.wants/keepalived.service to /usr/lib/systemd/system/keepalived.service.
    Done keepalived configuration on 192.168.94.243 ...
    Will configure keepalived on on 192.168.94.244 ...
    Created symlink from /etc/systemd/system/multi-user.target.wants/keepalived.service to /usr/lib/systemd/system/keepalived.service.
    Done keepalived configuration on 192.168.94.244 ...
    Will enable local cluster monitoring service ...
    Created symlink from /etc/systemd/system/multi-user.target.wants/cloudpath-repld.service to /etc/systemd/system/cloudpath-repld.service.
    Will enable cluster monitoring service on 192.168.94.244 ...
    Created symlink from /etc/systemd/system/multi-user.target.wants/cloudpath-repld.service to /etc/systemd/system/cloudpath-repld.service.
    Replication cluster setup complete.
    #

Verifying That the Cluster was Properly Created With Two DB Nodes:

To verify that your two-DB-node replication has been created correctly, follow these steps:

  1. Log in to the Cloudpath UI on any either of the two DB nodes in the cluster.
  2. Go to Administration > Replication.
  3. Make sure that the status indicates that both nodes are present in the cluster and have green check marks next to their names. as shown in the screen below that is based on the example in the topology presented in this section.

    Cluster Status Successful After Configuration of Both Database Nodes Completes

Changes to Make Before Using Cluster for Enrollments:

Before you begin using the cluster for enrollments, you need to make the DNS changes (using your DNS configuration tool) that were listed in the command dialogue as you entered your information. Those changes are necessary for the virtual IP to be able to failover to the secondary node if the primary node goes down. In the example shown above, two DNS changes are required:

Cluster Name is set: jeff243.cloudpath.net.
   At later time, you will need to make DNS changes:
     Assign jeff243.cloudpath.net to 192.168.94.245 (Virtual IP).
     Rename hostname of the primary Database node.

  1. Assign the cluster name (jeff243.cloudpath.net) the virtual IP address 192.168.94.245.
    Note: The cluster name must be assigned the virtual IP address.
  2. Rename the host name of the primary node from jeff243.cloudpath.net to a different name so that it does not conflict with cluster name.