zoukankan      html  css  js  c++  java
  • Zookeeper集群部署

    各zookeeper集群配置java环境#

    https://archive.apache.org/dist/zookeeper/ #官网下载地址
    服务器环境:Ubuntu18.04
    Zk-node1:10.0.1.101
    Zk-node2:10.0.1.102
    Zk-node3:10.0.1.103

    • zk节点1部署过程
      apt install openjdk-8-jdk
      java -version #验证jdk版本
    cat install_zookeeper.sh
    #!/bin/bash
    #date 2021-1-25
    install_zookeeper(){
       tar xvf zookeeper-3.4.13.tar.gz -C /usr/local/src
       cd /usr/local/src
       ln -sv /usr/local/src/zookeeper-3.4.13/ /usr/local/zookeeper
       cd /usr/local/zookeeper/conf
       cp zoo_sample.cfg zoo.cfg
       cd /usr/local/zookeeper/ && mkdir data
       echo "1" > /usr/local/zookeeper/data/myid
    }
    install_zookeeper
    
    grep '^[^#]'  /usr/local/zookeeper/conf/zoo.cfg
    tickTime=2000
    initLimit=10
    syncLimit=5
    dataDir=/usr/local/zookeeper/data
    clientPort=2181
    maxClientCnxns=128
    autopurge.snapRetainCount=3
    autopurge.purgeInterval=1
    server.1=10.0.1.101:2888:3888
    server.2=10.0.1.102:2888:3888
    server.3=10.0.1.103:2888:3888
    
    scp zoo.cfg 10.0.1.102:/usr/local/zookeeper/conf  #将配置文件分发到其他服务器
    scp zoo.cfg 10.0.1.103:/usr/local/zookeeper/conf
    
    • zk节点2部署过程
      apt install openjdk-8-jdk
      java -version
    cat install_zookeeper.sh
    #!/bin/bash
    #date 2021-1-25
    
    install_zookeeper(){
       tar xvf zookeeper-3.4.13.tar.gz -C /usr/local/src
       cd /usr/local/src
       ln -sv /usr/local/src/zookeeper-3.4.13/ /usr/local/zookeeper
       cd /usr/local/zookeeper/conf
       cp zoo_sample.cfg zoo.cfg
       cd /usr/local/zookeeper/ && mkdir data
       echo "2" > /usr/local/zookeeper/data/myid
    }
    install_zookeeper
    
    grep '^[^#]'  /usr/local/zookeeper/conf/zoo.cfg
    tickTime=2000
    initLimit=10
    syncLimit=5
    dataDir=/usr/local/zookeeper/data
    clientPort=2181
    maxClientCnxns=4096
    autopurge.snapRetainCount=128
    autopurge.purgeInterval=1
    server.1=10.0.1.101:2888:3888
    server.2=10.0.1.102:2888:3888
    server.3=10.0.1.103:2888:3888
    
    • zk节点3部署过程
    apt install openjdk-8-jdk
    java -version
    
     cat install_zookeeper.sh 
    #!/bin/bash
    #date 2021-1-25
    
    install_zookeeper(){
       tar xvf zookeeper-3.4.13.tar.gz -C /usr/local/src
       cd /usr/local/src
       ln -sv /usr/local/src/zookeeper-3.4.13/ /usr/local/zookeeper
       cd /usr/local/zookeeper/conf
       cp zoo_sample.cfg zoo.cfg
       cd /usr/local/zookeeper/ && mkdir data
       echo "3" > /usr/local/zookeeper/data/myid
    }
    install_zookeeper 
    
    grep '^[^#]'  /usr/local/zookeeper/conf/zoo.cfg
    tickTime=2000
    initLimit=10
    syncLimit=5
    dataDir=/usr/local/zookeeper/data
    clientPort=2181
    maxClientCnxns=4096
    autopurge.snapRetainCount=128
    autopurge.purgeInterval=1
    server.1=10.0.1.101:2888:3888
    server.2=10.0.1.102:2888:3888
    server.3=10.0.1.103:2888:3888
    
    • 各节点启动zookeeper
      /usr/local/zookeeper/bin/zkServer.sh start

    /usr/local/zookeeper/bin/zkServer.sh status #验证集群节点状态


  • 相关阅读:
    oracle 递归查询 查询当前选中节点的所有子节点
    sql 常见操作
    【转】VS2008制作打包程序将安装路径写入注册表
    HTML字符集大全
    Oracle左连接,右连接
    Ubuntu下root用户和user用户如何进行相互切换
    【转】 vs2008 用文件部署生成的exe安装包
    C# 中out 和 ref 关键字的区别
    【转】vs2008安装部署程序时如何设置程序开机启动
    【转】vs2008安装部署工程制作教程
  • 原文地址:https://www.cnblogs.com/yds941268778/p/14327333.html
Copyright © 2011-2022 走看看