Installing zookeeper is very simple, first go to download zookeeper itself: zookeeper Tsinghua mirror

mkdir ~/Download
cd ~/Download
wget https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/zookeeper-3.7.0/apache-zookeeper-3.7.0-bin.tar.gz

Oh, by the way, after downloading, a very tangled place is where to install it? System path or user path?
Obviously you read this article not for online deployment, but for development, testing, learning, etc., so install it to the user path

cd ~
mkdir opt
cd Download
mv apache-zookeeper-3.7.0-bin ~/opt
mv apache-zookeeper-3.7.0-bin zookeeper
cd zookeeper

Configure it before starting zookeeper it will not run without configuration

mkdir data # 非必要操纵
cd conf
mv zoo_sample.cfg zoo.cfg # 必要操作
vim zoo.cfg # 非必要操纵

datadir to
dataDir=/home/bot/opt/zookeeper/data

Change the path to your own

Okay, why do you want to configure it? Because zookeeper need to start conf/zoo.cfg this file.

Start zookeeper now

cd ~/opt/zookeeper/
cd bin
./zkServer.sh start

universe_king
3.4k 声望680 粉丝