Nav

Install Runtime Fabric on AWS

This topic describes how to install and register Anypoint Runtime Fabric on your AWS account.

Before running the installer, ensure that your infrastructure meets the minimum hardware, operating system, and networking requirements. An operations and networking specialist may be needed to provision the required infrastructure.

Before you Begin

Review the Preparing to Install Anypoint Runtime Fabric to ensure you are ready to install Runtime Fabric.

Prepare the necessary steps and understand the core concepts prior to installing Runtime Fabric.

In addition, ensure the following criteria have been met before beginning the installation:

  • Your AWS user has access to create EC2 instances, Disks, VPCs, Security Groups.

  • Your AWS account has enough quota for the infrastructure being provisioned.

  • Your Anypoint user account has the Manage Runtime Fabrics permission.

Download Script

The installer script zip file includes the necessary scripts needed to install Runtime Fabric.

  1. Log in to Anypoint platform and navigate to Runtime Manager.

  2. On the left navigation pane, select "Runtime Fabrics".

  3. Click "Create Runtime Fabric".

  4. Click the "Download files" link.

  5. Once downloaded, unzip the rtf-install-scripts.zip file.

You’ll find a directory named aws containing the following:

  • fabric.tf: a Terraform script to provision infrastructure on your AWS account.

  • security_group.tf: a separate Terraform script containing the Security Groups used by the fabric.tf script.

  • installer_env.sh: a shell script of environment variables added to the installer VM.

  • controller_env.sh: a shell script of environment variables added to the controller VM(s).

  • worker_env.sh: a shell script of environment variables added to the worker VM(s).

  • README.md: a markdown file containing installation instructions.

Provision Infrastructure

Use the included Terraform script to easily provision the required hardware and network settings needed to install and operate Runtime Fabric.

You’ll need a key pair to provision the VMs. This is required to enable secure access to your VMs via SSH (Secure Shell).

To run the Terraform script, AWS API access should be configured in your terminal. Define your values for AWS_ACCESS_KEY, AWS_ACCESS_SECRET_KEY, or other environment variables (such as AWS_SESSION_TOKEN, AWS_REGION, or AWS_DEFAULT_REGION) to access the AWS API for your account. As a test, you should be able to run the aws-cli tool, if installed on your machine.

Variables to Define

Some of the values for the variables below are available on the Create Runtime Fabric page on Anypoint Runtime Manager.

Variable Description Example

cluster_name

The name for your Runtime Fabric cluster; will be visible in Runtime Manager, composed of alphanumeric characters, hyphens and underscores only.

rtf-aws

key_pair

The name of the keypair in the AWS region you are deploying to.

my-keypair

enable_public_ips

Provision public IP addresses for each VM. If left as false, ensure you’ve consulted with your network administrator on how to obtain shell/SSH access to VMs.

false

anypoint_org_id

The ID for your Anypoint organization, available on the Create Runtime Fabric page.

2f99d26-a3c2-4023-b303-5528sdd5v022

anypoint_token

An active Anypoint authentication token, available on the Create Runtime Fabric page.

bearer 626d7810-0730-498b-bd48-544490c2226b

anypoint_region

The Anypoint broker region you’re registering to, available on the Create Runtime Fabric page.

us-east-1

anypoint_endpoint

The Anypoint control plane you’re registering to, available on the Create Runtime Fabric page.

anypoint.mulesoft.com

installer_url

The URL of the Runtime Fabric installation package, available on the Create Runtime Fabric page.

runtime-fabric.s3.amazonaws.com/…​

controllers

The number of controller VMs to provision.

3

workers

The number of worker VMs to provision.

3

mule_license

The digest (muleLicenseKey.lic) of your organization’s Mule Enterprise license key. Learn more on how to install a Mule Enterprise license.

Running Terraform

There are a couple of methods to run the Terraform script:

  • If you have Terraform installed on your machine, use the native terraform method.

    • Check the version of terraform installed is 0.11.7 or higher by running terraform --version on your terminal.

  • If you do not have Terraform installed, but have Docker installed, use the Docker method.

  • If you do not have Terraform or Docker installed, pick your most comfortable option.

Terraform State Files

