1.Dubbo源码下载与编译
1.1 源码下载地址
https://github.com/apache/dubbo/tree/2.5.x?utm_source=csdn_toolbar
1.2 解压缩
1.3 cmd管理员身份运行
进入dubbo-2.5.10目录下执行 mvn clean package -Dmaven.test.skip=true 会生成如下结果**[注意:
以管理员身份进入]**
1.4 编译成功
1.5 检查一下我们需要的内容
2.管理控制台
开源的Dubbo服务管理控制台是阿里巴巴内部裁剪的版本,开源的部分功能包括:路由规则,动态配置,访问控制,权重调整,负载均衡等管理功能。
2.1 步骤一
将生成的dubbo-admin-2.5.10.war拷贝到web容器中并解压缩(此处使用tomcat8)
2.2 修改dubbo的属性文件
dubbo.registry.address=zookeeper://192.168.134.129:2181?
backup=192.168.134.131:2181,192.168.134.132:2181
dubbo.admin.root.password=root
dubbo.admin.guest.password=guest
2.3 启动Tomca即可
2.4 浏览器登录
登录地址:http://localhost:8080/dubbo-admin-2.5.10/
默认的账号密码:root root
3.监控平台
Dubbo-Monitor主要是用来统计服务和调用次数和调用时间,服务消费者和提供者,在内存中累计调用次数和调用时间,定时每分钟发送一次统计数据到监控中心,监控中心则使用绘制图表来显示
3.1 开启monitor服务
需要在服务提供者和消费者中开启monitor服务,我们只需要在对应的配置文件中添加相关信息
<!--开启监控-->
<dubbo:monitor protocol="registry"/>
3.2 解压缩文件和修改配置
解压缩后的结构
bin:可执行程序
conf:配置文件
lib:相关的jar
进入conf修改配置
修改,添加圈圈里面的
修改后的文件内容
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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=
#zookeeper的配置信息
zookeeper://192.168.134.129:2181?backup=192.168.134.131:2181,192.168.134.132:2181
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=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
dubbo.log4j.level=WARN
3.3 启动监控服务
启动服务的程序在bin目录下,双击启动
3.4 启动成功
3.5 访问服务
地址:http://localhost:8080