Deploying Platform on AWS

Ensure that you have the following AWS account information in place:

  • AWS_ACCESS_KEY
  • AWS_SECRET_KEY
  • EIP allocation IDs – 2 free IDs. These are needed to setup as public IP for your NAT gateway
  • Key pair name
  • SSL certificates uploaded to your AWS account (if planning to setup environment on Https)
  • Execute the following command to get the SSL_ARN value. You can execute the following command aws iam list-server-certificates on any ec2 machine or any Linux machine which has AWS cli libraries installed.

Ensure that in addition to Java v8 (Java 9 is not supported), the following software is installed on a Linux machine.

Software Steps to install on Amazon Linux
Packer 1.0.4

Result: This returns 1.0.4

Ansible 2.3

Execute the following commands:

  • sudo yum update
  • sudo yum-config-manager --enable epel
  • sudo yum install ansible
  • ansible --version

Result: Ensure that this returns ansible 2.3.1.0

Pip

This is pre-installed in Amazon Linux 2017

Note: In the CentOS machine, you can install Pip with the command yum install python2-pip

Botocore

This is pre-installed in Amazon Linux 2017

Note: In the CentOS machine, you can install Botocor with the command sudo pip install botocore

Boto3 Execute sudo pip install boto3
Python MySQL Module

  • Execute sudo yum -y install gcc
  • Execute sudo yum install mysql mysql-devel mysql-libs
  • Execute sudo yum install python27-devel
  • Execute sudo pip install MySQL-python
  • Execute sudo pip install mysql-python

MySQL Client Execute yum install mysql client

Perform the following steps to deploy Platform cluster on AWS.

  1. Login to the Platform website (https://infiniteblue.com/private-cloud-downloads) and download aws.zip.
  2. Extract aws.zip. The directory structure looks like below after extraction.

    |--- aws
         |--- build
         |--- cluster-config	
         |--- codebits
              |--- lib.zip
              |--- rollbase.zip
              |--- webapps.zip
         |--- deploy
         |--- nginx
         |--- installers
         |--- build_version.txt 

  3. Copy third-party jars (e.g. mysql-connector.jar) to the … /aws/build/custom/lib directory.

    |---aws
        |---build
            |---custom
                |---lib
                    |--- mysql-connector.jar
    

  4. Copy the third-party license files to the …/aws/build/custom/config directory.
  5. Download Tomcat and Java software to the …/aws/installers directory.
  6. Copy local_policy.jar and US_export_policy.jar to the …/aws/installers directory. (This is optional and is required only in case of a 256-bit security key).

    |--- aws
    |---installers
        |--- apache-tomcat-8.0.26.tar.gz
        |--- jdk-8u144-linux-x64.tar.gz
        |--- local_policy.jar
        |--- US_export_policy.jar
    

Generating the Configuration Files

To get configuration details in a var.json file for creating an AMI, perform the following steps.

  1. Browse to …/aws/cluster-config/Cluster-Config-Generation-Tool-win32-ia32.
  2. Execute Cluster-Config-Generation-Tool.exe(on Windows).
  3. Provide the required details in the AMI Creation tab as shown below.
    Note: Ensure that the downloaded versions of Tomcat and Java match with the versions entered in the AMI Creation tab. If you chose "us-east-1" as the AWS Region, specify "ami-a4c7edb2" as the Base AMI Id.
  4. Click Generate AMi Configuration. The var.json file is generated.
  5. Copy the var.json to the …/aws/build/config directory.
  6. Provide required details in the Topology Configuration as shown below.
  7. Click Generate Configuration. The topology.json is generated.
  8. Provide required details in the Configuration tab.
    Note: The Platform AMI field value can be entered only after performing the steps mentioned in the section Creating a Platform AMI. Ensure that you update this value after creating the Platform AMI.
  9. Click Generate App Configuration. The app.config file is generated.
  10. Copy the topology.json and app.config files to the …/aws/deploy/config_files directory.

Creating a Platform AMI

Perform the following steps to create a Platform AMI.

  1. Set AWS_ACCESS_KEY and AWS_SECRET_KEY as environment variables.
    export AWS_ACCESS_KEY=XXXXXXXXXXXXXXXXXXXX
    export AWS_SECRET_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    
  2. Run the following command to create a Platform Base AMI.
    cd /aws/build
    packer build -var-file=config/var.json templates/image_build_aws
    
    Note: If you encounter any issues, to troubleshoot, run the above command in the debug mode by executing the following:

    packer build -debug -var-file=config/var.json templates/image_build_aws

Setting up the Environment

Perform the following steps to set up the environment.

  1. Make sure that Java is set in PATH and execute the following commands:

    cd /aws/deploy/playbooks

    ansible-playbook -i ../inventory/host init.yml

    ansible-playbook -i ../inventory/host deploy-vpc.yml

    ansible-playbook -i ../inventory/host create-rds.yml

    ansible-playbook -i ../inventory/host create-asg.yml

    ansible-playbook -i ../inventory/host create-hooks.yml

    ansible-playbook -i ../inventory/host launch-cluster.yml

    Note: After completing the above steps, you should be able to access the environment with the following URL - http://<hostname>/router/login/loginPrivate.jsp

    • Every playbook is expected to be completed with success status and execution of next playbook depends on the previous one.
    • Playbooks are idempotent - if there is an issue with execution of a specific playbook, you can safely re-run the same playbook after fixing the problem

Execute the below command to shutdown the entire cluster environment.

ansible-playbook -i ../inventory/host admin-shutdown-cluster.yml

For more information on starting/shutting down high availabilty clusters, see Working with high availability clusters.