Dubbo actual combat 4: management console Dubbo admin

osc_cxi2ewsx 2020-11-11 13:27:28
dubbo actual combat management console


Welcome to visit mine GitHub

Here we classify and summarize all the original works of Xinchen ( Including supporting source code ):https://github.com/zq2599/blog_demos

《dubbo actual combat 》 Series navigation

  1. Prepare and experience
  2. And SpringBoot Integrate
  3. Use Zookeeper Registry Center
  4. Administrative console dubbo-admin

An overview of this article

  • This article is about 《dubbo actual combat 》 The fourth in the series , The content is deployment and startup dubbo Administrative console service , The service is being developed 、 test 、 Production and other links are very important , Let's learn and understand it through actual combat , official GitHub Address :https://github.com/apache/dubbo-admin
  • The whole article consists of the following :
  1. preparation ( Registry Center 、 Service providers 、 Serving consumers );
  2. preparation ( Configuration information );
  3. Experience docker edition ;
  4. Download the source code and build it yourself ;

preparation ( Registry Center 、 Service providers 、 Serving consumers )

  1. The so-called preparatory work , Is to prepare a relatively complete dubbo Environmental Science , There's a registry in there 、 Service providers 、 Serving consumers ;
  2. In the last article 《dubbo The third part of the actual battle : Use Zookeeper Registry Center 》, We have created and validated service providers and consumers , And take zookeeper As a registry , Now please start all of these services , My service here is as follows :
service IP port Project name effect
zookeeper 192.168.50.43 2181 Registry Center 、 Configuration center effect
springboot-zk-provider 192.168.50.12 8080 springbootzkprovider Service providers
springboot-zk-consumer 192.168.50.12 8081 springbootzkconsumer Serving consumers
  1. Make sure zookeeper、 Service providers 、 All service consumers are activated and functioning properly ;

preparation ( Configuration information )

  1. The next step is to prepare the configuration information , The first thing to emphasize is dubbo-admin There are three important configuration items :admin.config-center( Configuration center ),admin.registry.address( Registry Center )、admin.metadata-report.address( Metadata Center );
  2. If there are only admin.registry.address( The old version did ), here dubbo-admin Will admin.registry.address The value of is used as registry and configuration center , The metadata center will not be available , Therefore, the official does not recommend such a configuration ;
  3. Officially recommended practice : In the configuration file, only admin.config-center, The value of this configuration is zookeeper Address , stay zookeeper There is a node in the service , The path is a /dubbo/config/dubbo/dubbo.properties, The content is admin.registry.address and admin.metadata-report.address Configuration of , As shown below :
dubbo.registry.address=zookeeper://127.0.0.1:2181
dubbo.metadata-report.address=zookeeper://127.0.0.1:2181
  1. In short , Only the address of the configuration center is placed in the local configuration file , wait until dubbo-admin After connecting to the configuration center , Get other configuration information from the configuration center , Draw a sketch to help understand , as follows :
     Insert picture description here
  2. Based on the above analysis , Let's go to zookeeper Create a good node in /dubbo/config/dubbo/dubbo.properties, In order to dubbo-admin Use , Please log in zookeeper Server , Get into zookeeper Of bin Catalog ;
  3. Because the previous article has used zookeeper As a registry , therefore "/dubbo/config/" The directory already exists , The following command creates /dubbo/config/dubbo node :
./zkCli.sh create /dubbo/config/dubbo ""
  1. To create a /dubbo/config/dubbo/dubbo.properties node :
./zkCli.sh create /dubbo/config/dubbo/dubbo.properties "dubbo.registry.address=zookeeper://192.168.50.43:2181
dubbo.metadata-report.address=zookeeper://192.168.50.43:2181"
  1. Last , See if it was created successfully , The input and response are as follows , Visible node created successfully , The value is also expected :
root@zookeeper:/opt/zookeeper-3.4.13/bin# ./zkCli.sh get /dubbo/config/dubbo/dubbo.properties
Connecting to localhost:2181
2020-10-25 03:47:50,512 [myid:] - INFO [main:Environment@100] - Client environment:zookeeper.version=3.4.13-2d71af4dbe22557fda74f9a9b4309b15a7487f03, built on 06/29/2018 04:05 GMT
environment:user.home=/root
2020-10-25 03:47:50,526 [myid:] - INFO [main:Environment@100] - Client environment:user.dir=/opt/zookeeper-3.4.13/bin
2020-10-25 03:47:50,529 [myid:] - INFO [main:ZooKeeper@442] - Initiating client connection, connectString=localhost:2181 sessionTimeout=30000 watcher=org.apache.zookeeper.ZooKeeperMain$MyWatcher@674e5e21
2020-10-25 03:47:50,584 [myid:] - INFO [main-SendThread(localhost:2181):ClientCnxn$SendThread@1029] - Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
WATCHER::
WatchedEvent state:SyncConnected type:None path:null
dubbo.registry.address=zookeeper://192.168.50.43:2181
dubbo.metadata-report.address=zookeeper://192.168.50.43:2181
cZxid = 0x6b5
ctime = Sun Oct 25 03:47:30 UTC 2020
mZxid = 0x6b5
mtime = Sun Oct 25 03:47:30 UTC 2020
pZxid = 0x6b5
cversion = 0
dataVersion = 0
aclVersion = 0
ephemeralOwner = 0x0
dataLength = 114
numChildren = 0
  1. thus , The preparatory work is all finished , You can deploy and try dubbo-admin 了 , Let's start with the official recommended quick experience , namely docker edition ;

