Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install Zookeeper on Linux

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces the relevant knowledge of "how to install Zookeeper on Linux". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Environment:

1.VMware ®Workstation 12 Pro

2.CentOS7

3.zookeeper-3.4.10 (the latest stable version at the time of this writing)

Installation steps

1. Download zookeeper

The download address of zookeeper is as follows. Friends can choose their own version of zookeeper in the first address, or you can directly click on the second address to download the zookeeper we use in this article.

1. Http://mirrors.hust.edu.cn/apache/zookeeper/

2. Http://mirrors.hust.edu.cn/apache/zookeeper/zookeeper-3.4.10/zookeeper-3.4.10.tar.gz

two。 Upload the downloaded zookeeper to the Linux server

There are a variety of upload methods. I use xftp here, and friends can also use putty to upload directly. The upload results are as follows:

3. Extract the file to the / opt directory

4. Go to the directory you just unzipped and create two folders, data and logs, as follows:

5. Make a copy of the extracted zoo_sample.cfg file in the zookeeper-3.4.10 folder and name it zoo.cfg, as follows:

6. Modify the zoo.cfg file and add the data and log directories as follows:

The 1.2888 port number is the port on which zookeeper services communicate

2.3888 is the port through which zookeeper communicates with other applications

3.initLimit: this configuration item is used to configure the Zookeeper accept client (the client here is not the client that the user connects to the Zookeeper server, but the Follower server in the Zookeeper server cluster that connects to the Leader) the maximum number of heartbeat intervals that can be tolerated when initializing the connection. When the Zookeeper server has not received a return message from the client after the length of more than 10 heartbeats (that is, tickTime), the client connection failed. The total length of time is 52000 to 10 seconds.

4.syncLimit: this configuration item identifies the length of time for sending messages, requests and replies between Leader and Follower. The maximum length of time cannot exceed the number of tickTime. The total length of time is 22,000 seconds.

5.server.A=B:C:D: where An is a number indicating which server this is; B is the IP address of this server or the hostname of IP mapped in the / etc/hosts file; C represents the port on which this server exchanges information with the Leader servers in the cluster D means that in case the Leader server in the cluster dies, a port is needed for re-election to select a new Leader, and this port is the port through which the servers communicate with each other during the election. If it is a pseudo-cluster configuration, because B is all the same, the communication port numbers of different Zookeeper instances cannot be the same, so they should be assigned different port numbers.

7. Create a myid file under dataDir=/opt/zookeeper-3.4.10/data and edit the myid file, and enter the corresponding number on the corresponding IP machine. On zookeeper, the content of the myid file is 1. If you only install and configure at a single point, there is only one server.1. As follows:

8. Add the zookeeper configuration to the .bash _ profile file:

9. Make the configuration effective

10. Turn off the firewall

11. Start and test

If you can see the Mode:standalone after startup, it means that the startup is successful.

twelve。 Close zookeeper

13. Configure Boot boot zookeeper

Note that in centos7, the permissions of / etc/rc.local are reduced, so you need to execute the following command to give it executable permissions

Chmod + x / etc/rc.d/rc.local

That's all for "how to install Zookeeper on Linux". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

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.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report