# springboot-dubbo **Repository Path**: yanshaohui/springboot-dubbo ## Basic Information - **Project Name**: springboot-dubbo - **Description**: 验证springboot + dubbo框架搭建 - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 3 - **Forks**: 1 - **Created**: 2017-06-13 - **Last Updated**: 2020-12-20 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README #springboot-dubbo **step1. 单机环境下模拟zookeeper集群 1. download : http://mirrors.hust.edu.cn/apache/zookeeper/ 2. 下载zookeeper-3.4.9.tar.gz,并解压 3. 条件有限,打算以区分端口的方式,启动三台zookeeper。 - 1.复制一份解压文件到/home/yanshaohui/study/zookeeper/server1/zookeeper-3.4.9 - 2.复制/home/yanshaohui/study/zookeeper/server1/zookeeper-3.4.9/conf/zoo_sample.cfg为zoo.cfg - 3.编辑zoo.cfg,内容如下: ``` # 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=/home/yanshaohui/zookeeper/server1/data dataLogDir=/home/yanshaohui/zookeeper/server1/dataLog # 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 server.1=127.0.0.1:2888:3888 server.2=127.0.0.1:2889:3889 server.3=127.0.0.1:2890:3890 ``` - server1中创建data和dataLog目录 - 复制serve1两份server2和server3 - 注意后两份中dataDir,dataLogDir分别修改为当前正确的目录 - 后两份中和clientPort依次为2182,2183 - 末尾的server.1...三份一致 - data目录放一个文件,内容只有自己的id,分别为1,2,3 ``` echo "1" > /home/yanshaohui/study/zookeeper/server1/data/myid echo "2" > /home/yanshaohui/study/zookeeper/server2/data/myid echo "3" > /home/yanshaohui/study/zookeeper/server3/data/myid ``` - 三份的/bin/zkEnv.sh 54行修改日志输出位置,否则会报告权限错误 ``` if [ "x${ZOO_LOG_DIR}" = "x" ] then ZOO_LOG_DIR="/home/yanshaohui/study/zookeeper/server1/log" fi ``` 4. 启动三份zookeeper。 /home/yanshaohui/study/zookeeper/server1/zookeeper-3.4.9/bin/zkServer.sh start /home/yanshaohui/study/zookeeper/server2/zookeeper-3.4.9/bin/zkServer.sh start /home/yanshaohui/study/zookeeper/server3/zookeeper-3.4.9/bin/zkServer.sh start 5. jps查看java进程,是否ok 6. netstat -ano | grep 2181 看一下2181端口的情况 7. 看执行状况/home/yanshaohui/study/zookeeper/server3/zookeeper-3.4.9/bin/zkCli.sh