1、下载Zookeeper

http://mirrors.cnnic.cn/apache/zookeeper/zookeeper-3.4.6/

2、创建/usr/app/zookeeper目录,并切换到该目录,如下所示

3、使用rz命令上传zookeeper-3.4.6.tar.gz

4、解压(tar zxvf zookeeper-3.4.6.tar.gz),如下所示

5、删除zookeeper-3.4.6.tar.gz,如下所示

6、重名zookeeper-3.4.6为zookeeper1,如下所示

7、在zookeeper1目录下,创建data、datalog两目录,如下

8、在data目录下创建myid文件,输入数字1,然后保存退出,该数字用来标识当前主机
    

9、在conf目录下,将zoo_sample.cfg重名为zoo.cfg,并编辑zoo.cfg文件,如下所示

zoo.cfg文件内容如下

# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
# zookeeper集群中的包含多台server, 其中一台为leader, 集群中其余的为follower,initLimit配置初始化连接时,
# follower和leader之间的最长心跳时间. 此时该参数设置为10, 说明时间限制为10倍tickTime, 即10*2000=20000ms=20s
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
# 该参数配置leader和follower之间发送消息, 请求和应答的最大时间长度. 此时该参数设置为5, 说明时间限制为5倍tickTime, 即10000ms
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/usr/app/zookeeper/zookeeper1/data
dataLogDir=/usr/app/zookeeper/zookeeper1/datalog
# the port at which the clients will connect
# 在伪分布式下,各个server的clientPort不能相同
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1
# server.X=A:B:C
# 其中X是一个数字, 表示这是第几号server
# A是该server所在的IP地址
# B配置该server和集群中的leader交换消息所使用的端口
# C配置选举leader时所使用的端口
# 说明:在伪分布式下, 各个server的B, C参数必须不同
server.1=ljc:2888:3888
server.2=ljc:2889:3889
server.3=ljc:2890:3890

10、切换到/usr/app/zookeeper/,将zookeeper1拷贝两份zookeeper2、zookeeper3,如下所示

11、修改zookeeper2中两个文件(data/myid、conf/zoo.cfg),将myid文件的内容修改为2,修改zoo.cfg文件中的属性(dataDir=/usr/app/zookeeper/zookeeper2/data、dataLogDir=/usr/app/zookeeper/zookeeper2/datalog、clientPort=2182)

12、修改zookeeper3中两个文件(data/myid、conf/zoo.cfg),将myid文件的内容修改为3,修改zoo.cfg文件中的属性(dataDir=/usr/app/zookeeper/zookeeper3/data、dataLogDir=/usr/app/zookeeper/zookeeper3/datalog、clientPort=2183)

13、启动zookeeper

如果出现以下结果,说明启动成功

如果,您认为阅读这篇博客让您有些收获,不妨点击一下右下角的【推荐】。
如果,您希望更容易地发现我的新博客,不妨点击一下左下角的【关注我】。
如果,您对我的博客所讲述的内容有兴趣,请继续关注我的后续博客,我是【刘超★ljc】。

本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。

Zookeeper3.4.6部署伪分布集群(Apache)的更多相关文章

  1. ZooKeeper伪分布集群安装及使用 RMI+ZooKeeper实现远程调用框架

    使用 RMI + ZooKeeper 实现远程调用框架,包括ZooKeeper伪集群安装和代码实现两部分.  一.ZooKeeper伪集群安装: 1>获取ZooKeeper安装包 下载地址:ht ...

  2. Zookeeper,Hbase 伪分布,集群搭建

    工作中一般使用的都是zookeeper和Hbase的分布式集群. more /etc/profile cd /usr/local zookeeper-3.4.5.tar.gz zookeeper在安装 ...

  3. ubuntu12.04+kafka2.9.2+zookeeper3.4.5的伪分布式集群安装和demo(java api)测试

    博文作者:迦壹 博客地址:http://idoall.org/home.php?mod=space&uid=1&do=blog&id=547 转载声明:可以转载, 但必须以超链 ...

  4. 单节点伪分布集群(weekend110)的HBase子项目启动顺序

    伪分布模式下,如(weekend110)hbase-env.sh配置文档中的HBASE_MANAGES_ZK的默认值是true,它表示HBase使用自身自带的Zookeeper实例.但是,该实例只能为 ...

  5. 在Ubuntu14.10中部署Hadoop2.6.0单节点伪分布集群

    1. 环境信息如下: ubuntu:14.10 jdk:openjdk-1.7.0 hadoop:2.6.0 2. 下载hadoop2.6.0, http://apache.fayea.com/had ...

  6. zookeeper伪分布集群配置

    1.上传tar文件zookeeper-3.4.12.tar.gz 2.解压zookeeper-3.4.12.tar.gz [root@localhost zookeeper]# .tar.gz 3.重 ...

  7. 单节点伪分布集群(weekend110)的Hive子项目启动顺序

    因为,我的mysql是用root用户,在/home/hadoop/app/目录下,创建的. 第一步:开启mysql服务 第二步:启动hive [hadoop@weekend110 app]$ su r ...

  8. hadoop伪分布集群搭建

    系统环境:ubuntu server16.04 1.root@master:~$ vim /etc/hostname #修改主机名 master 2.root@master:~$ reboot #重启 ...

  9. (转)ZooKeeper伪分布式集群安装及使用

    转自:http://blog.fens.me/hadoop-zookeeper-intro/ 前言 ZooKeeper是Hadoop家族的一款高性能的分布式协作的产品.在单机中,系统协作大都是进程级的 ...

随机推荐

  1. leetcode 第一题 Two Num java

    Given an array of integers, find two numbers such that they add up to a specific target number. The ...

  2. c++ 标准委员会网址

    c++ 标准委员会网址: http://www.open-std.org/ C++11 文档网址: http://www.open-std.org/jtc1/sc22/wg21/docs/papers ...

  3. The Promise of Deep Learning

    The Promise of Deep Learning By Yoshua Bengio Humans have long dreamed of creating machines that thi ...

  4. IIS tomcat共用80端口解决一个IP多个域名:使用Nginx反向代理方式使两者兼容

    环境: windows server 2003,IIS6服务器,Tomcat7服务器 域名有几个: 以下是使用IIS的域名: http://www.formuch.com/ http://www.fo ...

  5. 【网络流24题】No.4 魔术球问题 (二分+最小路径覆盖)

    [题意] 假设有 n 根柱子, 现要按下述规则在这 n 根柱子中依次放入编号为 1, 2, 3, ¼的球.( 1)每次只能在某根柱子的最上面放球.( 2)在同一根柱子中,任何 2 个相邻球的编号之和为 ...

  6. 【bzoj 3299】 [USACO2011 Open]Corn Maze玉米迷宫(最短路)

    就一个最短路,并且边长都是1,所以每个点只搜一次. /************************************************************** Problem: 3 ...

  7. 再探CRC

    之前写了CRC16的程序,虽说能用,却不知其所心然,现在要用CRC32,重温一遍,一下就通了.笔记如下 CRC我没记错的话是Cyclic Redundancy Code,Cyclic和Redundan ...

  8. Android用户界面UI组件--AdapterView及其子类(四) GridView

    GridView常用的XML属性: android:columnWidth  设置列的宽度. android:horizontalSpacing  两列之间的间距.  android:numColum ...

  9. Python自然语言处理学习笔记(69)

    http://www.cnblogs.com/yuxc/archive/2012/02/09/2344474.html Chapter8    Analyzing Sentence Structure ...

  10. git撤销提交到remote的commit

    Reseting remote to a certain commit Assuming that your branch is called master both here and remotel ...