Skip to content

Instantly share code, notes, and snippets.

@martinhynar
Created June 2, 2017 10:56
Show Gist options
  • Save martinhynar/286dee76f4a5f3881f0ebcf711fea52f to your computer and use it in GitHub Desktop.
Save martinhynar/286dee76f4a5f3881f0ebcf711fea52f to your computer and use it in GitHub Desktop.
ZooKeeper SystemD Service Unit File
[Unit]
Description=ZooKeeper Service
Documentation=http://zookeeper.apache.org
Requires=network.target
After=network.target
[Service]
Type=forking
User=zookeeper
Group=zookeeper
ExecStart=/opt/zookeeper/bin/zkServer.sh start /opt/zookeeper/conf/zookeeper.conf
ExecStop=/opt/zookeeper/bin/zkServer.sh stop /opt/zookeeper/conf/zookeeper.conf
ExecReload=/opt/zookeeper/bin/zkServer.sh restart /opt/zookeeper/conf/zookeeper.conf
WorkingDirectory=/var/lib/zookeeper
[Install]
WantedBy=default.target
@Nurlan199206
Copy link

mine working config file

[Unit]
Description=Zookeeper Daemon
Documentation=http://zookeeper.apache.org
Requires=network.target
After=network.target

[Service]    
Type=forking
WorkingDirectory=/opt/zookeeper
User=root
Group=root
ExecStart=/opt/zookeeper/bin/zkServer.sh start /opt/zookeeper/conf/zoo.cfg
ExecStop=/opt/zookeeper/bin/zkServer.sh stop /opt/zookeeper/conf/zoo.cfg
ExecReload=/opt/zookeeper/bin/zkServer.sh restart /opt/zookeeper/conf/zoo.cfg
TimeoutSec=30
Restart=on-failure

[Install]
WantedBy=default.target

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