• Windows10安装Zookeeper教程


    简介 :zookeeper


    zookeeper是分流减轻系统负担,就是很多台计算机 组成的一个整体,一个整体一致对外并且处理同一个请求,内部的每台计算机都可以互相通信(rest/rpc)机制。客户端的一次请求到 响应结束会历经多台计算机,简单的说就是把一个请求拆分多个子模块运行

    zookeeper的特性


    一致性:数据一致性数据按照顺序分批入库
    原子性:事务要么成功,要么失败,不会全局化
    单一视图: 客户连接集群中任意的一个zookeeper节点 数据都是一致的
    可靠性:每次对zookeeper的操作 状态都会 保存在服务端
    实时性:客户端可以读取到zookeeper服务端的最新数据

     

    1.安装Zookeeper

         安装
          解压到指定目录下    D:\Program Files\apache-zookeeper-3.6.3-bin\apache-zookeeper-3.6.3-bin
          修改zoo_sample.cfg 文件名(D:\Program Files\apache-zookeeper-3.6.3-bin\apache-zookeeper-3.6.3-bin\conf) 为 zoo.cfg
          主要修改一下日志位置,具体配置文件如下:

    1. # The number of milliseconds of each tick
    2. tickTime=2000
    3. # The number of ticks that the initial
    4. # synchronization phase can take
    5. initLimit=10
    6. # The number of ticks that can pass between
    7. # sending a request and getting an acknowledgement
    8. syncLimit=5
    9. # the directory where the snapshot is stored.
    10. # do not use /tmp for storage, /tmp here is just
    11. # example sakes.
    12. dataDir=D:/Program Files/apache-zookeeper-3.6.3-bin/apache-zookeeper-3.6.3-bin/data
    13. dataLogDir=D:/Program Files/apache-zookeeper-3.6.3-bin/apache-zookeeper-3.6.3-bin/logs
    14. # the port at which the clients will connect
    15. clientPort=2181
    16. # the maximum number of client connections.
    17. # increase this if you need to handle more clients
    18. #maxClientCnxns=60
    19. #
    20. # Be sure to read the maintenance section of the
    21. # administrator guide before turning on autopurge.
    22. #
    23. # http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
    24. #
    25. # The number of snapshots to retain in dataDir
    26. #autopurge.snapRetainCount=3
    27. # Purge task interval in hours
    28. # Set to "0" to disable auto purge feature
    29. #autopurge.purgeInterval=1
    30. ## Metrics Providers
    31. #
    32. # https://prometheus.io Metrics Exporter
    33. #metricsProvider.className=org.apache.zookeeper.metrics.prometheus.PrometheusMetricsProvider
    34. #metricsProvider.httpPort=7000
    35. #metricsProvider.exportJvmInfo=true
    36. jute.maxbuffer=0x400000

    配置文件简单解析


    1、tickTime:这个时间是作为 Zookeeper 服务器之间或客户端与服务器之间维持心跳的时间间隔,也就是每个 tickTime 时间就会发送一个心跳。
    2、dataDir:顾名思义就是 Zookeeper 保存数据的目录,默认情况下,Zookeeper 将写数据的日志文件也保存在这个目录里。
    3、dataLogDir:顾名思义就是 Zookeeper 保存日志文件的目录
    4、clientPort:这个端口就是客户端连接 Zookeeper 服务器的端口,Zookeeper 会监听这个端口,接受客户端的访问请求。

    打开所在文件夹

     先双击运行zkServer.cmd,cmd运行窗口不要关,

     再双击运行zkCli.cmd

     这样Zookeeper就安装好了。

  • 相关阅读:
    Office在线协作(三)- O2OA连接本地部署的OnlyOffice Docs Server服务器 For Windows Server
    星环科技TDS 2.4.0 发布: 数据开发、数据治理、数据运营套件能力再次升级
    C++【5】类与对象(二)
    QListView
    SSM出租车查询系统 毕业设计-附源码220915
    Python自动化测试的2种思路
    C++11alignas 说明符和alignof 运算符和内存对齐问题
    Nginx -- -- 配置SSL证书
    10.cuBLAS开发指南中文版--cuBLAS中的logger配置
    校园图书馆自习室管理系统 毕业设计源码25035
  • 原文地址:https://blog.csdn.net/weixin_45740811/article/details/125489253