Blog Post

Running Membase on OpenSolaris

Trond Norbye of Couchbase Published

I've been wanting to run Membase on my OpenSolaris server for a long time, but I haven't had the time to look into all of the details on getting it there. All of the command line tools compile and works perfectly well on OpenSolaris already, but I haven't been able to get the web ui and cluster management up and running. One of the bugs preventing an easy install of Membase on OpenSolaris (and other unsupported platforms) is that the makefile for the admin ui don't have an install target (This is tracked in MB-2700 ).

Earlier today I cloned the layout of the web application on disk from the Ubuntu installation to my OpenSolaris box, and with some work I was able to get the system up and running on my OpenSolaris box. Just check it out:
 

trond@storm> <b>svcs membase</b>
STATE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; STIME&nbsp;&nbsp;&nbsp; FMRI
online&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 13:37:26 svc:/application/database/membase:membase

So let's assume you've got all of the dependencies you need to build Membase installed on your OpenSolaris (I'll come up with this list later on and create an IPS package for you to install from my IPS server).

Due to MB-3227 we can't use the build method outlined in "Building on OSX from source" to build membase, but I've updated my build environment I blogged about a while ago so that it will build and install everything for you! So let's go ahead and build the stuff!

trond@storm> <b>git clone git://github.com/trondn/tools.git</b>
Initialized empty Git repository in /tmp/tools/.git/
remote: Counting objects: 168, done.
remote: Compressing objects: 100% (163/163), done.
remote: Total 168 (delta 89), reused 0 (delta 0)
Receiving objects: 100% (168/168), 157.56 KiB | 231 KiB/s, done.
Resolving deltas: 100% (89/89), done.
trond@storm> <b>cd tools/membase/smf/membase</b>
trond@storm> <b>./setup -u -s -z scratch</b>               (scratch is the name of my zfs pool)
trond@storm> <b>cd ../..</b>
trond@storm> <b>chown -R trond:staff /opt/membase</b>
trond@storm> <b>./setup.sh -d /opt/membase/dev membase</b>
Download commit hook - Ok.
Checking out libmemcached (Bazaar) - Ok.
Checking out bucket_engine (git) - Ok.
Checking out ep-engine (git) - Ok.
Checking out libconflate (git) - Ok.
Checking out libvbucket (git) - Ok.
Checking out memcached (git) - Ok.
Checking out moxi (git) - Ok.
Checking out vbucketmigrator (git) - Ok.
Checking out membase-cli (git) - Ok.
Checking out ns_server (git) - Ok.
Checking out memcachetest (git) - Ok.
Checking out mc-hammer (git) - Ok.
Checking out libmembase (git) - Ok.
Configure build for SunOS
trond@storm> <b>cd membase</b>
trond@storm> <b>gmake install</b>

Due to MB-2926 we need to change the file layout to move the files so that management process in membase can locate the tools. In theory we shouldn't need to create links for the libraries as well (because the runtime path of the binary should pick up the correct one), but unfortunately ns_server use the absolute path for the library. 

trond@storm> <b>cd /opt/membase/bin/dev</b>
trond@storm> <b>rm memcached vbucketmigrator moxi</b>
trond@storm> <b>mkdir memcached vbucketmigrator moxi bucket_engine ep_engine</b>
trond@storm> <b>cd memcached</b>
trond@storm> <b>ln -s ../amd64/memcached</b>
trond@storm> <b>ln -s ../../lib/amd64/default_engine.so</b>
trond@storm> <b>ln -s ../../lib/amd64/stdin_term_handler.so</b>
trond@storm> <b>cd ../vbucketmigrator</b>
trond@storm> <b>ln -s ../amd64/vbucketmigrator</b>
trond@storm> <b>cd ../moxi</b>
trond@storm> <b>ln -s ../amd64/moxi</b>
trond@storm> <b>cd ../bucket_engine</b>
trond@storm> <b>ln -s ../../lib/amd64/bucket_engine.so</b>
trond@storm> <b>cd ../ep_engine</b>
trond@storm> <b>ln -s ../../lib/amd64/ep.so</b>
trond@storm> <b>chown -R membase:membase /opt/membase</b>

So let's go ahead and start the service by running: 

trond@storm> <b>svcadm enable membase</b>

And navigate your browser to http://localhost:8091/ and start configuring your server. I was able to let my OpenSolaris server join my Ubuntu cluster.

Happy holidays!