Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install zookeeper as service on CentOS 7

I am trying to install zookeeper on CentOS 7 using yum install zookeeper or yum install zookeeperd but it throws: There is no zookeeper package available.

like image 912
Asier Gomez Avatar asked Jan 12 '17 10:01

Asier Gomez


People also ask

How do I start ZooKeeper on Linux?

To start the ZooKeeper server on a Linux system, use the Zookeeper/zookeeper/bin/zkServer.sh restart command from your Watson Explorer installation directory. On Microsoft Windows systems, use the Zookeeper\zookeeper\bin\zkServer.

How do you restart a ZooKeeper server?

Stop the ZooKeeper service using systemctl . Finally, to restart the daemon, use the following command: sudo systemctl restart zk.


1 Answers

An alternative answer if you don't want to install a 3rd party repo from cloudera you could use the Apache Bigtop repo. Apache being the actual maintainer of Zookeeper.

As of writing it's this repo file on CentOS 7.

This will let you install Zookeeper by simply running yum install zookeeper.

Unfortunately that package does not include a systemd service file so I had to write my own, but that's not very hard.

[Unit]
Description=Zookeeper
After=syslog.target

[Service]
SyslogIdentifier=zookeeper
TimeoutStartSec=10min
Type=forking
ExecStart=/usr/lib/zookeeper/bin/zkServer.sh start
ExecStop=/usr/lib/zookeeper/bin/zkServer.sh stop

[Install]
WantedBy=multi-user.target
like image 149
Stefan Midjich Avatar answered Sep 26 '22 00:09

Stefan Midjich