zoukankan      html  css  js  c++  java
  • zookeeper分布式环境的搭建

    官网配置地址:http://zookeeper.apache.org/doc/trunk/zookeeperStarted.html

    安装jdk

    关闭防火墙

    下载zookeeper-3.3.6并解压

    进入到解压文件中的conf目录下,重命名 zoo_sample.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
    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.
    dataDir=/home/hadoop/app/zookeeper-3.3.6/data
    # the port at which the clients will connect
    clientPort=2181
    server.1=192.168.19.100:2888:3888   # 28888 zookeeper监听端口, 3888选举端口
    server.2=192.168.19.101:2888:3888
    server.3=192.168.19.102:2888:3888
    

    配置好后需要在dataDir目录下创建一个myid的文件,文件的内容为 server.x=ip:2888:3888中的x的值,如server.1=192.168.19.100:2888:3888,则在ip为192.168.19.100的机器上的/home/hadoop/app/zookeeper-3.3.6/data存在一个内容为1的myid文件

     拷贝zookeeper到其他的机器

    启动zookeeper: bin/zkServer.sh start

    停止zookeeper: bin/zkServer.sh stop

    查看zookeeper状态: bin/zkServer.sh status

  • 相关阅读:
    quratz数据存储
    quratz线程
    scheduler 基本原理
    一致性哈希算法
    高并发流量控制
    049 DSL语句
    048 SparkSQL自定义UDAF函数
    047 SparkSQL自定义UDF函数
    Quratz的理解
    046 SparlSQL中的函数
  • 原文地址:https://www.cnblogs.com/heml/p/5993178.html
Copyright © 2011-2022 走看看