Contact Free trial Login

Install Runtime Fabric on AWS

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

Before installing Runtime Fabric, ensure your infrastructure meets the minimum hardware, operating system, and networking requirements.

Your organization’s operations, networking and security teams should review these requirements. See System Requirements for Anypoint Runtime Fabric and Network and Port Requirements for Anypoint Runtime Fabric.

Before you Begin

Before installing Anypoint Runtime Fabric on AWS, ensure the following requirements have been met:

  • You have created a Runtime Fabric in Runtime Manager.

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

  • You are able to run Terraform on your machine.

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

  • Your AWS account has enough quota for the infrastructure required to run Anypoint Runtime Fabric. This includes having the capacity to create an additional VPC, EC2 instances, disks, security group, and other required resources.

  • You have the AWS key pair required to provision virtual machines. This key pair is required to enable secure access to your VMs via SSH (Secure Shell).

  • You have access to the following AWS-specific environment variables: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN, AWS_REGION, AWS_DEFAULT_REGION. These are required to run the Terraform script. If you do not know these values, contact your AWS administrator.

Base64 Encode Your Mule License Key

To install Runtime Fabric, your Mule license key must be Base64 encoded. Locate your organization’s Mule Enterprise license key file (license.lic) and perform the following according to your operating system.

Linux

To encode your license file on Linux, run the following:

base64 -w0 license.lic

MacOS

To encode your license file on MacOS, run the following from the terminal:

base64 -b0 license.lic

Windows

To encode your license file on Windows, a shell terminal emulator (such as cygwin) or access to a Unix-based computer is required to follow these steps:

  1. Find your organization’s Mule Enterprise license key file (license.lic) and transfer to your Unix environment if necessary.

  2. Run the following command to Base64 encode the license key:

    base64 -w0 license.lic

Install Terraform

MuleSoft provides a Terraform script that you run to provision the required AWS resources. You can run the Terrform script in one of the following ways:

  • Download and manually install Terraform on your machine. Verify that the version of Terraform installed is 0.11.7 or later by running terraform --version on your terminal.

  • Use Terraform within Docker.

Download the Terraform Script

  1. Sign in to Anypoint Platform and navigate to Runtime Manager.

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

  3. Click the name of your Runtime Fabric. It should be in the Activating state.

  4. Click Download files.

  5. When the download completes, unzip the rtf-install-scripts.zip file.

Contents of the Runtime Fabric Installer

Inside the rtf-install-scripts folder, there is an aws folder containing the following:

  • fabric.tf: Terraform script that provisions the infrastructure on your AWS account.

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

  • installer_env.sh: shell script of environment variables added to the controller VM acting as a leader during the installation.

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

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

  • README.md: markdown file containing installation instructions.

Modify the fabric.tf Script

Before running Terraform, modify the fabric.tf script to reflect your specific environment. The tables below list the required and optional environment variables.

Depending on your environment, you may need to modify environment variables specified within fabric.tf that are not listed in the tables below. This is common if you need to use existing AWS resources such as an existing VPC.

Required Environment Variables

Variable Description Example

activation_data

The encoded Runtime Fabric activation data. You can access this data by viewing your Runtime Fabric in Runtime Manager.

NzdlMzU1YTktMzAxMC00OGE0LWJlMGQtMDdxxxx

key_pair

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

my-keypair

enable_public_ips

specifies whether the installer creates public IP addresses for each VM. Public IPs enable you to ssh directly to the VMs from your network. If this value is set to false(default) each VM only has access to the private network configured by its VPC. If you specify false, ensure you have consulted with your network administrator on how to obtain shell/SSH access to VMs.

true

controllers

the number of controller VMs to provision.

3

workers

the number of worker VMs to provision.

3

mule_license

the base64 encoded contents of your organization’s Mule Enterprise license key (license.lic).

Optional Environment Variables

Variable Description Example

service_uid

An integer representing the user ID to run each Runtime Fabric service. Overrides the default behavior of creating a user named "planet".

1000

service_gid

An integer representing the group ID used when running each Runtime Fabric service. Overrides the default behavior of creating a group named "planet".

900

http_proxy

A hostname and port for a HTTP proxy server to forward outbound HTTP requests.

1.1.1.1:80

tcp_proxy

A hostname and port for a TCP proxy server to forward outbound TCP requests.

1.1.1.2:800

no_proxy

A comma-separated list of hosts which should bypass the proxy.

1.1.1.1,no-proxy.com

existing_vpc_id

specifies an existing AWS Virtual Private Cloud (VPC). Required when installing on an existing VPC. The installer uses this VPC instead of creating a new one.

existing_subnet_ids

specifies a existing subnet IDs within AWS. Required when installing on an existing network. The installer uses these subnets instead of creating a new one.

Configure Your Environment to Access AWS

To run the Terraform script, AWS API access should be configured in your terminal. Define values for AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and other environment variables including AWS_SESSION_TOKEN, AWS_REGION, or AWS_DEFAULT_REGION. These are required to access the AWS API for your account.

To verify that these are set correctly, you should be able to run the aws-cli tool, if installed on your machine.

Run the Terraform Script

After modifying fabric.tf to reflect your AWS environment, run the Terraform script to install Runtime Fabric.

Terraform State Files

When running, Terraform generates a state file to capture the details of the deployment. In the example below, the state file are located in tf-data/rtf.tfstate. A separate state file must be created and maintained for each Runtime Fabric infrastructure creation.

Keep the state file in a safe place. It is required when making changes to this deployment, such as when scaling the number of worker or controller VMs.

Run Using Native Terraform

  1. Navigate to the ../rtf-install-scripts/aws/ directory. You must run terraform from this directory.

  2. Initialize terraform (this only has to be performed once):

    terraform init
  3. Copy the following script to a text editor:

    terraform apply \
      -var activation_data='' \
      -var key_pair='' \
      -var enable_public_ips='' \
      -var controllers='3' \
      -var workers='3' \
      -var mule_license='' \
      -state=tf-data/rtf.tfstate
  4. Modify this using the data in the environment variables tables above.

  5. Ensure your terminal has access to the AWS-specific environment variables required as described above.

    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.

  6. Run the script.

The Terraform script provisions the infrastructure and runs the installation script on each VM. When complete, the Runtime Fabric update to Active status in Runtime Manager.

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

Run using Docker

  1. Navigate to the ../rtf-install-scripts/aws/ directory. You must run terraform from this directory.

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

  3. Initialize terraform (this only has to be performed once):

    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 following to a text editor:

      -var activation_data='' \
      -var key_pair='' \
      -var enable_public_ips='' \
      -var controllers='3' \
      -var workers='3' \
      -var mule_license='' \
      -state=tf-data/rtf.tfstate
  5. Modify this using the data in the environment variables tables above.

  6. Run the Terraform script:

docker run -it -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 apply \
  -var activation_data='' \
  -var key_pair='' \
  -var enable_public_ips='' \
  -var controllers='3' \
  -var workers='3' \
  -var mule_license='' \
  -state=tf-data/rtf.tfstate

The Terraform script provisions the infrastructure and runs the installation script on each VM. When complete, the Runtime Fabric updates to Active status in Runtime Manager.

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

Monitoring Installation Progress

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

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

  2. Tail the output log, located at /var/log/rtf-init.log using the following command:

    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 installer creates the /opt/anypoint/runtimefabric/.state/init-complete file.

Access Ops Center

After installation is completed successfully, login to Ops Center to view the status of your Runtime Fabric infrastructure. See Using Ops Center on Anypoint Runtime Fabric for information on accessing Ops Center and determining the Ops Center username and password.