当前位置:   article > 正文

Mac M3 Pro 安装 Zookeeper-3.4.6

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

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

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/你好赵伟/article/detail/738816
推荐阅读
相关标签
  

闽ICP备14008679号