Reading Time: 18 minutes

Anypoint Runtime Fabric is a container service that automates the deployment and orchestration of Mule applications and API gateways. Runtime Fabric runs within a customer-managed infrastructure on Amazon Web Services (AWS), Microsoft Azure, virtual machines (VMs), and bare-metal servers.

In this blog post, I will demonstrate how to install Runtime Fabric on a local PC, to test its functionality without the need to run expensive AWS or Azure instances. 

Prerequisites

latest report
Learn why we are the Leaders in API management and iPaaS

The minimal requirement for Runtime Fabric are listed below:

  • Operating System:
    • Red Hat (RHEL) v7.4, v7.5, v7.6, v7.7
    • CentOS v7.4, v7.5, v7.6, v7.7
  • One controller node:
    • a minimum of two  dedicated cores 
    • 8 GiB memory minimum
    • 80 GiB dedicated disk for the operating system.
    • 60 GiB dedicated disk with 3000 provisioned IOPS for etcd
    • 100 GiB dedicated disk with 1000 provisioned IOPS for Docker
  • Two worker nodes:
    • a minimum of two dedicated cores 
    • 15 GiB memory minimum
    • 80 GiB dedicated disk for the operating system.
    • 100 GiB dedicated disk with 1000 provisioned IOPS for Docker

Despite the high requirements, Runtime Fabric can run on a relatively powerful Intel i7 PC with 32 GB of RAM and 500GB of free disk space, although this would not be recommended for production and is only really desirable for testing and learning Runtime Fabric.

For the virtualization environment, we will use a free version of VMWare player on which we will run three separate CentOS v7.7 VM instances (one controller and two workers). In this blog post, I have used version 15.5 of VMWare player.

Anypoint Platform account with the Platinum subscription or above is required to register Runtime Fabric with Anypoint Runtime Manager.

Configure the VM environment to meet hardware requirements

We will use three VMs; one controller and two workers. With this configuration, we will create the Development Configuration shown in figure 1 below:

Fig. 1: Runtime Fabric development configuration

The characteristics for each VM has to match the Runtime Fabric minimum hardware requirements for the controller (figure 2) and three workers (figure 3), even if your machine does not have those resources available. This is possible because the VM does not actually allocate all the resources immediately.

Fig. 2: Controller settings
Fig. 3: Worker settings

Ensure you set configurations to match those in figures 2 and 3.

Install Centos 7 on each node

Each VM has Centos 7.7 installed. Make sure that all necessary updates are installed by running the newly created VM sudo yum update. Read this step-by-step guide to installing Centos 7 for a complete list of installation steps.

Configure static IP address on each node

Evey Runtime Fabric node requires a static IP address. You can keep DHCP as a default option and configure DHCP static lease on your router for the IP addresses using the MAC address provided by the node ethernet interface. As an alternative, you can set a static IP address in your node network configuration file which is described in the TechRepublic article.

Optionally, you may make a backup of your VMs for quick recovery.

Now that all the nodes are set up, you’ll need to prepare Anypoint Platform to host Runtime Fabric.

Configuring Anypoint Platform to manage Runtime Fabric

Login to Anypoint Platform and make sure that you have sufficient access rights to manage Runtime Fabric. To verify that you do, go to Access Management then Users and make sure that you have Manage Runtime Fabric permission assigned to yourself, figure 4.

Fig. 4: Runtime Fabric permissions

The next step is to create a new Runtime Fabric instance in Runtime Manager. As shown in figure 5, I named the new Runtime Fabric instance solar-fabric.

Fig. 5: Runtime Fabric creation

Unique activation data for this instance of Runtime Fabric will be generated and displayed on the screen, figure 6. Ensure to make a copy of this data as I will use it in the Runtime Fabric nodes creation process later on.

Fig. 6: Runtime Fabric activation data

Install Runtime Fabric on each node

Now I am ready to instal Runtime Fabric on each node.

Download and extract the Runtime Fabric Installer

Download and extract the Runtime Fabric Installer configuration files from the Runtime Manager interface (see figure 5) onto the controller, worker1, and worker2 nodes by logging into them using ssh and executing the command below under the local user. 

wget -O rtf-install-scripts.zip https://anypoint.mulesoft.com/runtimefabric/api/download/scripts/latest && mkdir -p ./rtf-install-scripts && unzip rtf-install-scripts.zip -d ./rtf-install-scripts

This will download the Runtime Fabric installation scripts from the MuleSoft website and extract them into the ./rtf-install-scripts directory.

Generate node-specific configuration scripts

The generate-configs.sh script located in the rtf-install-scripts/manual directory generates configuration scripts specific to each of the three nodes. It has a complete list of configuration parameters needed for installation. The complete list is detailed here.

Modify the generate-configs.sh script on the controller node and specify values for, at least, the following mandatory parameters:

  • Controller node: Use fixed IP address assigned to the network interface of the controller VM.
  • RTF Workers IP addresses: Use fixed IP addresses assigned to the network interface of the worker’s VM.
  • RFT activation data: Get it from the Runtime Fabric page in Anypoint Runtime Manager.
  • Docker and etcd storage devices: Make sure to select the right ones by running command lsblk and see which disks are reserved for etcd (60GB) and for docker (100GB), as shown in figure 7.
