阿里-Springboot+Dubbo2.7.3使用

准备工具:

  1. centos7

  2. 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


  1. 首先安装ZK
    1.1 上传tar包到centos中
    1.2 解压
      tar -zxf apache-zookeeper-3.5.5-bin.tar.gz 
    
image.png

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结束.


  1. 下载dubbo-admin
    2.1 项目打开并导入到IDEA


    阿里-Springboot+Dubbo2.7.3使用_第1张图片
    image.png

    2.2 打包

    mvn clean package
    
    2.3 启动
    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+Dubbo2.7.3使用_第2张图片
image.png


  1. springBoot-Dubbo


    阿里-Springboot+Dubbo2.7.3使用_第3张图片
    image.png
阿里-Springboot+Dubbo2.7.3使用_第4张图片
image.png

最后上代码:
github: https://github.com/zeminli/springboot-dubbo

你可能感兴趣的:(阿里-Springboot+Dubbo2.7.3使用)