Dubbo后台管理和监控中心部署

原文:https://blog.csdn.net/zx13525079024/article/details/52260141


通过dubbo监控中心和后台管理可以很好的监控dubbo服务,监控服务端服务和客户端调用情况,调用次数,调用日志,方便问题查找。下面我们看看dubbo的管理后台和监控中心怎么部署。

  1.软件下载

    部署管理后台和监控中心需要以下软件

   opensesame  下载地址:https://github.com/alibaba/opensesame

   Dubbo源码下载  https://github.com/alibaba/dubbo

    

    Tomcat下载地址 http://tomcat.apache.org/download-70.cgi

  2.编译

    

下载完成后,解压,切换到opensesame-master目录下(如上图),打开CMD命令,执行如下命令

mvn install -Dmaven.test.skip=true



3.dubbo-admin部署

dubbo管理平台dubbo-admin部署

解压dubbo-master文件夹,打开CMD命令,切换到dubbo-master目录,执行

mvn install -Dmaven.test.skip=true命令,完成后,会看到dubbo-admin的target文件夹下有dubbo-admin-2.5.4-SNAPSHOT.war

 如下图


解压tomcat,将dubbo-admin-2.5.4-SNAPSHOT.war包拷贝到Tomcat的webapps文件夹下

然后启动tomcat,启动tomcat的方法如下,

切换到tomcat的bin文件夹,启动startup.bat命令

目录如下


命令如下


  此时dubbo-admin-2.5.4-SNAPSHOT.war会自动解压,在webapps目录下生成一个dubbo-admin-2.5.4-SNAPSHOT文件夹,


将webapps下的root文件夹下的内容全部删除,将dubbo-admin-2.5.4-SNAPSHOT文件夹下的内容全部拷贝到Root文件夹下,最终结果如下图



修改下root文件夹下web-inf文件夹下的dubbo.properties文件,

文件内容如下

dubbo.registry.address=127.0.0.1:2181,127.0.0.1:2182,127.0.0.1:2183

dubbo.admin.root.password=root

dubbo.admin.guest.password=guest

打开浏览器输入地址: http://localhost:8080/,输入账号和密码登录guest/guest




4.dubbo监控平台monitor部署

在本地仓库中或者dubbo-monitor-simple项目中找到dubbo-monitor-simple-2.5.4-SNAPSHOT-assembly.tar.gz文件,拷贝到D盘,解压后如下图


找到conf文件夹下的dubbo.properties文件,修改配置文件如下

[html]  view plain  copy
  1. <span style="font-family:Microsoft YaHei;">##  
  2. # Copyright 1999-2011 Alibaba Group.  
  3. #    
  4. # Licensed under the Apache License, Version 2.0 (the "License");  
  5. # you may not use this file except in compliance with the License.  
  6. # You may obtain a copy of the License at  
  7. #    
  8. #      http://www.apache.org/licenses/LICENSE-2.0  
  9. #    
  10. # Unless required by applicable law or agreed to in writing, software  
  11. # distributed under the License is distributed on an "AS IS" BASIS,  
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  
  13. # See the License for the specific language governing permissions and  
  14. # limitations under the License.  
  15. ##  
  16. dubbo.container=log4j,spring,registry,jetty  
  17. dubbo.application.name=simple-monitor  
  18. dubbo.application.owner=  
  19. #dubbo.registry.address=127.0.0.1:2181,127.0.0.1:2182,127.0.0.1:2183  
  20. dubbo.registry.address=zookeeper://127.0.0.1:2181?backup=127.0.0.1:2182,127.0.0.1:2183  
  21. #dubbo.registry.address=zookeeper://127.0.0.1:2181  
  22. #dubbo.registry.address=redis://127.0.0.1:6379  
  23. #dubbo.registry.address=dubbo://127.0.0.1:9090  
  24. dubbo.protocol.port=7070  
  25. dubbo.jetty.port=8086  
  26. dubbo.jetty.directory=${user.home}/monitor  
  27. dubbo.charts.directory=${dubbo.jetty.directory}/charts  
  28. dubbo.statistics.directory=${user.home}/monitor/statistics  
  29. dubbo.log4j.file=logs/dubbo-monitor-simple.log  
  30. dubbo.log4j.level=WARN  
  31. </span>  



打开cmd命令行,切换到bin文件夹,执行start.bat命令


执行完成后,输入地址http://localhost:8086/index.html

出现如下界面