In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to install zookeeper in Linux system, which is very detailed and has certain reference value. Friends who are interested must finish it!
Introduction to zookeeper: Zookeeper is an open source distributed coordination service. The design goal of Zookeeper is to encapsulate those complex and error-prone distributed consistency to form an efficient and reliable set of primitives, and provide users with a series of easy-to-use interfaces.
Zookeeper is a typical distributed data consistency solution. Distributed applications can implement functions such as data publish / subscribe, load balancing, naming service, distributed coordination / notification, cluster management, Master election, distributed locking and distributed queue based on Zookeeper.
Linux system installation zookeeper detailed steps: 1, download. Http://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/
Choose the version you want to install. I use http://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/zookeeper-3.3.6/ here.
2. Put it on linux and unzip it to your target directory.
The command is: tar-xzvf file directory-C target directory. As shown below:
3. Configuration.
First come to your installation location, and cd go in. List all files. As shown below:
There are bin directory and conf directory as well as some jar and so on.
Bin is the folder for the execution file, and conf is the folder for the configuration file.
Let's talk about configuration here. Let's see what kind of ghosts are in conf.
We see a log4j log file and a zoo_sample file. Zoo_sample is the configuration template, so let's use the template as a reference for our configuration. Directly copy one, the name is zoo.fg.
Here I have authorized this zoo.cfg file, whether you want to authorize it or not according to your own needs.
Let's open the zoo.cfg and see what's inside. Execute the command: vi zoo.cfg, and the result is as follows:
Let's analyze what these parameters represent.
TickTime: heartbeat configuration (in milliseconds). Two heartbeats fail to down.
InitLimit: how many heartbeats after allowing other server initialization.
SyncLimit: within how many tickTime, follower synchronization is allowed. If the follower lags too far behind, it will be discarded.
DataDir
The folder where the in-memory database snapshots are stored, as well as the myid files for the cluster. (note: a configuration file can only contain one dataDir, even if it is commented out. )
ClientPort=2181 # service listening port, which can be modified as needed
For the meaning of all the parameters, please refer to the official documentation or find a link: http://blog.sina.com.cn/s/blog_a577cd8a01014whx.html
Here, I put the data directory in the zk-data folder under my apps directory, and save and exit after modification:
Note: you can also configure clusters through the server parameter (which is not explained in detail here), as follows:
Server.1=192.168.18.102:2888:3888
Server.2=192.168.18.103:2888:3888
Server.3=192.168.18.104:2888:3888
4. Start (the fruit of the acceptance result)
We go to the bin directory and start (boot is start, restart is restart,status depends on status, startup client is zkCli.sh-server 127.0.0.1 restart,status 2181 this is the ip and port of service server)
Let's start the client and try server.
The client connects successfully, which proves that the server is correct.
The above is all the contents of the article "how to install zookeeper in Linux system". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.