In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to install ZooKeeper distributed cluster under Linux. It is very detailed and has a certain reference value. Interested friends must read it!
ZooKeeper means zoo keeper, it is used to manage Hadoop (elephant), Hive (bee), pig (pig) administrator, Apache Hbase, Apache Solr, Dubbo all use ZooKeeper, in fact, it is a cluster management tool, is the entrance to the cluster. ZooKeeper is a distributed, open source program coordination service, which is a sub-project of the Hadoop project. The main application scenarios of ZooKeeper include cluster management (master-slave management, load balancing, highly available management), centralized management of configuration files, distributed locks, registry, etc. In actual projects, in order to ensure high availability, ZooKeeper is installed in a distributed cluster, requiring at least three nodes. Let's take a look at the details below.
Here Linux chooses CentOS 7.2.
# wget-P / usr/local http://mirror.bit.edu.cn/apache/zookeeper/zookeeper-3.4.10/zookeeper-3.4.10.tar.gz# cd / usr/local# tar-zxvf zookeeper-3.4.10.tar.gz# cd zookeeper-3.4.10# mkdir data# mkdir logs# vim / etc/rc.d/rc.local / / configuration enable self-startup
You can add the following configuration:
Export JAVA_HOME=/usr/java/jdk/usr/local/zookeeper-3.4.10/bin/zkServer.sh start
We deployed a ZooKeeper process on each of the three different servers to form a ZooKeeper cluster. All three ZooKeeper processes use the same zoo.cfg configuration:
# cd / usr/local/zookeeper-3.4.10/conf# cp zoo_sample.cfg zoo.cfg / / copy configuration file # vim zoo.cfg
Modify the configuration as follows:
# configure the directory where snapshot files are stored, the TCP port that the dataDir=/usr/local/zookeeper-3.4.10/datadataLogDir=/usr/local/zookeeper-3.4.10/logs# zk service process listens on, and the port for communication between clientPort=2181# 2888:ZooKeeper services Port # server.1 on which 3888:ZooKeeper communicates with other applications: indicates which server server.1=192.168.20.11:2888:3888server.2=192.168.20.12:2888:3888server.3=192.168.20.13:2888:3888 this is
Then, under the dataDir directory of the three servers, create a myid file with the contents of 1pm / 2pm / 3 respectively. Then start the ZooKeeper process on each of these three machines, so that we start the ZooKeeper cluster. As follows:
# cd / usr/local/zookeeper-3.4.10/data# echo 1 > > myid / / create a myid file and write to / usr/local/zookeeper-3.4.10/bin/zkServer.sh start / / launch ZooKeeper in the background
There are other commands as follows:
# / usr/local/zookeeper-3.4.10/bin/zkServer.sh stop / / close ZooKeeper# / usr/local/zookeeper-3.4.10/bin/zkServer.sh status / / check the service status # / usr/local/zookeeper-3.4.10/bin/zkServer.sh start-foreground / / the foreground startup is all the contents of the article "how to install ZooKeeper distributed clusters under Linux". 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.