• Zookeeper安装指南


    第一步:修改conf目录下面的 zoo_sample.cfg修改为zoo.cfg

    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=/home/zookeeper/data
    dataLogDir=/home/zookeeper/log
    # the port at which the clients will connect
    clientPort=2181

    serverlist

    server.1=nj02-rp-2014-q1-01-jh2-210.nj02:2888:3888

    server.2=nj02-rp-2014-q1-01-jh2-212.nj02:2888:3888

    server.3=nj02-rp-2014-q1-01-jh2-211.nj02:2888:3888

    第二步: mkdir -p /home/zookeeper/data && mkdir -p /home/zookeeper/log

    在我们配置的dataDir指定的目录下面,创建一个myid文件,里面内容为一个数字,用来标识当前主机,conf/zoo.cfg文件中配置的server.X中X为什么数字,则myid文件中就输入这个数字,例如: [plain] view plaincopy hadoop@slave-01:~/installation/zookeeper-3.3.4$ echo "1" > /home/zookeeper/data/myid hadoop@slave-02:~/installation/zookeeper-3.3.4$ echo "2" > /home/zookeeper/data/myid

    第三步:启动ZooKeeper集群

    bin/zkServer.sh start

    第四步 查看zookeeper集群是否启动

    zkServer.sh status

    [root@master ~]# zkServer.sh status 
    JMX enabled by default 
    Using config: /usr/zookeeper-3.3.3/bin/../conf/zoo.cfg 
    Mode: follower

    leader的显示是:

    JMX enabled by default 
    Using config: /usr/zookeeper-3.3.3/bin/../conf/zoo.cfg 
    Mode: leader

  • 相关阅读:
    排序(六)插入排序
    集合类 collection接口 ArrayList
    面向对象四大特性
    多线程 interrupt()方法
    NIO Channel 管道
    NIOBuffer 缓冲区
    lamdba表达式
    cloneable以及深拷贝和浅拷贝
    Volatile关键字
    线程池
  • 原文地址:https://www.cnblogs.com/shine_cn/p/6226436.html
Copyright © 2020-2023  润新知