When running Terraform to provision, a state file is generated to capture the details of the deployment. In the example above, the state file resides under tf-data/rtf.tfstate. A separate state file should be created and maintained for each Runtime Fabric infrastructure creation. The state file should be referenced when modifying or destroying the infrastructure.

Regardless of which option you choose to run the Terraform, keep the state file in a safe place. You’ll need to reference it when making changes to this deployment, such as when scaling the number of worker or controller VMs.

Run using Native Terraform

  1. Initialize terraform (only has to be done one time):

    terraform init
  2. Copy the script below in a text editor to easily define the variables.

    terraform apply \
      -var cluster_name= \
      -var key_pair= \
      -var enable_public_ips= \
      -var anypoint_org_id= \
      -var anypoint_token='' \
      -var anypoint_region= \
      -var anypoint_endpoint= \
      -var installer_url= \
      -var controllers=3 \
      -var workers=3 \
      -var mule_license='' \
      -state=tf-data/rtf.tfstate
  3. Use the Variables to Define table above to help define the variables.

  4. Ensure your terminal has access to the AWS_ACCESS_KEY, AWS_ACCESS_SECRET_KEY, and other related AWS environment variables (such as AWS_SESSION_TOKEN, AWS_REGION) as expected by Terraform.

    1. If you experience an error related to AWS authorization, ensure you’re using the same terminal window for verifying the variables and running the Terraform command.

  5. Verify your present working directory is the installer directory, and not the aws directory.

    1. You should be able to see the aws directory when running ls or dir in your terminal.

  6. Run the script.

Run using Docker

This method is preferred if you don’t have Terraform installed on your machine.

  1. Open a terminal/shell on the machine containing the Terraform script.

  2. Verify your current directory is the unzipped directory. When running dir command, you should see the aws directory show up, along with other directories (azure, manual).

  3. Initialize terraform (only has to be done one time):

    docker run -v $(pwd):/src -w /src/aws \
      -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_SESSION_TOKEN \
      hashicorp/terraform:0.11.7 init
  4. Copy the script below in a text editor to easily define the variables.

  5. Use the Variables to Define table above to help define the variables.

  6. Run the Terraform script:

docker run -it -v $(pwd):/src -w /src/aws \
  -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY \
  hashicorp/terraform:0.11.7 apply \
  -var cluster_name= \
  -var key_pair= \
  -var enable_public_ips= \
  -var anypoint_org_id= \
  -var anypoint_token='' \
  -var anypoint_region= \
  -var anypoint_endpoint= \
  -var installer_url= \
  -var controllers=3 \
  -var workers=3 \
  -var mule_license='' \
  -state=tf-data/rtf.tfstate

This step will execute the Terraform script to provision the infrastructure and run the installation script on each VM. The installer VM will download the installer package, unpack it and begin installation. The other VMs will wait for the installer VM to progress with installation until it’s able to make the installer files transferrable. Each VM will then transfer the files from the installer VM and carry out their own installation procedure.

When installation has been completed, a cluster will be formed across all VMs. The installer VM will then carry out the registration step using the Anypoint Organization ID, token, and region specified.

After registration has completed, you’ll see Runtime Fabric in Anypoint Runtime Manager, under the Runtime Fabrics tab. The installation script on the installer VM will proceed to insert the Mule Enterprise license digest in Runtime Fabric.

When finished, verify the installation by running this command to view the health of the Runtime Fabric cluster on any VM:

gravity status
This step will install Runtime Fabric across all servers to form a cluster. It may take 15-25 minutes or longer to complete.

Monitoring the Installation

The cloud-init library is used to execute the Runtime Fabric installation script. It’s useful to monitor the installation on the installer VM to verify all pre-flight checks have passed; if an error were to occur during installation, it’s likely to be visible by viewing the installer VM’s log output.

To view the progress during the installation, you can tail the output log on each VM:

  1. Open a shell (or SSH session) to the VM.

  2. Tail the output log, located at /var/log/rtf-init.log

    tail -f /var/log/rtf-init.log
You can tail the same log on each VM to view its progress.

When the installation completes successfully, the file /opt/anypoint/runtimefabric/init-succeeded is created.

Next Steps

Before deploying applications on Anypoint Runtime Fabric, you’ll need to perform the following steps:

We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used and to tailor advertising. You can read more and make your cookie choices here. By continuing to use this site you are giving us your consent to do this.

+