准备工具:
-
centos7
-
zookeeper-3.5.5 [https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/zookeeper-3.5.5/]
3.dubbo-admin https://github.com/apache/dubbo-admin
- 首先安装ZK
1.1 上传tar包到centos中
1.2 解压tar -zxf apache-zookeeper-3.5.5-bin.tar.gz
1.3配置
cd /usr/soft/zk/conf #zk的conf 目录
[root@localhost conf]# cp zoo_sample.cfg zoo.cfg
[root@localhost conf]# vim 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=/usr/soft/zk/data # 子集mkdir -p 创建目录
# 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
最后:wq 保存退出
/usr/soft/zk/bin
[root@localhost bin]# ./zkServer.sh start
[root@localhost bin]# ./zkServer.sh status
ZooKeeper JMX enabled by default
Using config: /usr/soft/zk/bin/../conf/zoo.cfg
Client port found: 2181. Client address: localhost.
Mode: standalone
ZK结束.
-
下载dubbo-admin
2.1 项目打开并导入到IDEA
image.png
2.2 打包
2.3 启动mvn clean package
mvn --projects dubbo-admin-server spring-boot:run OR cd dubbo-admin-distribution/target; java -jar dubbo-admin-0.1.jar
2.4访问
http://localhost:8080/#/service
-
springBoot-Dubbo
image.png
最后上代码:
github: https://github.com/zeminli/springboot-dubbo
网友评论