I tried it, so a memo
CentOS7 Java installed
Download the tar file
# curl -LkvOf https://downloads.apache.org/zookeeper/zookeeper-3.6.0/apache-zookeeper-3.6.0-bin.tar.gz
Extract the tar file
# tar zxf apache-zookeeper-3.6.0-bin.tar.gz
Place under / opt
# mv apache-zookeeper-3.6.0-bin /opt/zookeeper
Create a running user
# useradd zookeeper
Create a zoo.cfg
file and change the settings as needed (IP address, etc.)
Change owner
# chown -R zookeeper:zookeeper /opt/zookeeper
Create a service file
# vi /etc/systemd/system/zookeeper.service
[Unit]
Description=Apache Zookeeper Service
[Service]
Type=forking
User=zookeeper
ExecStart=/opt/zookeeper/bin/zkServer.sh start
ExecStop=/opt/zookeeper/bin/zkServer.sh stop
[Install]
WantedBy=multi-user.target
Reload
# systemctl daemon-reload
Start
# systemctl start zookeeper
Recommended Posts