Zookeeper在Windows与Linux下的安装
来源:互联网 发布:剑灵捏脸数据图下载 编辑:程序博客网 时间:2024/05/16 00:34
Zookeeper版本下载地址:http://apache.fayea.com/zookeeper/
说明:安装Zookeeper之前需要安装JDK。
一、Linux系统下的安装
(一)版本说明
Linux版本:CentOS7 64位;
JDK版本:1.7.0_79;
Zookeeper版本:zookeeper-3.4.9
(二)安装
1、创建 /usr/local/services/zookeeper 文件夹:
mkdir -p /usr/local/services/zookeeper
2、进入到 /usr/local/services/zookeeper 目录中:
cd /usr/local/services/zookeeper
3、下载 zookeeper-3.4.9.tar.gz(也可将压缩包下载以后放至该目录下):
wget https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/zookeeper-3.4.9/zookeeper-3.4.9.tar.gz
4、解压缩 zookeeper-3.4.9.tar.gz:
tar -zxvf zookeeper-3.4.9.tar.gz
5、进入到 /usr/local/services/zookeeper/zookeeper-3.4.9/conf 目录中:
cd zookeeper-3.4.9/conf/
6、复制 zoo_sample.cfg 文件的并命名为为 zoo.cfg:
cp zoo_sample.cfg zoo.cfg
7、用 vim 打开 zoo.cfg 文件
vi zoo.cfg8、修改其内容为如下:
# The number of milliseconds of each tick # zookeeper 定义的基准时间间隔,单位:毫秒 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=/tmp/zookeeper # 数据文件夹 dataDir=/usr/local/services/zookeeper/zookeeper-3.4.9/data # 日志文件夹 # dataLogDir=/usr/local/services/zookeeper/zookeeper-3.4.9/logs # the port at which the clients will connect # 客户端访问 zookeeper 的端口号 clientPort=2181
9、保存并关闭 zoo.cfg 文件:先按“Esc”键,再按“shift”+“:”,左下角出现冒号以后,输入“wq”回车即可。
10、进入到 /usr/local/services/zookeeper/zookeeper-3.4.9/bin 目录中:
cd ../bin/
11、用 vim 打开 /etc/ 目录下的配置文件 profile:
vim /etc/profile
在其尾部追加如下内容:
# idea - zookeeper-3.4.9 config start - 2017-07-08 export ZOOKEEPER_HOME=/usr/local/services/zookeeper/zookeeper-3.4.9/export PATH=$ZOOKEEPER_HOME/bin:$PATHexport PATH # idea - zookeeper-3.4.9 config start - 2017-07-08
12、使 /etc/ 目录下的 profile 文件即可生效:
source /etc/profile
13、启动 zookeeper 服务:
sh zkServer.sh start
如打印如下信息则表明启动成功:
ZooKeeper JMX enabled by default Using config: /usr/local/services/zookeeper/zookeeper-3.4.9/bin/../conf/zoo.cfg Starting zookeeper ... STARTED
14、查询 zookeeper 状态:
zkServer.sh status
15、关闭 zookeeper 服务:
zkServer.sh stop
如打印如下信息则表明成功关闭:
ZooKeeper JMX enabled by default Using config: /usr/local/services/zookeeper/zookeeper-3.4.9/bin/../conf/zoo.cfg Stopping zookeeper ... STOPPED
16、重启 zookeeper 服务:
zkServer.sh restart如打印如下信息则表明重启成功:
ZooKeeper JMX enabled by default Using config: /usr/local/services/zookeeper/zookeeper-3.4.9/bin/../conf/zoo.cfg ZooKeeper JMX enabled by default Using config: /usr/local/services/zookeeper/zookeeper-3.4.9/bin/../conf/zoo.cfg Stopping zookeeper ... STOPPED ZooKeeper JMX enabled by default Using config: /usr/local/services/zookeeper/zookeeper-3.4.9/bin/../conf/zoo.cfg Starting zookeeper ... STARTED
安装完毕。
参考自:http://www.linuxidc.com/Linux/2016-09/135052.htm二、Windows系统下的安装
(一)版本说明
Windows版本:Win10;
JDK版本:1.7.0_79 ;
Zookeeper版本:3.4.6(点此进入下载界面);
(二)安装
1.把下载的zookeeper的文件解压到指定目录:
E:\beauxie\dubbo\zookeeper-3.4.6
2.解压文件以后,在conf目录下,将zoo_sample.cfg文件重命名为zoo.cfg.
3.修改zoo.cfg中的内容:
# 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=E:\\beauxie\\dubbo\\zookeeper-3.4.6\\data #dataLogDir=E:\\beauxie\\dubbo\\zookeeper-3.4.6\\log# the port at which the clients will connect 客户端连接的端口clientPort=2181
4.进入到bin目录,并且启动zkServer.cmd,这个脚本中会启动一个Java进程
在bin目录下打开cmd命令窗口(按住shift,鼠标右键,选择在此处打开命令窗口),运行:zkServer.cmd,如下:5.启动jps可以看到QuorumPeerMain的进程
E:\beauxie\dubbo\zookeeper-3.4.6\bin>jps
启动客户端运行查看一下
E:\beauxie\dubbo\zookeeper-3.4.6\bin>zkCli.cmd -server 127.0.0.1:2181
安装完毕。参考自:http://blog.csdn.net/morning99/article/details/40426133
- Zookeeper在Windows与Linux下的安装
- Zookeeper在Linux下的安装与配置
- Zookeeper 在Windows下的安装
- Linux下zookeeper的安装与启动
- MongoDB 在Windows 与 Linux 下的安装与启动
- MongoDB 在Windows 与 Linux 下的安装与启动
- 【zookeeper】Windows下zookeeper的安装配置
- zookeeper windows 下的安装
- zookeeper在windows下的伪集群安装和启动
- Zookeeper 在Windows下的安装过程及测试
- Zookeeper 在 Windows下的安装(入门)
- Zookeeper 集群伪分布 在 Windows下的安装
- cmake在linux,windows,mac下的安装与使用
- cmake在linux,windows,mac下的安装与使用
- Memcached 在linux与windows下的安装
- Windows环境下Zookeeper 的安装与配置
- zookeeper在windows下安装集群
- linux下zookeeper的安装
- angularjs循环调用http时,传递的参数被覆盖的问题
- 过压检测电路
- 每日英语阅读(七)
- 今日笔记--ssm中对sql进行优化
- C#不用ArcEngine,生成Shp文件(六) 源码
- Zookeeper在Windows与Linux下的安装
- gets
- 简单的可视化日历系统
- 3路排序算法
- POJ 2718 暴力
- 自动化测试学习
- springmvc之Jackson实现po对象与Json字符串的互转
- 关于弹性布局flex属性详解
- Android中Recyclerview使用12----实现瀑布流样式