Saturday, 29 August 2015

How to install Mule in AWS

This was an interesting challenge and one where I couldn't find step by step instructions on Google or the Mulesoft website. So I ended up trying this myself and hope this is useful for others.
Prerequisite:
- Access to AWS EC2 environment.

Step 1: Create a new instance

Launch a new Ubuntu instance.
step1
Choose at least t2.small or above because you need at least 2Gb of RAM.
Then click Review and Launch >> Launch
step2
If you choose t2.micro or anything with less RAM, you'll get this error:
insufficient_memory
ie Mulesoft There is insufficient memory for the Java Runtime Environment to continue. error'=Cannot allocate memory'

Step 2: Connect to your instance.

You will have had to create some keys to allow you to connect to the instance via command line. See this link here if you need a refresher. http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstancesLinux.html
To connect, use this format
ssh -i /path/to/cert  ubuntu@ec2-xxx-xxx-xxx-xxx.compute-1.amazonaws.com
The command I used to connect to my instance was:
>> ssh -i muledemo.pem ubuntu@ec2-52-20-212-212.compute-1.amazonaws.com
Now you are in a basic Ubuntu environment where you can now start to install Mule.
step3

Step 3: Install Mule

>> mkdir mule (create a directory)
>> cd mule (go into the directory)
>> wget http://s3.amazonaws.com/70aaf9be67f9bf88e5e78adcd7d6aa34/mule-ee-distribution-standalone-3.7.1.tar.gz (download Mule EE)
>> tar -xvzf mule-ee-distribution-standalone-3.7.1.tar.gz (extract the file)
Now we can try and start it by running:
>> ./mule-enterprise-standalone-3.7.1/bin/mule
You should get this error:
error_no_java
ie Mule: ERROR: java could not be found. PLease install the JRE or JDK
This is a good sign.

Step 4: Install Java

To get rid of this we need to install Java. Run these commands:
>> sudo add-apt-repository ppa:webupd8team/java
>> sudo apt-get update
>> sudo apt-get install oracle-java8-installer
Now if you run
>> java -version
you should get:
step4
Now try to run mule again by typing
>> ./mule-enterprise-standalone-3.7.1/bin/mule
and you should get:
step5
Congratulations! You now have Mule up and running.

First posted at: http://www.anintegratedworld.com/how-to-install-mule-in-aws/

No comments:

Post a Comment