Mulesoft Installation Guide – OnPremise

Author: Anjali Kushwaha

In this article, we will learn how to add a Mule 4 standalone runtime as an additional server in Anypoint Platform from scratch and many more!

1. Install AdoptOpen JDK

Before installing MULE, you must ensure you have a supported version of Java on your system. JDK 1.8.0 is recommended to successfully install Mule on your system. If not, follow the below steps.

Step 1: Download Adopt OpenJDK from the below location:

For this installation we have used OpenJDK 11

Step 2: Install the OpenJDK11

While installing, select the “Set JAVA_HOME” option

Step 3: Verify the installation is successful, by giving the command “java     -version” in CMD prompt.

2. Setup Mule Runtime

To download the Mule 4 binary file, we have to follow a few steps.

Step 1: Download mule 4 standalone runtime from the support portal.

Step 2: Select to download.

Step 3: Extract the contents of the zip file to a location.

Step 4: Create a system variable MULE_HOME for the above extracted files location.

Step 5: Carefully, update max memory size and metaspace size in relevant sections in C:\MuleHome\conf\wrapper.conf file

3. Applying License

Complete the following steps to acquire and install a non-trial Enterprise license before you use Mule runtime in a production environment.

Step 1: Go to company support portal and download the relevant license file:

Step 2: Copy the license.lic file to the C:\MuleHome\bin folder

Step 3: Go to C:\MuleHome\bin in command prompt and install the license by issuing the below command

4. Install Mule Runtime as Windows Service

The main purpose of this section is to ease the process of execution. We can Start, Stop & Restart without the use of command prompt.

Step 1: Go to C:\MuleHome\bin in command prompt and execute the below command to install Mule as service: “mule install”.

Step 2: Type “services.msc” Windows Run dialog and verify the Mule enterprise is installed as a service. Ensure that the service is Automatic Type and then start the service.

Step 2: Verify that the Mule Runtime has started by verifying the

  E:\MuleHome\logs\mule_ee.log file.

5. Add Server to Anypoint Platform Runtime Manager

This section guides you towards adding a server to the runtime manager.

Step 1: Login to anypoint platform. Go to the runtime manager. Click on servers. 

In Runtime manager ensure the correct environment is set.

Step 2: Click on Add server. You will get a popup window as shown in the picture below.

   Provide relevant server name.

Step 3: Go to the directory where you have extracted your mule-runtime zip. Go to the bin directory and execute the command that you have copied from the above popup window. Remove ./ from the command before executing the command. Mule runtime agent will get installed after executing the above command.

Step 4: Once the mule runtime agent is installed, you will see one server with your given name is created in the runtime manager with status CREATED.

Step 5: Add encryption key in the wrapper.conf of mule runtime. (MuleRuntime-Dev\mule\conf\wrapper.conf)

This is the environment specific encryption key, following is the command for the development environment. The same can be done for different environments, only the value will be changed.************

Step 6: Restart Mule runtime from services.msc in the server and notice that the server  gets listed as Running in anypoint platform.

6. Mitigating Log4j2 Vulnerability (for Mule Runtime 4.3.0) 

Recently we faced the log4j2 vulnerability, in order to mitigate that we can follow the below steps:

Step 1: Stop your Mule Runtime.

Step 2: Download the Log4j version 2.17.x libraries from the Apache Website.

Step 3: Remove the following jar files – take backup of removed files before replacing in C:\ImportantBackup location.

  • ${MULE_HOME}/lib/boot/log4j-1.2-api-2.x.x.jar
  • ${MULE_HOME}/lib/boot/log4j-api-2.x.x.jar
  • ${MULE_HOME}/lib/boot/log4j-core-2.x.x.jar
  • ${MULE_HOME}/lib/boot/log4j-slf4j-impl-2.x.x.jar

Step 4: Remove the following jar files if there is no cumulative patches required, provided by Mulesoft – take backup of removed files before replacing in C:\ImportantBackup location.

  • ${MULE_HOME}/services/mule-service-weave-ee-2.x.x/lib/log4j-api-2.x.x.jar
  • ${MULE_HOME}/services/mule-service-weave-ee-2.x.x/lib/log4j-core-2.x.x.jar

Step 5: Extract the downloaded Log4j version 2.17.x libraries. Copy the respective libraries from the downloaded 2.17 version.

  • apache-log4j-2.17.0-bin/log4j-1.2-api-2.17.x.jar to ${MULE_HOME}/lib/boot
  • apache-log4j-2.17.0-bin/log4j-api-2.17.x.jar to ${MULE_HOME}/lib/boot
  • apache-log4j-2.17.0-bin/log4j-core-2.17.x.jar to ${MULE_HOME}/lib/boot
  • apache-log4j-2.17.0-bin/log4j-slf4j-impl-2.17.x.jar to ${MULE_HOME}/lib/boot

Step 6: If there is no cumulative patches required,  provided by Mulesoft. Copy the respective libraries from the downloaded 2.17 version.

  • Copy apache-log4j-2.17.0-bin/log4j-api-2.17.0.jar to ${MULE_HOME}/services/mule-service-weave-ee-2.x.x/lib/
  • Copy apache-log4j-2.17.0-bin/log4j-core-2.17.0.jar to ${MULE_HOME}/services/mule-service-weave-ee-2.x.x/lib/

Step 7: Restart your Mule Runtime.

7. Creating Cluster

A cluster is a set of up to eight servers that act as a single deployment target and high-availability processing unit. There are two different types of clusters – Unicast and Multicast. For the time being we will try to learn how to set up a Unicast Cluster.

  • Unicast:
  • A unicast cluster requires that you configure the IP addresses of the nodes in the cluster. If a server has multiple interfaces, use the internal IP address that allows the node to communicate directly with other nodes. Clustering across different subnets is not supported.
  • Because Mule relies on the IP address to identify the server, IP addresses can’t be dynamically assigned using DHCP for servers on a unicast cluster. If a server is restarted and uses DHCP to get a new IP address, you must add the server to the cluster using its new IP address.
  • The server status must be Running to be added to a unicast cluster.

Step 1: Ensure the below ports are opened in firewall in the participating servers:

Step 2: Check the ports open using Telnet. We have to look for all three ports i.e 5701, 5702, 5703 for both the servers. If the command prompt shows a blank screen after running the below command then it means the given port is open.

Step 3: Go to the Runtime manager and click on Servers in the appropriate Environment. And add one more server by performing all the previous steps configurations.

Step 4: Click on Create Cluster and provide the required values and click on Create Cluster at the bottom of the page.

Step 5: Verify that the cluster is created.

8. POC Deployment

Let’s try to deploy a simple project for more understanding!

Step 1: Put the jar file of the Domain Project in the domains folder of any of the mule runtime.

Step 2: Deploy the application from anypoint platform.

Step 3: You can now check the status of your application. It will be in a running state.

9. Verifying Mule Runtime Service

To Verify the status of your Mule Runtime service, check these steps:

Step 1: To check the status of mule runtime in RDP, open window services and search for Mule Enterprise Edition.

If in the Status section it is now showing Running, then start/restart the mule server. The same action can be performed for the other servers.

We use cookies on this site to enhance your user experience. For a complete overview of how we use cookies, please see our privacy policy.