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

zookeeper安装

时间:2018-06-15 15:47:40      阅读:186      评论:0      收藏:0      [点我收藏+]

标签:apach   conf   code   查看   nec   specified   ssi   3.4   sam   

此处以centos系统下zookeeper安装为例,相信步骤可参考官网文档:zookeeper教程

1、下载zookeeper

wget http://mirrors.hust.edu.cn/apache/zookeeper/zookeeper-3.4.10/zookeeper-3.4.10.tar.gz

2、解压下载下来的压缩文件

tar -zxvf zookeeper-3.4.10.tar.gz 

3、进入解压缩文件夹的conf目录,新建zoo.cfg配置文件(zookeeper启动时默认加载conf目录下的zoo.cfg文件)

cd zookeeper-3.4.10
cd conf/
touch zoo.cfg
vi zoo.cfg

该目录下有一个样例配置文件,可供参考:zoo_sample.cfg

4、修改配置文件(默认监听服务器上所有网卡收到的请求):

vi zoo.cfg

修改完成后,配置文件内容如下:

tickTime=2000
dataDir=/opt/zookeeper-3.4.10/data
clientPort=2181

官网介绍如下:

This file can be called anything, but for the sake of this discussion call it conf/zoo.cfg. Change the value of dataDir to specify an existing (empty to start with) directory. Here are the meanings for each of the fields:

tickTime

    the basic time unit in milliseconds used by ZooKeeper. It is used to do heartbeats and the minimum session timeout will be twice the tickTime.

dataDir

    the location to store the in-memory database snapshots and, unless specified otherwise, the transaction log of updates to the database.
clientPort

    the port to listen for client connections

5、创建配置文件中提到的datadir目录:

mkdir -p /opt/zookeeper-3.4.10/data

 

6、启动zookeeper,安装目录bin目录下执行如下指令:

./zkServer.sh start

其他相关命令:

关闭:./zkServer.sh stop
重启: ./zkServer.sh restart

查看状态: ./zkServer.sh status

到此zookeeper安装完成



 

zookeeper安装

标签:apach   conf   code   查看   nec   specified   ssi   3.4   sam   

原文地址:https://www.cnblogs.com/yinz/p/9186873.html

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