通过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文件,修改配置文件如下
<span style="font-family:Microsoft YaHei;">##
# Copyright 1999-2011 Alibaba Group.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##
dubbo.container=log4j,spring,registry,jetty
dubbo.application.name=simple-monitor
dubbo.application.owner=
#dubbo.registry.address=127.0.0.1:2181,127.0.0.1:2182,127.0.0.1:2183
dubbo.registry.address=zookeeper://127.0.0.1:2181?backup=127.0.0.1:2182,127.0.0.1:2183
#dubbo.registry.address=zookeeper://127.0.0.1:2181
#dubbo.registry.address=redis://127.0.0.1:6379
#dubbo.registry.address=dubbo://127.0.0.1:9090
dubbo.protocol.port=7070
dubbo.jetty.port=8086
dubbo.jetty.directory=${user.home}/monitor
dubbo.charts.directory=${dubbo.jetty.directory}/charts
dubbo.statistics.directory=${user.home}/monitor/statistics
dubbo.log4j.file=logs/dubbo-monitor-simple.log
dubbo.log4j.level=WARN
</span>
打开cmd命令行,切换到bin文件夹,执行start.bat命令
执行完成后,输入地址http://localhost:8086/index.html
出现如下界面