Fig. 7: The specified block devices for Docker

Ensure to pay particular attention to the syntax. All parameters are quoted and worker IP addresses are separated with spaces.

RTF_CONTROLLER_IPS=”192.168.0.190″

RTF_WORKER_IPS=”192.168.0.191 192.168.0.192″

RTF_ACTIVATION_DATA=”YW55cG9pbnQubXVsZXNvZnQuY29tOjBiZTU1ZjVhLTE1YTgtNDMViNDM3MTU0Nw==”

RTF_DOCKER_DEVICE=”/dev/sdc”

RTF_ETCD_DEVICE=”/dev/sdb”

Execute the ./generate-configs.sh script to generate a file that contains a configuration script for each node. For ease of use, it’s recommended to send the output from the script to a text file  ./generate-configs.sh > scritps.txt.

The output will include a configuration script for each node similar to that shown in figure 8.

Fig 8: Auto-generated script for VM with IP address 192.168.1.202

Install required software on each node

On each node ensure that you have Chrony (allows computers to synchronize time) installed on all your nodes. Follow these Chrony installation instructions

Set environment variables

Identify and separate the script snippet from the output of the generate-script.sh script for each node. Then execute the snippet on its respective node under the root user. This will set the environment variables that the installation script (init.sh) will use. 

You can execute this script by copying and pasting the appropriate section from the output of generate-script.sh to the command prompt of the relevant node and executing in place. 

Alternatively, you may want to create a bash script and to execute it. The advantage that this alternative allows you to easily correct initial configuration errors and repeat the script execution without having to rerun the generate-script.sh script. Note that you may need to change the access permissions to /opt directory.

Finally, set a unique hostname for each Runtime Fabric node. For example, on the controller node run the command hostname controller1 to set the controller hostname to controller1.

Launch the installation

To launch the installation first copy the init.sh file from ./rtf-install-scripts/scripts/init.sh to /opt/anypoint/runtimefabric.

Installation is launched by executing the init.sh script under as the root user. This script is located in the ./rtf-install-scripts/scripts directory and should be copied to the /opt/anypoint/runtimefabric directory. Execute sudo init.sh to install Runtime Fabric on the controller node first.

Installation of Runtime Fabric will start and may take between 15-25 minutes to complete. There are 14 installation steps that will execute in order and output to the screen. When you see that step 14 has completed successfully, figure 9, Runtime Fabric will have been installed.

Fig 9. Final installation step

OPS Center Login Details

Runtime Fabric uses a lot of technology behind the scenes, among that technology is OPs Center. During the installation process, login to the Ops Center is generated during step 10 and output to the logs and output to the screen. To find those details scroll up the console output and locate them under the step 10. Here you will find the credentials as shown in figure 10.

Fig 10. OPS center credentials

Verify the status of Runtime Fabric in Runtime Manager. Check the status of Runtime Fabric in Anypoint Platform Runtime Manager. It should be Active, figure 11.

 Fig 11. Runtime Fabric Active status

Install Runtime Fabric on worker nodes

Install Runtime Fabric on all workers by SSH to each of them and run the command cd /opt/anypoint/runtimefabric/ && sudo init.sh. This task can be performed concurrently.

Complete installation in OPs Center

To complete installation steps connect to the OPS center using the credentials output in the logs and check the status of your nodes.

Fig 12. OPS center Serves status page

At this point, we have Runtime Fabric installed on the local PC and fully functional.

If you encounter an error

If the installation process encounters an error, it’ll exit with a message to help indicate how to resolve the error. In most cases, errors can be resolved by updating one or more values in the /opt/anypoint/runtimefabric/env file to the correct value and re-running the init.sh script.

If restarting of the init.sh script does not work remove the existing Runtime Fabric installation by running the command: sudo gravity leave –force then remove .state directory and re-run sudo ./init.sh again.

Additional steps

It may be necessary to do the following:

  • Adding Mule license
  • Enable incoming traffic
  • Deploy the first application to Runtime Fabric

Conclusion

In this blog post, I discussed the installation of Runtime Fabric on a local PC. This is a straightforward process that allows you to trial Runtime Fabric, learn instantiation, and run scenarios without the expense of cloud servers.

If you would like to attend a training course to learn how to install Runtime Fabric on cloud servers, register for the Runtime Fabric class, available in person or online.

As the prerequisites, we have to have a reasonably powerful PC that will be able to run a virtualization environment and has enough resources to host three VMs at the same time.

For this blog post PC with the following characteristics was used:

  • Intel(R) Core(TM) i7 CPU
  • 32GB RAM
  • 1TB HDD
  • Windows 10 Pro
  • VMWare Workstation 15 Player
    • 3 x CentOS 7.7
  • DHCP static lease assigned by the router based on mac addresses assigned to the virtual network interfaces