Dubbo-Zookeeper注册中心的安装及简单使用

/ dubbozookeeper / 0 条评论 / 256浏览

1. zookeeper安装(注册中心)

tar -zxvf zookeeper-3.4.11.tar.gz
cd zookeeper-3.4.11
mkdir data
mkdir log
cd conf/
cp zoo_sample.cfg zoo.cfg
tickTime=2000
initLimit=10
syncLimit=5
dataDir=../data
dataLogDir=../log
clientPort=2181
vim /etc/profile

# 添加下面两条
export ZOOKEEPER=/usr/local/src/zookeeper-3.4.11
export PATH=$PATH:$ZOOKEEPER/bin

# source 保存生效
source /etc/profile
# 启动
zkServer.sh start

# 出现以下即为启动成功
ZooKeeper JMX enabled by default
Using config: /usr/local/src/zookeeper-3.4.11/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
zkServer.sh status
 zkCli.sh
# 跟节点下的值
get /

# 跟节点下的节点
ls /

# 创建一个临时节点
create -e /test 123456

# 查看节点的值
get /test

2. dubbo可视化界面(监控中心)

https://github.com/apache/incubator-dubbo-admin/tree/master

 cd Downloads/incubator-dubbo-admin-master/dubbo-admin/
mvn clean package
cd target
java -jar dubbo-admin-0.0.1-SNAPSHOT.jar

3. 创建dubbo服务

源码见本人的Github https://github.com/NikoHXX/SpringBoot-Dubbo-provider-consumer

网站运行: