[Unit] Description=auto run zk server After=network.target [Service] Type=simple Environment=ZHOME=/usr/local/zookeeper-3.4.11 #ExecStart=/usr/local/zookeeper-3.4.11/bin/zkServer.sh start #ExecStop=/usr/local/zookeeper-3.4.11/bin/zkServer.sh stop #ExecReload=/usr/local/zookeeper-3.4.11/bin/zkServer.sh restart SyslogIdentifier=zookeeper ExecStart=/usr/bin/java \ -Dzookeeper.log.dir=${ZHOME}/logs/zookeeper.log \ -Dzookeeper.root.logger=INFO,ROLLINGFILE \ -cp ${ZHOME}/zookeeper-3.4.11.jar:${ZHOME}/lib/* \ -Dlog4j.configuration=file:${ZHOME}/conf/log4j.properties \ -Dcom.sun.management.jmxremote \ -Dcom.sun.management.jmxremote.local.only=false \ org.apache.zookeeper.server.quorum.QuorumPeerMain \ ${ZHOME}/conf/zoo.cfg [Install] WantedBy=multi-user.target