1. Create the /usr/local/services/zookeeper folder: mkdir -p /usr/local/services/zookeeper 2. Enter the /usr/local/services/zookeeper directory: cd /usr/local/services/zookeeper 3. Download zookeeper-3.4.9.tar.gz: wget https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/zookeeper-3.4.9/zookeeper-3.4.9.tar.gz 4. Unzip zookeeper-3.4.9.tar.gz: tar -zxvf zookeeper-3.4.9.tar.gz 5. Enter the /usr/local/services/zookeeper/zookeeper-3.4.9/conf directory: cd zookeeper-3.4.9/conf/ 6. Copy the zoo_sample.cfg file and name it zoo.cfg: cp zoo_sample.cfg zoo.cfg 7. Use vim to open the zoo.cfg file and modify its content as follows: # The number of milliseconds of each tick # The benchmark time interval defined by zookeeper, unit: milliseconds tickTime=2000 # The number of ticks that the initial # synchronization phase can take initLimit=10 # The number of ticks that can pass between # sending a request and getting an acknowledgement syncLimit=5 # the directory where the snapshot is stored. # do not use /tmp for storage, /tmp here is just # example sakes. # dataDir=/tmp/zookeeper #Data folder dataDir=/usr/local/services/zookeeper/zookeeper-3.4.9/data # Log folder dataLogDir=/usr/local/services/zookeeper/zookeeper-3.4.9/logs # the port at which the clients will connect # The port number for the client to access zookeeper is clientPort=2181 # the maximum number of client connections. # increase this if you need to handle more clients #maxClientCnxns=60 # # Be sure to read the maintenance section of the # administrator guide before turning on autopurge. # # http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance # # The number of snapshots to retain in dataDir #autopurge.snapRetainCount=3 # Purge task interval in hours # Set to "0" to disable auto purge feature #autopurge.purgeInterval=1 8. Save and close the zoo.cfg file: 9. Enter the /usr/local/services/zookeeper/zookeeper-3.4.9/bin directory: 10. Use vim to open the profile configuration file in the /etc/ directory: And append the following content at the end: # idea - zookeeper-3.4.9 config start - 2016-09-08 export ZOOKEEPER_HOME=/usr/local/services/zookeeper/zookeeper-3.4.9/ export PATH=$ZOOKEEPER_HOME/bin:$PATH export PATH # idea - zookeeper-3.4.9 config start - 2016-09-08 11. Make the profile file in the /etc/ directory effective: source /etc/profile 12. Start the zookeeper service: zkServer.sh start If the following information is printed, it indicates that the startup is successful: ZooKeeper JMX enabled by default Using config: /usr/local/services/zookeeper/zookeeper-3.4.9/bin/../conf/zoo.cfg Starting zookeeper ... STARTED 13. Query the zookeeper status: zkServer.sh status 14. Shut down the zookeeper service: zkServer.sh stop If the following information is printed, it indicates successful closure: ZooKeeper JMX enabled by default Using config: /usr/local/services/zookeeper/zookeeper-3.4.9/bin/../conf/zoo.cfg Stopping zookeeper ... STOPPED 15. Restart the zookeeper service: zkServer.sh restart If the following information is printed, it indicates that the restart is successful: ZooKeeper JMX enabled by default Using config: /usr/local/services/zookeeper/zookeeper-3.4.9/bin/../conf/zoo.cfg ZooKeeper JMX enabled by default Using config: /usr/local/services/zookeeper/zookeeper-3.4.9/bin/../conf/zoo.cfg Stopping zookeeper ... STOPPED ZooKeeper JMX enabled by default Using config: /usr/local/services/zookeeper/zookeeper-3.4.9/bin/../conf/zoo.cfg Starting zookeeper ... STARTED Summarize The above is the introduction of installing Zookeeper service in Linux. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: MySQL InnoDB monitoring (system layer, database layer)
>>: JavaScript to achieve a simple page countdown
Table of contents 1. What is two-way data binding...
one. Why build a Nexus private server? All develo...
Table of contents Understanding Prototypes Unders...
This article describes how to compile and install...
We often need to control the hidden, transparent ...
This article explains how to install MySQL from a...
In our daily work, we often come into contact wit...
Application example website http://www.uhuigou.net...
The following functions are implemented: 1. Usern...
Table of contents 1minio is simple 2 Docker build...
Today we are going to create a simple heartbeat e...
MySQL installation is relatively simple, usually ...
1. The first parameter props of the setUp functio...
Table of contents 1. Realistic Background 2. Agre...
This article example shares the specific code of ...