25.2.2.3.2. Launch One or More Instances to Serve as Host Controllers

Summary

This topic covers the steps required to launch one or more instances of JBoss EAP 6 to serve as non-clustered host controllers on a Red Hat AMI (Amazon Machine Image).

Procedure 25.4. Launch Host Controllers

For each instance you would like to create, repeat the following steps:
  1. Select an AMI.
  2. Define the desired number of instances (the number of slave host controllers).
  3. Select the VPC and instance type.
  4. Click on Security Group.
  5. Ensure that all traffic from the JBoss EAP 6 subnet is allowed.
  6. Define other restrictions as desired.
  7. Add the following into the User Data field:
    ## mod cluster proxy addresses
    MOD_CLUSTER_PROXY_LIST=10.0.0.4:7654
    
    ## host controller setup
    ### static domain controller discovery setup
    JBOSS_DOMAIN_MASTER_ADDRESS=10.0.0.5
    ### S3 domain controller discovery setup
    # JBOSS_DOMAIN_S3_SECRET_ACCESS_KEY=<your secret key>
    # JBOSS_DOMAIN_S3_ACCESS_KEY=<your access key>
    # JBOSS_DOMAIN_S3_BUCKET=<your bucket name>
    
    JBOSS_HOST_PASSWORD=<password for slave host controllers>
    
    ## subnet prefix this machine is connected to
    SUBNET=10.0.1.
    
    #### to run the example no modifications below should be needed ####
    JBOSS_HOST_USERNAME=admin
    PORTS_ALLOWED="1024:65535"
    JBOSS_IP=`hostname | sed -e 's/ip-//' -e 'y/-/./'` #listen on public/private EC2 IP address
    
    cat > $USER_SCRIPT << "EOF"
    ## Server instance configuration
    sed -i "s/other-server-group/main-server-group/" $JBOSS_CONFIG_DIR/$JBOSS_HOST_CONFIG
    
    ## this will workaround the problem that in a VPC, instance hostnames are not resolvable
    echo -e "127.0.0.1\tlocalhost.localdomain localhost" > /etc/hosts
    echo -e "::1\tlocalhost6.localdomain6 localhost6" >> /etc/hosts
    for (( i=1 ; i<255 ; i++ )); do
        echo -e "$SUBNET$i\tip-${SUBNET//./-}$i" ;
    done >> /etc/hosts
    
    EOF
    For further information on domain controller discovery on Amazon EC2, see Section 25.2.2.3.4, “Configuring Domain Controller Discovery and Failover on Amazon EC2”.
  8. For Production Instances

    For a production instance, add the following line beneath the USER_SCRIPT line of the User Data field, to ensure security updates are applied on boot.
    yum -y update

    Note

    yum -y update should be run regularly, to apply security fixes and enhancements.
  9. Launch the Red Hat AMI instance.
Result

The JBoss EAP 6 non-clustered host controllers are configured and launched on a Red Hat AMI.