• Mac M3 Pro 安装 Zookeeper-3.4.6


    1、下载安装包

    官方下载地址:https://archive.apache.org/dist/zookeeper/

    网盘下载地址:https://pan.baidu.com/s/1j6iy5bZkrY-GKGItenRB2w?pwd=irrx 提取码: irrx

    2、解压并添加环境变量

    1. # 将安装包移动到目标目录
    2. mv ~/Download/zookeeper-3.4.6.tar.gz /opt/module
    3. # 进入目标目录
    4. cd /opt/module
    5. # 解压安装包
    6. tar -zxvf zookeeper-3.4.6.tar.gz
    7. # 修改目录名称
    8. mv zookeeper-3.4.6 zookeeper
    9. # 进入软件目录
    10. cd zookeeper
    11. # 创建data目录
    12. mkdir data
    13. #添加环境变量
    14. sudo vim /etc/profile
    15. export JAVA8_HOME="/Library/Java/JavaVirtualMachines/jdk8/Contents/Home"
    16. alias java8="export JAVA_HOME=$JAVA8_HOME"
    17. export JRE_HOME=${JAVA_HOME}/jre
    18. export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
    19. export MAVEN_HOME="/Library/Java/apache-maven-3.8.8"
    20. export ZOOKEEPER_HOME=/opt/module/zookeeper
    21. export PATH="$JAVA_HOME/bin:$MYSQL_HOME/bin:$MAVEN_HOME/bin:$ZOOKEEPER_HOME/bin:$PATH:."

    3、修改配置文件 

    1. cd conf
    2. cp zoo_sample.cfg zoo.cfg

    以下是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=/opt/module/zookeeper/data
    13. # the port at which the clients will connect
    14. clientPort=2181
    15. # the maximum number of client connections.
    16. # increase this if you need to handle more clients
    17. #maxClientCnxns=60
    18. #
    19. # Be sure to read the maintenance section of the
    20. # administrator guide before turning on autopurge.
    21. #
    22. # http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
    23. #
    24. # The number of snapshots to retain in dataDir
    25. #autopurge.snapRetainCount=3
    26. # Purge task interval in hours
    27. # Set to "0" to disable auto purge feature
    28. #autopurge.purgeInterval=1

     4、启动

    1. cd ..
    2. ./bin/zkServer.sh start
    3. # 查看进程是否存在
    4. jps
    5. # 如存在如下进程名表示启动了
    6. QuorumPeerMain

    5、检查是否成功

    ./bin/zkCli.sh

     成功后可以查看根节点、创建子节点等

     

  • 相关阅读:
    Javaweb-JSP详解
    企业应用超融合架构的设计实例及超融合应用场景分析
    清除JavaWeb项目缓存的有效方式
    打卡第 1 天:正则表达式学习总结
    Three.js入门学习笔记
    【Java基础夯实】枚举类回炉重造
    python的str.find()用法及实例
    uniapp实现移动端的视频图片轮播组件
    派金SDK接入文档
    元宇宙-漫游世界后与Cocos一起看湖南卫视直播
  • 原文地址:https://blog.csdn.net/k7gxn56/article/details/139697555