1.   概述

ZooKeeper是Hadoop的正式子项目,它是一个针对大型分布式系统的可靠协调系统,提供的功能包括:配置维护、名字服务、分布式同步、组服务等。ZooKeeper的目标就是封装好复杂易出错的关键服务,将简单易用的接口和性能高效、功能稳定的系统提供给用户。

2.   安装&配置

在apache的官方网站提供了好多镜像下载地址,然后找到对应的版本,目前最新的是3.3.6

下载地址:

http://mirrors.cnnic.cn/apache/zookeeper/zookeeper-3.3.6/zookeeper-3.3.6.tar.gz

Windows下安装

把下载的zookeeper的文件解压到指定目录

D:\machine\zookeeper-3.3.6>

修改conf下增加一个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 anacknowledgement

syncLimit=5

# the directory where the snapshot isstored.  //镜像数据位置

dataDir=D:\\data\\zookeeper

#日志位置

dataLogDir=D:\\logs\\zookeeper

# the port at which the clients willconnect  客户端连接的端口

clientPort=2181

注:如果启动有报错提示cfg文件有错误,可以用zoo_sample.cfg内内容替代也是可以的

进入到bin目录,并且启动zkServer.cmd,这个脚本中会启动一个Java进程

D:\machine\zookeeper-3.3.6>cd bin

D:\machine\zookeeper-3.3.6\bin>

D:\machine\zookeeper-3.3.6\bin >zkServer.cmd

启动后jps可以看到QuorumPeerMain的进程

D:\machine\zookeeper-3.3.6\bin >jps

启动客户端运行查看一下

D:\machine\zookeeper-3.3.6\bin>zkCli.cmd-server 127.0.0.1:2181

这个时候zookeeper已经安装成功了,

参考官方文档:

http://zookeeper.apache.org/doc/trunk/zookeeperStarted.html

 参考单机模式、集群和伪集群的帖子

http://sqcjy111.iteye.com/blog/1741320

在 一台机器上通过伪集群运行时可以修改 zkServer.cmd 文件在里面加入

set ZOOCFG=..\conf\zoo1.cfg  这行,另存为  zkServer-1.cmd


如果有多个可以以此类推

还需要 在对应的

/tmp/zookeeper/1,

/tmp/zookeeper/2,

/tmp/zookeeper/3

建立一个文本文件命名为myid,内容就为对应的zoo.cfg里server.后数字

  

参考链接:http://blog.csdn.net/morning99/article/details/40426133

最新文章

  1. CSS3鼠标滑过图标放大以及旋转
  2. C#设计模式系列:代理模式(Proxy)
  3. Unite洛杉矶峰会精彩回顾:从图形、平台再到VR
  4. torch7安装
  5. JAVA生成TXT日志文件
  6. linux web服务器必需的库文件
  7. 汇文Libsys图书管理系统全版本权限绕过+getshell
  8. 在线重定义(Rdefine Table online)
  9. [转] 详细整理:UITableView优化技巧
  10. C++ Primer 5th 第15章 面向对象程序设计
  11. 方向梯度直方图(HOG)和颜色直方图的一些比較
  12. 在centos 6.5 x64中安装 spark-1.5.1
  13. 03-在tomcat部署网站多个网站
  14. 潭州课堂25班:Ph201805201 django 项目 第三十五课 后台用户权限的添加 mixins 课堂笔记)
  15. 使用Flask部署机器学习模型
  16. SQLAlchemy_ORM
  17. Java中,&&与&,||与|的区别
  18. Git——新手入门与上传项目到远程仓库GitHub(转)
  19. Grunt--Less
  20. 【Spring Boot&&Spring Cloud系列】Spring Boot配置文件

热门文章

  1. RxJava+RxAndroid+MVP入坑实践(基础篇)
  2. idea结合git使用三
  3. 【LeetCode】Find Minimum in Rotated Sorted Array 找到旋转后有序数组中的最小值
  4. day5-shelve模块
  5. 条款19:定义class就相当于定义一个个的内置类型
  6. vim技巧记录
  7. cannot be read or is not a valid ZIP file
  8. android开发之eclipse调试debug模式详解
  9. string manipulation in game development-C # in Unity -
  10. uid