How to get Mule ESB going on a Raspberry Pi 2

By | September 10, 2015

I was interested in putting Mule ESB on my Raspberry Pi 2 but couldn’t find any detailed notes around how to do this.

It was this article which sparked my interest (http://blogs.mulesoft.com/biz/news/raspberry-pi-gets-an-api/) but this talked about a product called “Anypoint Edge” which I couldn’t find any information on.

There were some notes on this post: http://forums.mulesoft.com/questions/989/raspberry-i.html which to a newbie was pretty cryptic at first.

And this tweet here by @keaton_victor.

keaton

So I set about giving it a go. Here is what I did.

Step 1: Download Mule Enterprise Edition

Download mule-ee-distribution-standalone-3.7.1.tar.gz to the pi. I actually downloaded it via a browser and then secure copied it to my pi. In Ubuntu I ran:

scp mule-ee-distribution-standalone-3.7.1.tar.gz pi@192.168.1.15:/home/pi/mule

Step 2: Unzip Mule

SSH to the Pi and unzip the file.

tar -xvzf mule-ee-distribution-standalone-3.7.1.tar.gz

Step 3: Download Java Wrapper

Go to: http://wrapper.tanukisoftware.com/doc/english/download.jsp and download the latest version of Linux armhf Community Edition. For me it was 3.5.27.

To figure out if your Pi device is running armhf or armel run this bodacious command:

readelf -A /proc/self/exe | grep Tag_ABI_VFP_args

If the Tag_ABI_VFP_args tag is found, then you’re running on an armhf system.  If nothing is returned, then it’s armel.

Step 4: Find wrapper.conf

Grab ~wrapper-linux-armhf-32-3.5.27/conf/wrapper.conf and copy to ~mule-enterprise-standalone-3.7.1/lib/boot

What does the Java Service Wrapper do? From the README_en.txt file

The Java Service Wrapper is an application which has evolved out of a desire 
to solve a number of problems common to many Java applications. Some of the Wrapper's features are:
 * Run a Java application as a Windows Service or Unix Daemon
 * Java Application Reliability
 * Automatic Crash, Freeze, and Deadlock Detection and Recovery
 * On Demand Restarts
 * Standard, Out of the Box Scripting
 * Flexible Cross Platform Configuration
 * Ease Application Installations
 * Logging
 * Many more...
See our download page for a more detailed feature list. => http://wrapper.tanukisoftware.com/doc/english/download.jsp

Step 5: Start Mule

Run (assuming you are in mule-enterprise-standalone-3.7.1 directory) :

./bin/mule

Results:

Now you should see:

mule up in pi

To test this out, take this helloworld project (helloworld) and place it in the apps folder and in your browser open up http://192.168.1.15:8081/hi (replace with your IP address) and you should see:

hiw

Troubleshooting

If you get Permission denied error:

Caught: java.io.FileNotFoundException: /home/pi/mule/mule-enterprise-standalone-3.7.1/conf/wrapper-additional.conf (Permission denied)
java.io.FileNotFoundException: /home/pi/mule/mule-enterprise-standalone-3.7.1/conf/wrapper-additional.conf (Permission denied)
 at additional.run(additional.groovy:27)

add “sudo” in front of the command

If you get insufficient memory error:

Launching a JVM...
Java HotSpot(TM) Client VM warning: ignoring option PermSize=256m; support was removed in 8.0
Java HotSpot(TM) Client VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
Java HotSpot(TM) Client VM warning: Using the ParNew young collector with the Serial old collector is deprecated and will likely be removed in a future release
Java HotSpot(TM) Client VM warning: INFO: os::commit_memory(0x53e00000, 536870912, 0) failed; error='Cannot allocate memory' (errno=12)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 536870912 bytes for committing reserved memory.
# An error report file with more information is saved as:
# /home/pi/mule/mule-enterprise-standalone-3.7.1/hs_err_pid2996.log

Trying decreasing the Java Heap Size in conf/wrapper.conf

heapsizeThis idea came thanks to Aaron Weikle who noted “Also you can modify the memory size in the wrapper.conf to fit for a micro instance as well.” This was in relation to https://www.linkedin.com/grp/post/6936034-6046034101792759808

 

 

5 thoughts on “How to get Mule ESB going on a Raspberry Pi 2

  1. Matheus

    Hi there,

    Great article, thanks for posting.

    However I am still having the issues. After download the armhf wrapper from Taniku Software and place the wrapper.conf into /lib/boot, I tried to start Mule. I still see the same warning message saying that armhf architecture detected but not supported and that it will use armel. Then the whole thing fails for the issue with insufficient memory.

    Any ideas? I am wondering if after download the wrapper I need to change anything on it.

    Reply
    1. cloudnthings Post author

      Hi Matheus,
      Sorry, your comment got buried in all the spam that came through. After you download the wrapper you need to adjust the memory. Did you try decreasing Java heap size? (the last paragraph in post above).

      Reply
  2. Philip Gerald Taylor

    Works great thanks!

    Definitely need to reduce mem but runs OK in 256 even.

    /hi just gives me 404 remotely but can Curl locally just fine

    Reply
  3. Philip Gerald Taylor

    lol – wrong host (I have a cluster of 6)

    works perfectly!!!

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *