com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_links' is unknown.

Configuring HA in Single JVM Mode on EC2

The following sections cover the information required to configure high availability (HA) for PPaaS  in Single JVM Mode on Amazon EC2:

Deployment Architecture

In this deployment model PPaaS Core is configured in Active/Passive mode using an Amazon Auto-scaling group and an Elastic Load Balancer. PPaaS Core consists of Cloud Controller (CC), Auto-scaler (AS) and PPaaS Manager (SM). The configuration will make sure that at any given time an instance of PPaaS Core is active. CEP, BAM and ActiveMQ are configured in Active/Active mode. For more information, see the following links for configuring them:

Configuring PPaaS Core in Active/Passive mode on EC2

Follow the instructions below to configure PPaaS Core in Active/Passive mode on Amazon EC2:

Step 1: Create an AMI for PPaaS

Follow the instructions below to create an AMI for PPaaS:

  1. Log in to the Amazon EC2 Management Console and start an Ubuntu 12.04 Server 64 bit instance:
     
  2. SSH into the above VM instance and install Java and find the JAVA_HOME path:

    # Install java
    sudo apt-get install python-software-properties
    sudo add-apt-repository ppa:webupd8team/java
    sudo apt-get update
    sudo apt-get install oracle-java7-installer
    # Find JAVA_HOME
    file $(which java)
    /usr/bin/java: symbolic link to `/etc/alternatives/java'
    file /etc/alternatives/java
    /etc/alternatives/java: symbolic link to `/usr/lib/jvm/java-7-oracle/jre/bin/java'
  3. SCP PPaaS package into the above VM instance and extract it at the /opt folder and grant permissions to the user ubuntu:

    cd /opt/ppaas-4.1.1
    sudo chown -R ubuntu:ubuntu .
  4. Update the Message Broker IP address and port in the following file:

    /opt/ppaas-4.1.1/repository/conf/mqtttopic.properties
  5. Create an init.d script for PPaaS using the following file and update the USER, JAVA_HOME and PRODUCT_HOME variables:

    https://gist.github.com/imesh/5256272cd71b74a06581
    
    USER=”ubuntu”
    JAVA_HOME=”/usr/lib/jvm/java-7-oracle/jre/bin/java”
    PRODUCT_HOME=”/opt/ppaas-4.1.1” 
  6. Set executable permissions to the above init.d script:

    sudo chmod +x /etc/init.d/ppaas
  7. Configure the PPaaS service to be started at boot time:

    update-rc.d ppaas defaults
    update-rc.d ppaas enable
  8. Verify the PPaaS service by starting the service:

    service ppaas start
    service ppaas status
    service ppaas stop
  9. Remove the log files that was created by the previous step:

    rm /opt/ppaas-4.1.1/repository/logs/*
  10. Create an AMI from the above running instance via the EC2 Management Console:

Step 2: Create an Amazon Load Balancer

Follow the instruction below to create an Amazon Load Balancer:

  1. Navigate to the Network & Security menu in the EC2 dashboard and click Load Balancers.
  2. Click create Load Balancer
  3. Define the following protocols that will be used by PPaaS and click Continue.
     
  4.  Add the  SSL certificate information and click Continue.
     
  5. Click Continue without changing the default information on ciphers.
  6. Click Continue without changing the default information on backend certificate.
  7. Configure the health check endpoint and click Continue.
      • Set the Ping protocol to HTTPS.

      • Set the Ping port to 9443.

      • Set the Ping path to /console.
         
  8. Click Continue without changing any of the default setting in the Add EC2 Instances page.
     
  9. Click Continue without changing any of the default setting in the Add tags page.
     
  10. Review the details of the load balancer and click Create.
     

Step 3: Launch an EC2 Configuration

Follow the instructions below to launch an EC2 configuration:

  1. Navigate to the Auto Scaling menu in the EC2 dashboard and click Launch Configurations.
  2. Click Create launch configuration.
  3. Search for the PPaaS AMI created and click Select.
  4. Choose the instance type required and click Next: Configure details.
     
  5. Add a configuration name and click Next: Add Storage.
     
  6. Click Next: Configure Security Group without changing any of the default storage details.
     
  7. Configure a security group as required and click Review.
    Consider closing all ports other than the ones used by PPaaS.
     
  8. Review the details and click Create launch configuration.
     

Step 4: Create an auto-scaling group

Follow the instructions below to create an auto-scaling group:

  1. Navigate to the Auto Scaling menu on the EC2 Dashboard and click Auto Scaling Groups.
  2. Click Create Auto Scaling group.

  3. Configure the Auto-scaling group details: 

    • Enter a group name.

    • Set group size to 1.

    • Set a preferred availability zone.

    • Check the Receive traffic from Elastic Load Balancer(s) checkbox option.

    • Set the load balancer created previously.

    • Set the Health Check Type to ELB.

  4. Click Next: Configure scaling policies.

  5. Select Keep this group at its initial size under s caling policies and click Next: Configure Notifications.
  6. Configure the notifications as shown in the screen below and click Next: Configure Tags.
  7. Click Review.
    Configuration is not required for configuring tabs.
  8. Review the details and click Create Autoscaling Group.

Step 5: HA Verification

Once the above configuration is complete, EC2 will start a PPaaS AMI instance in the configured autoscaling group.

Follow the instruction below to verify a HA:

  1. Navigate to the Auto Scaling menu on the EC2 Dashboard and click Auto Scaling Groups.

  2. Click on Instances to see the status of the instance.

  3. SSH into the instance and stop the PPaaS service if the Health Status of the instance is indicated as Healthy.

     

    sudo su
    service ppaas stop
  4. Recheck the Instances tab under Auto Scaling Group.
    Now the health status of the instance should be indicated as Unhealthy.

  5. Terminate the running instance and start a new one.
com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_links2' is unknown.