Dubbo监控中
这里写代码片
心,是用来查看服务的服务的调用情况等统计,为服务的运维采集数据。Monitor不是必须的,监控中心的失败,对于我们dubbo的正常服务是没有影响的
原版monitor 控制台
dubbo-monitor-simple-2.5.3-assembly.tar.gz
#码云地址
https://gitee.com/yellowcong/dubbo/tree/master/dubbo-monitor
#七牛云直接下载地址
http://yellowcong.qiniudn.com/dubbo-monitor-simple-2.5.3-assembly.tar.gz
解压
解压后目录结构如下图,我们主要修改conf目录下的dubbo.properties
dubbo.properties配置
1、需要修改zookeeper端口
2、修改jetty端口
3、monitor服务端口号, monitor本身就是一个dubbo服务
##
# 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=multicast://224.5.6.7:1234
#dubbo的zookeeper地址 需要修改 ,我这个是伪集群,所以都是一台机器
dubbo.registry.address=zookeeper://127.0.0.1:2181?backup=127.0.0.1:2182,127.0.0.1:2183
#dubbo.registry.address=redis://127.0.0.1:6379
#dubbo.registry.address=dubbo://127.0.0.1:9090
#这个monitor服务启动端口号
dubbo.protocol.port=7070
#web访问端口
dubbo.jetty.port=8080
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
开启端口
#修改配置文件, 这种改配置文件的方式相比命令的方式简单些
vim /etc/sysconfig/iptables
#添加两条规则
-A INPUT -p tcp -m tcp --dport 8090 -m state --state NEW,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m tcp --dport 7070 -m state --state NEW,ESTABLISHED -j ACCEPT
#重启防火墙生效
service iptables restart
#查看添加上规则了没有
iptables -L -n
注册服务
到 bin目录,启动服务
#启动服务
./start.sh
web打开
在浏览器中输入 主机ip:8090,就可以访问到监控中心了
dubbo-monitor
这个是人家基于原始版本的monitor更改而来的,效果杠杠滴,但是这个是支持的Dubbox的,这点需要注意
https://gitee.com/handu/dubbo-monitor.git