MuleSoft - Mule in Our Machine



In the previous chapters, we have learnt the basics of Mule ESB. In this chapter, let us learn how to install and configure it.

Prerequisites

We need to satisfy the following prerequisites before installing Mule on our computer −

Java Development Kit (JDK)

Before installing MULE, verify that you have supported version of Java on your system. JDK 1.8.0 is recommended to successfully install Mule on your system.

Operating System

Following operating systems are supported by Mule −

  • MacOS 10.11.x
  • HP-UX 11iV3
  • AIX 7.2
  • Windows 2016 Server
  • Windows 2012 R2 Server
  • Windows 10
  • Windows 8.1
  • Solaris 11.3
  • RHEL 7
  • Ubuntu Server 18.04
  • Linux Kernel 3.13+

Database

An application server or database is not required as the Mule Runtime runs as a standalone server. But if we need to access a data store or want to use an application server, following supported application servers or databases can be used −

  • Oracle 11g
  • Oracle 12c
  • MySQL 5.5+
  • IBM DB2 10
  • PostgreSQL 9
  • Derby 10
  • Microsoft SQL Server 2014

System Requirements

Before installing Mule on your system, it must fulfil the following system requirements −

  • At least 2 GHz CPU or 1 Virtual CPU in virtualized environments
  • Minimum 1 GB RAM
  • Minimum 4 GB storage

Download Mule

To download Mule 4 binary file, click on the link https://www.mulesoft.com/lp/dl/mule-esb-enterprise and it will lead you to the official web page of MuleSoft as follows −

Download Mule

By providing the necessary details, you can get the Mule 4 binary file in Zip format.

Install and Run Mule

Now after downloading the Mule 4 binary file, unzip it and set an environment variable called MULE_HOME for the Mule directory inside the extracted folder.

For example, the environment variable, on Windows and Linux/Unix environments, can be set for version 4.1.5 in the Downloads directory as follows −

Windows Environments

$ env:MULE_HOME=C:\Downloads\mule-enterprise-standalone-4.1.5\

Unix/Linux Environments

$ export MULE_HOME=~/Downloads/mule-enterprise-standalone-4.1.5/

Now, for testing whether Mule is running in your system without any error, use the following commands −

Windows Environments

$ $MULE_HOME\bin\mule.bat

Unix/Linux Environments

$ $MULE_HOME/bin/mule

The above commands will run Mule in the foreground mode. If Mule is running, we cannot issue any other commands on the terminal. Pressing ctrl-c command in the terminal, will stop Mule.

Start Mule Services

We can start Mule as a Windows Service and as a Linux/Unix Daemon also.

Mule as a Windows Service

To run Mule as a Windows service, we need to follow the below steps −

Step 1 − First, install it with the help of following command −

$ $MULE_HOME\bin\mule.bat install

Step 2 − Once installed, we can run mule as a Windows service with the help of the following command:

$ $MULE_HOME\bin\mule.bat start

Mule as a Linux/Unix Daemon

To run Mule as a Linux/Unix Daemon, we need to follow the below steps −

Step 1 − Install it with the help of the following command −

$ $MULE_HOME/bin/mule install

Step 2 − Once installed, we can run mule as a Windows service with the help of following command −

$ $MULE_HOME/bin/mule start

Example

The following example starts Mule as a Unix Daemon −

$ $MULE_HOME/bin/mule start
MULE_HOME is set to ~/Downloads/mule-enterprise-standalone-4.1.5
MULE_BASE is set to ~/Downloads/mule-enterprise-standalone-4.1.5
Starting Mule Enterprise Edition...
Waiting for Mule Enterprise Edition.................
running: PID:87329

Deploy Mule Apps

We can deploy our Mule apps with the help of following steps −

Step 1 − First, start Mule.

Step 2 − Once Mule starts, we can deploy our Mule applications by moving our JAR package files to the apps directory in $MULE_HOME.

Stop Mule Services

We can use stop command to stop Mule. For example, the following example starts Mule as a Unix Daemon −

$ $MULE_HOME/bin/mule stop
MULE_HOME is set to /Applications/mule-enterprise-standalone-4.1.5
MULE_BASE is set to /Applications/mule-enterprise-standalone-4.1.5
Stopping Mule Enterprise Edition...
Stopped Mule Enterprise Edition.

We can also use remove command to remove the Mule Service or Daemon from our system. The following example removes Mule as a Unix Daemon −

$ $MULE_HOME/bin/mule remove
MULE_HOME is set to /Applications/mule-enterprise-standalone-4.1.5
MULE_BASE is set to /Applications/mule-enterprise-standalone-4.1.5
Detected Mac OSX:
Mule Enterprise Edition is not running.
Removing Mule Enterprise Edition daemon...
Advertisements