您好,登錄后才能下訂單哦!
1.關閉防火墻
systemctl stop firewalld.service systemctl disable firewalld.service
2.安裝java
# 卸載已有的jdk java -version rpm -qa |grep jdk yum -y remove java # 安裝同一版本的jdk rz (jdk-8u144-linux-x64.rpm) rpm -ivh jdk-8u144-linux-x64.rpm java -version
3.安裝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 ----------------
4.zookeeper客戶端的使用(zkCli.sh)
/usr/local/zookeeper/bin/zkCli.sh # 直接進入localhost [zk: localhost:2181(CONNECTED) 0] /usr/local/zookeeper/bin/zkCli.sh -server 127.0.0.1:2181 # -server設定進入那個zookeeper [zk: 127.0.0.1:2181(CONNECTED) 0] # zookeeper里面都是絕對路徑,沒有相對路徑 [zk: 127.0.0.1:2181(CONNECTED) 0] ls / # ls / 查看下初始化后的根目錄 [zookeeper]
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。