installing and configuring mule runtime
June 7, 2018

How to install and configure Mule Runtime

by Eugene Berman in Digital Transformation , Mulesoft , Tips and Tricks 2 comments

Even the most user-friendly tools can be challenging to install and configure the first time. For this reason, our customers frequently ask us for the best practices around installing and configuring the Mule runtime.

In this post, I share my learnings and my approach for installing and configuring the Mule runtime based on ten years of doing this for the enterprise.

This post is specific for what we recommend for RedHat Enterprise CentOS official recommendation and only covers Mule 3.x runtime on premise. Not applicable to CloudHub or Mule 4.x. The post assumes you have a basic understanding of Linux administration.

Usually, installing Mule Runtime on a server is a trivial task, there are some recommended best practices. Here’s how I do it.

Mule Runtime can successfully run on a number of different operating systems which support Java. However, personally I prefer and recommend Linux Red Hat Enterprise or CentOS version 7. By default, these Linux distributions come with OpenJDK pre-installed. I highly recommend removing OpenJDK completely from the system using package managers such as yum or rpm, followed by using manual remove commands to clean up the rest of the JDK related files manually.

Best Practices for Configuring Mule Runtime

Download and install Oracle JDK (not JRE!) version 1.8.0 latest release (8u172 as of now). Verify the installation by running java -version and/or which java commands.

Next, create a mule directory in the /opt directory, i.e. /opt/mule. Download a copy of the mule runtime distribution from the Mulesoft Support portal – for this example I will be using mule-ee-distribution-standalone-3.9.0.tar.gz. Copy the distribution to /opt/mule and unpack using the following command:

# tar zxvf mule-ee-distribution-standalone-3.9.0.tar.gz

This will create a new directory inside /opt/mule with the name mule-enterprise-standalone-3.9.0. I usually create a symbolic link in the /opt/mule , e.g.

# ln -sf /opt/mule/mule-enterprise-standalone-3.9.0

/opt/mule/mule-enterprise-standalone

Next, install the license key as instructed by the Mulesoft documentation: https://docs.mulesoft.com/mule-user-guide/v/3.9/installing-an-enterprise-license

If you are planning to use any connectors that require native libraries – e.g. Anypoint SAP Connector, copy the native libraries to the /opt/mule/mule-enterprise-standalone/lib/native directory, then edit the /opt/mule/mule-enterprise-standalone/wrapper.conf file and add the following line:

wrapper.java.library.path.3=%MULE_HOME%/lib/native

Once it’s done, log into your Anypoint Platform account, navigate to the Runtime Manager, and add your runtime to the Runtime Manager as instructed: https://docs.mulesoft.com/runtime-manager/servers-create#creating-a-server

Now create a user mule:

# adduser mule

Change owner of the /opt/mule directory:

# chown -R mule:mule /opt/mule

Now we are going to configure Mule as a service so that it can start automatically when the system boots.

First, create a new file mule.service in the /usr/lib/systemd/system directory:

# vi /usr/lib/systemd/system/mule.service

Copy & paste the following text, then save the file:

[Unit]

Description = Mule Runtime service

After = network.target

[Service]

User = mule

ExecStart = /opt/mule/mule-enterprise-standalone/bin/mule start

ExecStop = /opt/mule/mule-enterprise-standalone/bin/mule stop

Type=forking

[Install]

WantedBy = multi-user.target

Enable the service using the following commands:

# systemctl daemon-reload

# systemctl enable mule.service

Start the service:

# systemctl start mule.service

Verify the status of the service:

# systemctl status mule.service

Congratulations, you are done!

In the next article of this series, we will discuss the installation and configuration of the DevOps server, including Nexus, Jenkins and version control systems such as BitBucket or GitLab.

Looking for more help with MuleSoft? Feel free to contact us!


Comments (2)
  • I am looking for some help on setting up CICD pipeline for my Mule project, This is for my learning purpose.
    I have installed Jenkins, have my own github project, would you or your team will be able to hep here?
    I am OK for paid service.

Leave a comment