码迷,mamicode.com
首页 > 其他好文 > 详细

ZooKeeper Installation

时间:2018-10-18 10:51:51      阅读:143      评论:0      收藏:0      [点我收藏+]

标签:desktop   format   apt-get   end   out   about   sed   lap   技术   

ZooKeeper Installation

 

Install ZooKeeper packages

# sudo apt-get install openjdk-8-jre-headless
# sudo apt-get install zookeeper zookeeperd

 

If you need a cluster, configure the Conf file, otherwise ignore it. 

技术分享图片
Configure ZooKeeper

Common Configuration

Edit the /etc/zookeeper/conf/zoo.cfg file to contain the following:

server.1=nsdb1:2888:3888
server.2=nsdb2:2888:3888
server.3=nsdb3:2888:3888
autopurge.snapRetainCount=10
autopurge.purgeInterval =12
[Important]    Important
For production deployments it is recommended to configure the storage of snapshots in a different disk than the commit log, this is done by setting the parameters dataDir and dataLogDir in zoo.cfg. In addition we advice to use an SSD drive for the commit log.

Node-specific Configuration

NSDB Node 1

Create the /var/lib/zookeeper/myid file and edit it to contain the host’s ID:

# echo 1 > /var/lib/zookeeper/myid
NSDB Node 2

Create the /var/lib/zookeeper/myid file and edit it to contain the host’s ID:

# echo 2 > /var/lib/zookeeper/myid
NSDB Node 3

Create the /var/lib/zookeeper/myid file and edit it to contain the host’s ID:

# echo 3 > /var/lib/zookeeper/myid
cluster config

 

Restart ZooKeeper

# sudo service zookeeper restart

 


Verify ZooKeeper Operation

$ echo ruok | nc 127.0.0.1 2181
imok

 


More detailed information can be requested with the stat command, which lists statistics about performance and connected clients:

wsl1017@DESKTOP-14G6K9S:/etc/zookeeper/conf$ echo stat | nc 127.0.0.1 2181
Zookeeper version: 3.4.10-3--1, built on Sat, 03 Feb 2018 14:58:02 -0800
Clients:
 /127.0.0.1:56273[0](queued=0,recved=1,sent=0)

Latency min/avg/max: 0/0/0
Received: 1
Sent: 0
Connections: 1
Outstanding: 0
Zxid: 0x0
Mode: standalone
Node count: 4

 

Reference:

     1. install jre

 

ZooKeeper Installation

标签:desktop   format   apt-get   end   out   about   sed   lap   技术   

原文地址:https://www.cnblogs.com/xiaobin-hlj80/p/9808101.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!