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

zookeeper standalone模式安装

时间:2015-03-01 22:23:32      阅读:219      评论:0      收藏:0      [点我收藏+]

标签:zookeeper   ubuntu   

首先需要安装jdk,参考之前的文章:Ubuntu 13.10-14.10 安装Oralce JDK

然后下载最新稳定版本到/opt目录

/opt$ wget http://mirrors.cnnic.cn/apache/zookeeper/stable/zookeeper-3.4.6.tar.gz

解压目录:

tar zxvf zookeeper-3.4.6.tar.gz 

解压后的目录结构为:

/opt/zookeeper-3.4.6$ tree -L 1
.
├── bin
├── build.xml
├── CHANGES.txt
├── conf
├── contrib
├── dist-maven
├── docs
├── ivysettings.xml
├── ivy.xml
├── lib
├── LICENSE.txt
├── NOTICE.txt
├── README_packaging.txt
├── README.txt
├── recipes
├── src
├── zookeeper-3.4.6.jar
├── zookeeper-3.4.6.jar.asc
├── zookeeper-3.4.6.jar.md5
└── zookeeper-3.4.6.jar.sha1

进入conf目录,复制sample配置文件

cd conf/
$ cp zoo_sample.cfg zoo.cfg
编辑zoo.cfg文件,修改data目录路径,注释都解释了各个参数的作用:

# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial 
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between 
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just 
# example sakes.
dataDir=/opt/zk_data
# the port at which the clients will connect
clientPort=2181


创建目录

mkdir /opt/zk_data

现在启动服务吧:

:/opt/zookeeper-3.4.6/conf$ cd ..
:/opt/zookeeper-3.4.6$ bin/zkServer.sh start
JMX enabled by default
Using config: /opt/zookeeper-3.4.6/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED




zookeeper standalone模式安装

标签:zookeeper   ubuntu   

原文地址:http://blog.csdn.net/csfreebird/article/details/44006453

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