dubbo环境配置(jdk+maven+zookeeper)


  • 核心层

    jdk安装

    maven安装

    • 下载maven包
        wget http://apache.fayea.com/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
    
    • 解压包
        tar -vxf apache-maven-3.2.3-bin.tar.gz
    
    • 修改环境变量
        在 /etc/profile当中添加
        MAVEN_HOME=/usr/local/maven3
        export MAVEN_HOME
        export PATH=PATH:{PATH}:{MAVEN_HOME}/bin
        保存后source让环境变量生效
    

    zookeeper安装

    • 下载zookeeper包
       http://mirrors.hust.edu.cn/apache/zookeeper/zookeeper-3.4.10/zookeeper-3.4.10.tar.gz
    
    • 使用bin/zkServer.sh start启动
    • 配置文件
    # The number of milliseconds of each tick
    tickTime=2000
    # The number of ticks that the initial
    # synchronization phase can take
    initLimit=10
    # The number of ticks that can pass between
    # sending a request and getting an acknowledgement
    syncLimit=5
    # the directory where the snapshot is stored.
    # do not use /tmp for storage, /tmp here is just
    # example sakes.
    dataDir=~/dubbo/zookeeper-3.4.10/data
    dataLogDir=~/dubbo/zooleeper-3.4.10/logs
    # the port at which the clients will connect
    clientPort=2181
    # the maximum number of client connections.
    # increase this if you need to handle more clients
    #maxClientCnxns=60
    #
    # Be sure to read the maintenance section of the
    # administrator guide before turning on autopurge.
    #
    # http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
    #
    # The number of snapshots to retain in dataDir
    #autopurge.snapRetainCount=3
    # Purge task interval in hours
    # Set to "0" to disable auto purge feature
    #autopurge.purgeInterval=1
    
        1. initLimit:配置zookeeper接受服务器集群中链接到leader的follower服务器个数限制.当超过tickTime*syncLimit的时间(单位ms)没有收到连接,则这个服务连接失效
        2. 另外还有服务器配置,使用server.A=B:C:D 的格式,如:server.1=192.168.248.248:2888:3888
        其中server.1表示几号服务器,B是它的ip地址,C是这个服务器与集群leader交换信息的端口,D表示如果leader服务器挂掉了,则通过选举重新选出leader,D为选举时的通信端口
    

 

Copyright © 2018 bbs.dian.org.cn All rights reserved.

与 Dian 的连接断开,我们正在尝试重连,请耐心等待