Chapter 11. Deploying Red Hat JBoss BPM Suite to Amazon EC2 Web Service

Amazon Elastic Compute Cloud (hereinafter referred to as Amazon EC2) is a web service providing a computing environment in the Amazon Web Services (AWS) cloud. Deploying Red Hat JBoss BPM Suite to Amazon EC2 has been supported since version 6.2.

Amazon EC2 can be used to create a virtual machine and its computing environments called instances. Templates for this instances are then known as Amazon Machine Images or AMIs. The service allows you to modify the instance to use a required configuration of CPU, memory, storage, and other properties. The cost of the service is calculated based on the used compute capacity.

For more information about Amazon EC2 and all the provided features, see the official AWS Documentation.

11.1. Getting Started with Amazon EC2

Logging into AWS

  1. Go to the Amazon Web Services main page, click Sign in to the Console and enter your user credentials.
  2. On the AWS home page that opens, choose EC2 Virtual Servers in the Cloud in the left hand corner.

    You are redirected to the EC2 Dashboard.

    Figure 11.1. Amazon EC2 Dashboard

    ec2dashboard

EC2 Dashboard provides an overview of your AWS account as well as the information about the overall service health and scheduled events. The Resources section of the dashboard contains links to all running instances, created key pairs, security groups, and more. To launch a virtual server, click the Launch Instance quick link in the Create Instance section. The main menu on the left side of the page contains links necessary for configuring instances and images, setting up networks and controlling security issues.

Important

Note that login information in Amazon EC2 is encrypted. Before creating or starting an instance, you need to import your public key to AWS in order to be able to connect to the instance.

Importing Public Key

  1. In the main menu on the left, click Key Pairs under the NETWORK & SECURITY drop-down menu.
  2. Click Import Key Pair at the top of the page.

    The Import Key Pair dialog window opens.

  3. Define the name of the key pair and either upload the public key from file, or copy and paste the content of your public key into the Public key contents text field.
  4. Click Import.

    The imported key pair appears in the displayed list of key pairs.

Alternatively, you can create your own key pair using Amazon EC2. For more information, see the Amazon EC2 Key Pairs chapter in the AWS Documentation.

11.2. Creating and Starting Virtual Machine Instances

To deploy Red Hat JBoss BPM Suite to Amazon EC2, you must have a valid membership in the JBoss Cloud Access program. The program provides a number of supported AMIs created by Red Hat, while each of them has Red Hat Enterprise Linux 6 and Red Hat JBoss EAP 6 (together with other required software) pre-installed.

For further information about supported Amazon EC2 instance types, see the Deploy JBoss EAP 6 on Amazon EC2 chapter of Red Hat JBoss Enterprise Application Platform 6.4 Administration and Configuration Guide.

To create a virtual machine instance, do the following:

Creating Virtual Machine Instance

  1. In the main menu, click AMIs under the IMAGES drop-down menu.
  2. Choose one of the supported AMIs.

    For example RHEL-6.7_HVM_GA-JBEAP-6.4.7-20160421-x86_64-1-Access2-GP2 (ami-50bba23a).

  3. Click Launch.

    The Choose an Instance Type window opens. An instance type is a custom configuration of CPU, memory, storage, and networking capacity of your virtual machine instance.

  4. Choose one of the listed instance types.

    Instance type depends on the needs of your application. KIE Server and Business Central are usually two separated instances in AWS and each of them requires different settings. However, at least 2 vCPUs (the number of virtual CPUs) and 7.5 GiB of memory is recommended.

    It is possible to launch the instance directly from here by clicking Review and Launch. If you want to change additional settings, see the following steps.

  5. Click Next: Configure Instance Details.

    In this step, you can choose a number of launched instances, network (either EC2-Classic or VPC, the Amazon Virtual Private Cloud), or enable detailed monitoring. If you want to keep the default settings, continue to the next tab.

  6. Click Next: Add Storage.

    This screen allows you to add more Amazon Elastic Block Store (Amazon EBS) volumes and modify the settings of the root volume. The minimum recommended size of the root volume is 30 GiB.

    Important

    Make sure that the set volume size is greater than the size of the used snapshot.

  7. Click Next: Tag Instance and specify the tags for the instance that can help you search and filter the instances later. For example, the key Name can indicate a logical name of the instance in the instance list.
  8. Click Next: Configure Security Group.

    A security group is a virtual firewall containing a number of firewall rules that control the traffic for your instance. Each instance can have one or more security groups assigned and these groups can be modified at any time.

    You need to create a new security group in order to be able to deploy Red Hat JBoss BPM Suite:

    Creating New Security Group

    1. If not already selected, select the Create a new security group check box.
    2. Fill in the Security group name and Description.
    3. Keep the default SSH type TCP protocol rule.
    4. Define three new firewall rules by clicking Add Rule:

      • Default SSH access to Business Central:

        • Type: Custom TCP Rule
        • Protocol: TCP
        • Port Range: 8001
      • Default HTTP port of Red Hat JBoss EAP:

        • Type: Custom TCP Rule
        • Protocol: TCP
        • Port Range: 8080
      • Default Git port:

        • Type: Custom TCP Rule
        • Protocol: TCP
        • Port Range: 9418
      secgroup
    Warning

    All the configured ports must be allowed in the PORTS_ALLOWED property of user data. For more information, see Configuring User Data.

  9. Click Review and Launch.
  10. Review your instance details and if you want to launch the instance, click Launch.

A list of all created instances can be found under the Instances option in the main menu on the left. You can filter, search and launch the instances as well as view the instance description and edit the settings.

Figure 11.2. List of Instances Searched by Name

instancelist

