Zookeeper学习笔记——1 单机版本环境搭建

下载

首先去官网下载:
http://mirror.bit.edu.cn/apache/zookeeper/zookeeper-3.4.11/
然后执行tar -zxvf 解压

启动

进入conf目录,拷贝zoo_simple.cfg成zoo.cfg,单机版本不用修改。

直接执行脚本启动服务器: ./zkServer.sh start

然后执行脚本启动客户端:./zkCli.sh

在命令行中输入help,得到结果:

[zk: localhost:2181(CONNECTED) 1] help
ZooKeeper -server host:port cmd args
	stat path [watch]
	set path data [version]
	ls path [watch]
	delquota [-n|-b] path
	ls2 path [watch]
	setAcl path acl
	setquota -n|-b val path
	history 
	redo cmdno
	printwatches on|off
	delete path [version]
	sync path
	listquota path
	rmr path
	get path [watch]
	create [-s] [-e] path data acl
	addauth scheme auth
	quit 
	getAcl path
	close 
	connect host:port
[zk: localhost:2181(CONNECTED) 2] 

停止

./zkServer.sh stop
ZooKeeper JMX enabled by default
Using config: /Users/xingoo/soft/zookeeper-3.4.11/bin/../conf/zoo.cfg
Stopping zookeeper ... STOPPED

参考

  1. 代码地址
  2. 官方文档
posted @ 2018-03-27 21:59  xingoo  阅读(920)  评论(0编辑  收藏  举报