Created
June 2, 2017 10:56
-
-
Save martinhynar/286dee76f4a5f3881f0ebcf711fea52f to your computer and use it in GitHub Desktop.
ZooKeeper SystemD Service Unit File
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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 |
ExecStart=/opt/zookeeper/bin/zkServer.sh start-foreground /opt/zookeeper/conf/zookeeper.conf
ExecStart=/opt/zookeeper/bin/zkServer.sh start-foreground /opt/zookeeper/conf/zookeeper.conf
How does that help, and does it play nice with restart?
Usage: /usr/zookeeper/default/bin/zkServer.sh [--config <conf-dir>] {start|start-foreground|stop|restart|status|print-cmd}
ExecStart=/opt/zookeeper/bin/zkServer.sh --config /etc/opt/zookeeper start-foreground
ExecStop=/opt/zookeeper/bin/zkServer.sh --config /etc/opt/zookeeper stop
ExecReload=/opt/zookeeper/bin/zkServer.sh --config /etc/opt/zookeeper restart
WorkingDirectory=/var/lib/zookeeper
Is it a good idea to add ROLLINGFILE log level here?
log4j.properies is ignored always https://issues.apache.org/jira/browse/ZOOKEEPER-2170
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
this is just reusing the shell script