In case you created a custom security group and defined new firewall rules with specific ports, you have to allow these ports in user data for the new virtual machine instance.

Configuring User Data

  1. In the main menu, go to INSTANCESInstances.
  2. In the list of instances, find and select the instance you want to configure.
  3. Click ActionsInstance SettingsView/Change User Data.

    viewuserdata
  4. In the View/Change User Data dialog window that opens, define the PORTS_ALLOWED property. For example:

    PORTS_ALLOWED="8001 8080 9418"
    ports allowed
  5. Click Save.

To start the created instance, do the following:

Starting Virtual Machine Instance

  1. In the main menu, go to INSTANCESInstances.
  2. Select the instance from the list and click ActionsInstance StateStart.

    startinginstance
  3. In the Start Instances dialog window that opens, click Yes, Start to confirm that you want to start the instance.
  4. Wait until the result of a status check changes to 2/2 checks passed.
Note

Do not forget to stop your instance after you no longer need it.

11.3. Installing Red Hat JBoss BPM Suite on Virtual Machine Instance

First, follow the steps below to connect to your instance:

Connecting to Instance

  1. Start the instance.
  2. Click Connect to view details required for accessing your instance.

    The Connect To Your Instance pop-up window opens.

  3. Copy the public DNS address.
  4. Execute the following command:

    ~]$ ssh ec2-user@PUBLIC_DNS_ADDRESS
  5. Enter yes to confirm that you want to connect to your instance.

Installing Red Hat JBoss BPM Suite on VM Instance

  1. Connect to the instance on which you want to install Red Hat JBoss BPM Suite.
  2. Update your instance in order to get the latest version of Red Hat JBoss EAP 6.x by executing the following command:

    ~]$ sudo yum -y update
  3. Switch to root:

    ~]$ sudo su
  4. Copy the following configuration files to /etc/jbossas/standalone/ and /etc/jbossas/domain/:

    • standalone.xml
    • standalone-full.xml
    • standalone-full-ha.xml
    • standalone-ha.xml
    • standalone-osgi.xml

    Follow the instructions:

    1. Download Red Hat JBoss BPM Suite 6.3.0 Deployable for EAP 6 from Customer Portal.
    2. Change directory to the location of the downloaded zip file.
    3. Copy the zip file into the /tmp/ directory of your virtual machine instance:

      ~]$ scp jboss-bpmsuite-6.3.0.GA-deployable-eap6.x.zip ec2-user@PUBLIC_DNS_ADDRESS:/tmp
    4. Go to the /tmp/ directory of your VM instance and unzip the file:

      ~]# unzip jboss-bpmsuite-6.3.0.GA-deployable-eap6.x.zip
    5. Change directory to jboss-eap-6.4/standalone/configuration/ and copy all the configuration files listed above into /etc/jbossas/standalone/ and /etc/jbossas/domain/, for example:

      ~]# cp standalone.xml /etc/jbossas/standalone/

      Enter y to overwrite the file.

    6. Make sure that the files were overwritten: standalone.xml should contain the following:

      <system-properties>
        <property name="org.kie.example" value="true"/>
        <property name="org.jbpm.designer.perspective" value="full"/>
        <property name="designerdataobjects" value="false"/>
      </system-properties>
  5. Copy the required applications (for example Business Central) to /usr/share/jbossas/standalone/deployments/:

    1. Change directory to /tmp/jboss-eap-6.4/standalone/deployments/.
    2. Copy Business Central:

      ~]# cp -r business-central.war /usr/share/jbossas/standalone/deployments/
      ~]# cp -r business-central.war.dodeploy /usr/share/jbossas/standalone/deployments/
  6. Set the proper Red Hat JBoss EAP binding address.

    Each virtual machine has private and public IP addresses. The public IP address can be accessed outside the AWS, while the private IP address is accessible only inside the virtual network of your Amazon EC2 account.

    Important

    Every time you start the instance, the addresses change. Refer to the Red Hat JBoss Enterprise Application Platform 6.4 Administration and Configuration Guide for more information.

    One way to set the address is by doing the following:

    1. Run ifconfig and copy the inet addr address (for example 10.233.159.148).
    2. Open /etc/jbossas/standalone/standalone.xml and set the proper binding address:

      <interfaces>
        ...
        <interface name="public">
          <inet-address value="10.233.159.148"/>
        </interface>
        ...
      </interfaces>
  7. Enable Git and SSH access to Business Central: add the following system properties (with your private IP address) into /etc/jbossas/standalone/standalone.xml.

    <property name="org.uberfire.nio.git.daemon.host" value="10.233.159.148"/>
    <property name="org.uberfire.nio.git.ssh.host" value="10.233.159.148"/>

Once the setup has been done, you can create a new AMI from your instance.

Creating new AMI from Configured Instance

  1. In the main menu, go to INSTANCESInstances.
  2. Locate your configured instance and click ActionsImageCreate Image.

    create image
  3. In the Create Image dialog window, specify the image details and click Create Image.

11.4. Running Red Hat JBoss BPM Suite on Virtual Machine Instance

Running Red Hat JBoss BPM Suite on VM Instance

  1. Start Red Hat JBoss EAP by executing the command:

    ~]# /etc/init.d/jbossas start

    Alternatively, you can use the command with option stop (or restart) to stop (or restart) the Red Hat JBoss EAP.

    The following message appears:

    Starting jbossas:                                          [  OK  ]

    If the deployment finished successfully, the business-central.war.dodeploy file in /usr/share/jbossas/standalone/deployments/ changes to business-central.war.deployed.

  2. To log in to Business Central, navigate to http://PUBLIC_DNS_ADDRESS:8080/business-central in a web browser.