本文共 2083 字,大约阅读时间需要 6 分钟。
1.修改项目配置
vim /xx/WEB-INF/classes/dubbo.properties
dubbo.monitor.protocol=registry
2.dubbo-monitor 配置
##
# 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=zookeeper://ip1:2181?backup=ip2:2182,ip3:2183
#dubbo.registry.address=multicast://224.5.6.7:1234
#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=9090
dubbo.jetty.directory=data/monitor
dubbo.charts.directory=${dubbo.jetty.directory}/charts
dubbo.statistics.directory=${dubbo.jetty.directory}/statistics
#dubbo.jetty.directory=${user.home}/monitor
#dubbo.jetty.directory=/root/monitor
#dubbo.charts.directory=${dubbo.jetty.directory}/charts
#dubbo.statistics.directory=/root/monitor/statistics
dubbo.registry.group=xx
dubbo.monitor.name=xx (这两个xx跟项目一致就行)
dubbo.monitor.protocol=registry
dubbo.log4j.file=logs/dubbo-monitor-simple.log
dubbo.log4j.level=WARN
3.建立目录
cd /home/dm/dubbo-monitor-simple-2.5.3
mkdir -p data/monitor
mkdir -p data/monitor/{statistics,charts}
4.访问http://ip:9090/
注意的问题,你可能会遇到的坑。
1.问题已解决,又新下载了一个dubbo-monitor的war包(之前已经下载n个),本地启动后,没有任何问题。经过对比之后发现,其下的dubbo-2.8.4.jar的大小不一样,更换后发现,同样没有再报错。不知道为什么同样的版本的jar,大小会不一样,可能打包的人做了什么更改吧。总之保持自己服务引用的jar版本和dubbo-monitor下的版本保持一致,应该就不会有问题了。仅此献给受到同样困扰的后人!
2.https://github.com/alibaba/dubbo/issues/237
本文转自 liqius 51CTO博客,原文链接:http://blog.51cto.com/szgb17/1874420,如需转载请自行联系原作者