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
The installation tutorial of MySQL 5.7.19 winx64 ...
Introduction: This article mainly introduces how ...
Preface In a relatively complex large system, if ...
As we all know, the web pages, websites or web pag...
Table of contents Causes of MySQL Table Fragmenta...
Table of contents Basic Selector Extensions Attri...
1. Download the virtual machine version 15.5.1 I ...
The project requirements are: select date and tim...
Table of contents Preface: 1. Introduction to Nav...
This article shares the specific code of Vue.js t...
With the popularization of 3G, more and more peop...
Some MySQL tables may contain duplicate records. ...
Today I will share with you a good-looking counte...
When making some pages, in order to make the page...
MariaDB is installed by default in CentOS, which ...