Experience docker edition

  1. Please make sure docker Deployed and working properly ;
  2. official Github Recommended by docker Mirror quick experience management console , Here's the picture , Let's use... According to the official suggestion docker Try the mirror image :
     Insert picture description here
  3. Download mirroring ( This step may not be performed , I want to see how long it takes to download the image ):
docker pull apache/dubbo-admin
  1. Execute the following command to start docker Containers :
docker run \
-p 8083:8080 \
-e admin.config-center=zookeeper://192.168.50.43:2181 \
--rm \
apache/dubbo-admin
  1. The container started with the above command is one-time , If you use Ctrl+C Interrupt console , The container will be destroyed automatically , In addition, the container's 8080 The port is mapped to the host's 8083 port ;

  2. Access the host with a browser 8083 port , As shown in the figure below ,dubbo-admin It's already started :
     Insert picture description here

  3. Click on the red box below 1 Service query menu in , You can see all the exposed services in the entire distributed environment ( That's the red box 2), At this point, click on the right DETAIL Button , You can see the details of this service :
     Insert picture description here

  4. The service details are shown in the figure below , Basic information 、 Provider 、 Consumers have , Unfortunately, metadata cannot be displayed properly :
     Insert picture description here

  5. The above is the official version of the experience , Let's have a basic understanding of the management console , But it's just a mirror image of the experience , In the actual production environment , First of all, you may not be able to use docker, And may need to have the corresponding source code in order to learn and analyze the problem , It's even possible to do further customization with the source code , So the docker The version doesn't fit , Let's download it together dubbo-admin Self compilation and construction of source code ;

  6. Start up docker The container's console executes Ctrl+C, The container you just created will be destroyed automatically ;

Download the source code and build it yourself

  1. Download the official source code :
git clone https://github.com/apache/dubbo-admin.git
  1. Modify the configuration file dubbo-admin/dubbo-admin-server/src/main/resources/application.properties , As shown below , Configure only admin.registry.address Value , take admin.registry.address and admin.metadata-report.address Comment out , If you want to modify the port , Also add here server.port Configuration of , What I have here is 8083 port :
server.port=8083
# centers in dubbo2.7
#admin.registry.address=zookeeper://127.0.0.1:2181
admin.config-center=zookeeper://192.168.50.43:2181
#admin.metadata-report.address=zookeeper://127.0.0.1:2181
admin.root.user.name=root
admin.root.user.password=root
#group
admin.registry.group=dubbo
admin.config-center.group=dubbo
admin.metadata-report.group=dubbo
admin.apollo.token=e16e5cd903fd0c97a116c873b448544b9d086de9
admin.apollo.appId=test
admin.apollo.env=dev
admin.apollo.cluster=default
admin.apollo.namespace=dubbo
#compress
server.compression.enabled=true
server.compression.mime-types=text/css,text/javascript,application/javascript
server.compression.min-response-size=10240
  1. stay dubbo-admin The directory executes the following commands , Start compilation :
mvn clean compile -U
  1. If there is no accident, it will compile successfully , as follows :
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ dubbo-admin-test ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 6 source files to /Users/zhaoqin/temp/202010/24/dubbo-admin/dubbo-admin-test/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for dubbo-admin 0.2.0-SNAPSHOT:
[INFO]
[INFO] dubbo-admin ........................................ SUCCESS [ 1.997 s]
[INFO] dubbo-admin-ui ..................................... SUCCESS [ 44.322 s]
[INFO] dubbo-admin-server ................................. SUCCESS [ 4.731 s]
[INFO] dubbo-admin-distribution ........................... SUCCESS [ 0.850 s]
[INFO] dubbo-admin-test ................................... SUCCESS [ 0.815 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 53.105 s
[INFO] Finished at: 2020-10-25T16:24:27+08:00
[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "nexus" could not be activated because it does not exist.
  1. Start the service :
mvn --projects dubbo-admin-server spring-boot:run
  1. After successful startup , Visit the login page in the browser :http://localhost:8083/#/login ,( Be sure to log in first ), Here's the picture , The account and password are root, This is a application.properties Configured in the file :
     Insert picture description here
  2. After login, you can see the home page , Here's the picture , And before docker The experience version is still a little different :
     Insert picture description here
  3. Click the test button in the figure above , You can test the service on the page :
     Insert picture description here
  4. Go back to the service details page again , The metadata can also be displayed normally :
     Insert picture description here

Summary

thus , Administrative console dubbo-admin Compilation of 、 Deploy 、 The basic operations have been completed , More features on the web page you can try ,( It is recommended to deploy more services and instances ), Looking back on the whole process is actually very simple , The only thing to pay attention to is the configuration of the service , Local only configuration center address , Other information is in the configuration center ;

Welcome to the official account : Xinchen, programmer

WeChat search 「 Xinchen, programmer 」, I'm Xinchen , Looking forward to traveling with you Java The world …

版权声明
本文为[osc_cxi2ewsx]所创,转载请带上原文链接,感谢

  1. 【计算机网络 12(1),尚学堂马士兵Java视频教程
  2. 【程序猿历程,史上最全的Java面试题集锦在这里
  3. 【程序猿历程(1),Javaweb视频教程百度云
  4. Notes on MySQL 45 lectures (1-7)
  5. [computer network 12 (1), Shang Xuetang Ma soldier java video tutorial
  6. The most complete collection of Java interview questions in history is here
  7. [process of program ape (1), JavaWeb video tutorial, baidu cloud
  8. Notes on MySQL 45 lectures (1-7)
  9. 精进 Spring Boot 03:Spring Boot 的配置文件和配置管理,以及用三种方式读取配置文件
  10. Refined spring boot 03: spring boot configuration files and configuration management, and reading configuration files in three ways
  11. 精进 Spring Boot 03:Spring Boot 的配置文件和配置管理,以及用三种方式读取配置文件
  12. Refined spring boot 03: spring boot configuration files and configuration management, and reading configuration files in three ways
  13. 【递归,Java传智播客笔记
  14. [recursion, Java intelligence podcast notes
  15. [adhere to painting for 386 days] the beginning of spring of 24 solar terms
  16. K8S系列第八篇(Service、EndPoints以及高可用kubeadm部署)
  17. K8s Series Part 8 (service, endpoints and high availability kubeadm deployment)
  18. 【重识 HTML (3),350道Java面试真题分享
  19. 【重识 HTML (2),Java并发编程必会的多线程你竟然还不会
  20. 【重识 HTML (1),二本Java小菜鸟4面字节跳动被秒成渣渣
  21. [re recognize HTML (3) and share 350 real Java interview questions
  22. [re recognize HTML (2). Multithreading is a must for Java Concurrent Programming. How dare you not
  23. [re recognize HTML (1), two Java rookies' 4-sided bytes beat and become slag in seconds
  24. 造轮子系列之RPC 1:如何从零开始开发RPC框架
  25. RPC 1: how to develop RPC framework from scratch
  26. 造轮子系列之RPC 1:如何从零开始开发RPC框架
  27. RPC 1: how to develop RPC framework from scratch
  28. 一次性捋清楚吧,对乱糟糟的,Spring事务扩展机制
  29. 一文彻底弄懂如何选择抽象类还是接口,连续四年百度Java岗必问面试题
  30. Redis常用命令
  31. 一双拖鞋引发的血案,狂神说Java系列笔记
  32. 一、mysql基础安装
  33. 一位程序员的独白:尽管我一生坎坷,Java框架面试基础
  34. Clear it all at once. For the messy, spring transaction extension mechanism
  35. A thorough understanding of how to choose abstract classes or interfaces, baidu Java post must ask interview questions for four consecutive years
  36. Redis common commands
  37. A pair of slippers triggered the murder, crazy God said java series notes
  38. 1、 MySQL basic installation
  39. Monologue of a programmer: despite my ups and downs in my life, Java framework is the foundation of interview
  40. 【大厂面试】三面三问Spring循环依赖,请一定要把这篇看完(建议收藏)
  41. 一线互联网企业中,springboot入门项目
  42. 一篇文带你入门SSM框架Spring开发,帮你快速拿Offer
  43. 【面试资料】Java全集、微服务、大数据、数据结构与算法、机器学习知识最全总结,283页pdf
  44. 【leetcode刷题】24.数组中重复的数字——Java版
  45. 【leetcode刷题】23.对称二叉树——Java版
  46. 【leetcode刷题】22.二叉树的中序遍历——Java版
  47. 【leetcode刷题】21.三数之和——Java版
  48. 【leetcode刷题】20.最长回文子串——Java版
  49. 【leetcode刷题】19.回文链表——Java版
  50. 【leetcode刷题】18.反转链表——Java版
  51. 【leetcode刷题】17.相交链表——Java&python版
  52. 【leetcode刷题】16.环形链表——Java版
  53. 【leetcode刷题】15.汉明距离——Java版
  54. 【leetcode刷题】14.找到所有数组中消失的数字——Java版
  55. 【leetcode刷题】13.比特位计数——Java版
  56. oracle控制用户权限命令
  57. 三年Java开发,继阿里,鲁班二期Java架构师
  58. Oracle必须要启动的服务
  59. 万字长文!深入剖析HashMap,Java基础笔试题大全带答案
  60. 一问Kafka就心慌?我却凭着这份,图灵学院vip课程百度云