1. 程式人生 > 其它 >zookeeper安裝3.6.2

zookeeper安裝3.6.2

技術標籤:javazookeeperlinuxcentos

zookeeper安裝

zookeeper是基於jdk的,環境要有jdk

檢視是否已安裝

[[email protected] src]# java -version  
// 已安裝
openjdk version "1.8.0_102"
OpenJDK Runtime Environment (build 1.8.0_102-b14)
OpenJDK 64-Bit Server VM (build 25.102-b14, mixed mode)  

下載zookeeper

https://ftp.jaist.ac
.jp/pub/apache/zookeeper/zookeeper-3.6.2/apache-zookeeper-3.6.2-bin.tar.gz

解壓

tar -xzvf apache-zookeeper-3.6.2-bin.tar.gz

進入apache-zookeeper-3.6.2-bin建立data檔案

cd apache-zookeeper-3.6.2-bin
mkdir data

進入conf配置目錄,複製zoo_sample.cfg 命名zoo.cfg

cp zoo_sample.cfg zoo.cfg

通過vim修改zoo.cfg的dateDri。此路徑用於儲存zookeeper中資料的記憶體快照、及事物日誌檔案

在這裡插入圖片描述
進入zookeeper的bin目錄,啟動zookeeper

./zkServer.sh start

關閉

./zkServer.sh stop

檢視狀態

root 22:02:31 /src/apache-zookeeper-3.6.2-bin/bin
$ ./zkServer.sh status
# 出現下面資訊啟動成功
/usr/bin/java
ZooKeeper JMX enabled by default
Using config: /src/apache-zookeeper-3.6.2-bin/bin/../conf/zoo.cfg
Client port found: 2181. Client address: localhost.
Client SSL: false. Mode: standalone

Love code but not life