Skip to content

Instantly share code, notes, and snippets.

Last active Sep 29, 2015
What would you like to do?
Install zookeeper on illumos and supervise it using SMF

Two interesting findings:

  • A utility called manifold that helps creating SMF manifest;
  • An annoying platform compatibility issue in zookeeper startup script.

Fist, install zookeeper:

$ wget -c
$ tar xvzf zookeeper-3.3.4.tar.gz
$ ln -s zookeeper-3.3.4 zookeeper
$ cd zookeeper
$ cp conf/zoo_sample.cfg conf/zoo.cfg
$ mkdir var
$ vim conf/zoo.cfg

My zookeeper configuration file is very simple:


There seems to be a small platform compatibility issue in bin/ Its line 103 reads:

if /bin/echo -n $! > "$ZOOPIDFILE"

On my illumos 151_a, the default echo ia actually /usr/gnu/bin/echo, not /bin/echo. And /bin/echo doesn't know option -n. Pid file ends up like -n 12345, not just 12345, which makes bin/ stop not able to stop zookeeper process properly.

Since I set up this illumos machine for hacking on its kernel (hopefully), it already has python installed (mercurial needs it). So next step only involves installing easy_install, then manifold:

$ sudo pkg install pkg:/library/python-2/setuptools-26
(according to, one should use pip, not easy_install)
$ sudo easy_install pip
$ sudo pip install Manifold
$ manifold zookeeper.xml
$ svccfg validate zookeeper.xml
$ sudo svccfg import zookeeper.xml
$ svcs zookeeper
STATE          STIME    FMRI
disabled        2:12:14 svc:/site/zookeeper:default
$ sudo svcadm enable zookeeper
$ svcs zookeeper
STATE          STIME    FMRI
online          2:13:40 svc:/site/zookeeper:default
Copy link

mtzaurus commented Jan 30, 2013

s/sudo pip Manifold/sudo pip install Manifold/

Copy link

edwardw commented Oct 24, 2013

Indeed! Fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment