码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • 在Windows环境与Linux环境下搭建Zookeeper单机环境与集群环境


    Windows环境下的安装

    下载与安装

    1.访问地址: https://zookeeper.apache.org/releases.html#download下载需要的ZK版本,下载到本地后解压。

    2.在解压目录下面新建一个空的 data 文件夹和 log 文件夹

    配置

    将 conf 目录下的 zoo_sample.cfg 文件,复制一份,重命名为 zoo.cfg

    修改 zoo.cfg 配置文件,将 dataDir=/tmp/zookeeper 修改成 zookeeper 安装目录所在的 data 文件夹,再添加一条添加数据日志的配置

    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:\Development\apache-zookeeper-3.6.3-bin\data
    13. dataLogDir=D:\Development\apache-zookeeper-3.6.3-bin\log
    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

    启动

    双击bin目录下的zkServer.cmd启动即可

    zookeeper新版本中有个内嵌的管理控制台是通过jetty启动,会占用8080 端口

    解决方法

    1.修改端口

    在zoo.cfg中增加admin.serverPort=没有被占用的端口号
    admin.serverPort=8088

    2.修改启动脚本

    在启动脚本中增加"-Dzookeeper.admin.enableServer=false"
    "-Dzookeeper.admin.enableServer=false"

    Linux环境下的安装

    下载与安装

    访问地址: 

  • 相关阅读:
    毕业论文写作指南
    合并单元格
    吃透50个常用的SQL语句,面试趟过
    数字IC前端学习笔记:数字乘法器的优化设计(进位保留乘法器)
    JavaScript入门学习笔记(一)
    【C/C++】动态库和静态库:性能、编译时和运行时的差异
    自己动手实现 HashMap(Python字典),彻底系统的学习哈希表(上篇)——不看血亏!!!
    flex布局原理,常见的父项属性,flex布局子项常见属性,利用flex布局和float制作的有轮播图的携程旅行首页
    vulhub struts2 s2-001漏洞复现
    【React Scheduler源码第三篇】React Scheduler原理及手写源码
  • 原文地址:https://blog.csdn.net/java_lujj/article/details/126951083
  • 最新文章
  • 【JVM】编译执行与解释执行的区别是什么?JVM 使用哪种方式?
    用 Hashids 优雅解决 C 端自增 ID 暴露问题
    V8引擎 精品漫游指南--Ignition篇(上) 指令 栈帧 槽位 调用约定 内存布局 基础内容
    LLVM Pass快速入门(四):代码插桩
    milkup:桌面端 markdown AI续写和即时渲染
    基于项目工程构建SBOM(软件物料清单)的研究
    鸿蒙应用开发UI基础第二节:鸿蒙应用程序框架核心解析与实操
    .NET 中如何快速实现 List 集合去重?
    扣子Coze实战:从0到1打造抖音+小红书热点监控智能体
    浅谈数据访问层
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
小工具 小游戏
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1

京公网安备 11010502049817号