1. 程式人生 > >【zookeeper】簡單安裝

【zookeeper】簡單安裝

zookeeper

1.安裝java

#!/bin/bash
# rpm -ivh jdk-8u144-linux-x64.rpm
# java -version
java version "1.8.0_144"


2.安裝zookeeper

下載地址 : http://zookeeper.apache.org/releases.html

tar zxvf zookeeper-3.4.10.tar.gz
mv  zookeeper-3.4.10 /usr/local/zookeeper
cd /usr/local/zookeeper
mkdir data
cd /usr/local/zookeeper/conf
cp -a zoo_sample.cfg zoo.cfg 
vim zoo.cfg
----------------
tickTime=2000
initLimit=10
syncLimit=5
dataDir=/usr/local/zookeeper/data
clientPort=2181
----------------

/usr/local/zookeeper/bin/zkServer.sh stop  # 停止ZooKeeper服務器
/usr/local/zookeeper/bin/zkServer.sh start # 啟動ZooKeeper服務器
----------------
ZooKeeper JMX enabled by default
Using config: /usr/local/zookeeper/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
----------------

/usr/local/zookeeper/bin/zkCli.sh        # 啟動CLI,輸入上面的命令後,您將被連接到zookeeper服務器
[zk: localhost:2181(CONNECTED) 0] h  # 輸入h,進入幫助
[zk: localhost:2181(CONNECTED) 3] quit











【zookeeper】簡單安裝