Description
Hi
I run zookeeper in 3 Linux Machines.
1.I downloaded zookeeper-3.4.10.jar file and extracted that.
2.I copy zoo_sample to zoo.cfg and edited datadir and added 3 ip address.
3.I created a new file called myid and insert numbers into that.
Now I am running zookeeper cluster successfully..but
When I am trying to run it as a service I am getting following error
zookeeper.service - Apache ZooKeeper
Loaded: loaded (/lib/systemd/system/zookeeper.service; disabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Wed 2017-05-03 09:56:28 IST; 1s ago
Process: 678 ExecStart=/home/melon/software/ZooKeeper/zk/bin/zkServer.sh start-foreground (code=exited
Main PID: 678 (code=exited, status=127)
May 03 09:56:28 deds14 systemd[1]: zookeeper.service: Unit entered failed state.
May 03 09:56:28 deds14 systemd[1]: zookeeper.service: Failed with result 'exit-code'.
Here the code I added
Unit]
Description=Apache ZooKeeper
After=network.target
ConditionPathExists=/home/melon/software/ZooKeeper/zookeeper-3.4.10-beta/conf/zoo.cfg
ConditionPathExists=/home/melon/software/ZooKeeper/zookeeper-3.4.10-beta/conf/log4j.properties
[Service]
Environment="ZOOCFGDIR=/home/melon/software/ZooKeeper/zookeeper-3.4.10-beta/conf"
SyslogIdentifier=zookeeper
WorkingDirectory=/home/melon/software/ZooKeeper
ExecStart=/home/melon/software/ZooKeeper/zookeeper-3.4.10-beta/bin/zkServer.sh start-foreground
Restart=on-failure
RestartSec=20
User=root
Group=root
Thank you