On 3/14/2018 12:24 PM, Scott Prentice wrote:
> We might be going at this wrong, but we've got Solr set up as a
> service, so if the machine goes down it'll restart. But without
> Zookeeper running as a service, that's not much help.

You're probably going to be very unhappy to be told this ... but
ZooKeeper is a completely separate Apache project.  This mailing list
handles Solr.  While SolrCloud does require ZK, setting it up is outside
the scope of this mailing list.

I can tell you what I did to get it running as a service on CentOS 6. 
It works, but it's not very robust, and if you ask the zookeeper user
mailing list, they may have better options.  I do strongly recommend
that you ask that mailing list.

---------------------

I extracted the .tar.gz file to the "/opt" folder.  Then I renamed the
zookeeper-X.Y.Z directory to something else.  I used "mbzoo" ... which
only makes sense if you're familiar with our locally developed software.

Next I created a very small shell script, and saved it as
/usr/local/sbin/zkrun (script is below between the lines of equal signs):

=====
#!/bin/sh

# chkconfig: - 75 50
# description: Starts and stops ZK

cd /opt/mbzoo
bin/zkServer.sh $1
=====

I made that script executable and created a symlink for init.d:

chown +x /usr/local/sbin/zkrun
ln -s /usr/local/sbin/zkrun /etc/init.d/zookeeper

Then all I had to do was activate the init script:

chkconfig --add zookeeper
chkconfig zookeeper on

Once that's done, a "service zookeeper start" command should work.

On debian/ubuntu/mint and similar distros, you'd probably use
update-rc.d instead of chkconfig, with different options.  If you're on
an OS other than Linux, everything I've described might need changes.

If you're on Windows, chances are that you'll end up using a program
named NSSM.  If you can get your company to accept using it once they
find out the FULL program name.

Thanks,
Shawn

Reply via email to