安装dubbo的监控中心dubbo-monitor-simple
1、下载dubbo-monitor-simple
2、修改配置指定注册中心地址
进入dubbo-monitor-simple\src\main\resources\conf目录修改 dubbo.properties文件
# 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-monitor
dubbo.application.name=simple-monitor
dubbo.application.owner=dubbo
#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=${user.home}/monitor/charts
dubbo.statistics.directory=${user.home}/monitor/statistics
dubbo.log4j.file=logs/dubbo-monitor-simple.log
dubbo.log4j.level=WARN
3、打包dubbo-monitor-simple
进入pom.xml文件所在目录D:\BaiduNetdiskDownload\Dubbo\incubator-dubbo-ops-master\dubbo-monitor-simple
运行mvn clean package -Dmaven.test.skip=true命令进行打包
4、解压dubbo-monitor-simple-2.0.0-assembly.tar.gz文件
5、进入D:\BaiduNetdiskDownload\Dubbo\dubbo-monitor-simple-2.0.0\assembly.bin目录,运行start.bat
6、在浏览器中访问8080端口
7、配置监控中心
所有服务配置连接监控中心,进行监控统计
<!-- 监控中心协议,如果为protocol="registry",表示从注册中心发现监控中心地址,否则直连监控中心 -->
<dubbo:monitor protocol="registry"></dubbo:monitor>
Simple Monitor 挂掉不会影响到 Consumer 和 Provider 之间的调用,所以用于生产环境不会有风险。Simple Monitor 采用磁盘存储统计信息,请注意安装机器的磁盘限制,如果要集群,建议用mount共享磁盘。
1)、在服务提供者user-service-provider的配置文件provider.xml中添加如下内容:
<!-- 连接监控中心 -->
<dubbo:monitor protocol="registry"></dubbo:monitor>
<!--直连监控中心-->
<!-- <dubbo:monitor address="127.0.0.1:7070"></dubbo:monitor> -->
添加后的provider.xml文件内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd"> <!-- 1、指定当前服务/应用的名字(同样的服务名字相同,不要和别的服务同名) -->
<dubbo:application name="user-service-provider"></dubbo:application> <!-- 2、指定注册中心的位置 -->
<!-- <dubbo:registry address="zookeeper://127.0.0.1:2181"></dubbo:registry> -->
<dubbo:registry protocol="zookeeper" address="127.0.0.1:2181"></dubbo:registry> <!-- 3、指定通信规则(通信协议&通信端口) -->
<dubbo:protocol name="dubbo" port="20880"></dubbo:protocol> <!-- 4、暴露服务 ref:指向服务的真正的实现对象 -->
<dubbo:service interface="com.lina02.gmall.service.UserService" ref="userServiceImpl"/> <!-- 服务的实现 -->
<bean id="userServiceImpl" class="com.lina02.gmall.service.impl.UserServiceImpl"></bean> <!-- 连接监控中心 -->
<dubbo:monitor protocol="registry"></dubbo:monitor>
<!--直连监控中心-->
<!-- <dubbo:monitor address="127.0.0.1:7070"></dubbo:monitor> -->
</beans>
2)在服务消费者order-service-consumer的配置文件consumer.xml中添加如下内容:
<!-- 连接监控中心 -->
<dubbo:monitor protocol="registry"></dubbo:monitor>
<!--直连监控中心-->
<!-- <dubbo:monitor address="127.0.0.1:7070"></dubbo:monitor> -->
添加后的consumer.xml文件内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:dubbo="http://dubbo.apache.org/schema/dubbo"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd
http://dubbo.apache.org/schema/dubbo http://dubbo.apache.org/schema/dubbo/dubbo.xsd
http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
<context:component-scan base-package="com.lina02.gmall.service.impl"></context:component-scan> <dubbo:application name="order-service-consumer"></dubbo:application> <dubbo:registry address="zookeeper://127.0.0.1:2181"></dubbo:registry> <!--声明需要调用的远程服务的接口;生成远程服务代理 -->
<dubbo:reference interface="com.lina02.gmall.service.UserService" id="userService">
</dubbo:reference> <!-- 连接监控中心 -->
<dubbo:monitor protocol="registry"></dubbo:monitor>
<!--直连监控中心-->
<!-- <dubbo:monitor address="127.0.0.1:7070"></dubbo:monitor> --> </beans>
8、查看监控中心
安装dubbo的监控中心dubbo-monitor-simple的更多相关文章
- dubbo之监控中心(monitor)
一.monitor是dubbo框架中的一个监控中心.这个只是针对于消费者和提供者进行一个数据记录,不参与业务和使用.当然当monitor挂掉之后,也不会影响服务的正常运行. 二.在阿里的dubbo中也 ...
- 【Dubbo篇】--Dubbo框架的使用
一.前述 Dubbo是一种提供高性能,透明化的RPC框架.是阿里开源的一个框架. 官网地址:http://dubbo.io/ 二.架构 组件解释: Provider: 提供者.发布服务的项目.Regi ...
- Spring Boot 2.x (十五):Dubbo + Zookeeper + 新版Dubbo Admin
Dubbo 简介 Dubbo是阿里巴巴公司开源的一个高性能优秀的服务框架,使得应用可通过高性能的RPC实现服务的输出和输入功能,可以和Spring框架无缝集成. 它提供了三大核心能力: 面向接口的远程 ...
- Dubbo学习(六) dubbo 架构图 以及调用过程
一.Dubbo结构图 duubo结构图 我们解释以下这个架构图:Consumer服务消费者,Provider服务提供者.Container服务容器.消费当然是invoke提供者了,invoke这条 ...
- Dubbo学习(二) Dubbo 集群容错模式-负载均衡模式
Dubbo是Alibaba开源的分布式服务框架,我们可以非常容易地通过Dubbo来构建分布式服务,并根据自己实际业务应用场景来选择合适的集群容错模式,这个对于很多应用都是迫切希望的,只需要通过简单的配 ...
- 【Dubbo】Zookeeper+Dubbo项目demo搭建
一.Dubbo的注解配置 在Dubbo 2.6.3及以上版本提供支持. 1.@Service(全路径@org.apache.dubbo.config.annotation.Service) 配置服务提 ...
- 【Dubbo基础】dubbo学习过程、使用经验分享及实现原理简单介绍
一.前言 部门去年年中开始各种改造,第一步是模块服务化,这边初选dubbo试用在一些非重要模块上,慢慢引入到一些稍微重要的功能上,半年时间,学习过程及线上使用遇到的些问题在此总结下. 整理这篇文章差不 ...
- Dubbo API 笔记——Dubbo架构与使用
转载于: https://blog.csdn.net/benhuo931115/article/details/78457149 架构演变 单一应用架构 所有功能部署在一个应用上,用于简化增删改查工作 ...
- DUBBO初探-搭建DUBBO开发环境
我所理解的DUBBO 相对于传统web开发框架,dubbo更加适合于并行系统开发,分布式,模块化.将server和client都注册到zookeeper注册中心上,然后由最外层客户端发起请求到相应cl ...
随机推荐
- linux下把命令执行的结果输出
我们知道在linux下当我们想把文字用命令输入到一个文本下时可以用echo命令 例:echo "nihao" > /z.txt 同样当我们想把命令执行的结果也输入到一个文 ...
- ubuntu熟悉过程中遇到一些小问题记录一下
0. 使用su命令时提示: authentication failur 安装ubuntu系统默认是没有激活root用户的,需要我们手工进行操作,在命令行界面下,或者在终端中输入如下命令:sudo p ...
- Jmeter 施压 SQL server数据库的时候,如何设置?
1. 在应用Jmeter进行施压之前,有个重要的端口需要手动查找出来.该端口在第三部要使用.开始——程序——microsoft SQL Server 2008R2——配置工具——SQL Server ...
- bzoj 1098 [POI2007]办公楼biu——链表
题目:https://www.lydsy.com/JudgeOnline/problem.php?id=1098 求补图的连通块大小.与自己没有边的和自己在一个连通块里. 用链表把所有点串起来.先给自 ...
- bzoj 3309 DZY Loves Math——反演+线性筛
题目:https://www.lydsy.com/JudgeOnline/problem.php?id=3309 像这种数据范围,一般是线性预处理,每个询问 sqrt (数论分块)做. 先反演一番.然 ...
- POJ1742(多重部分和问题:模板题)
Coins Time Limit: 3000MS Memory Limit: 30000K Total Submissions: 32776 Accepted: 11131 Descripti ...
- 想要删除table的某一行的js写法
<tr><td onclick="del_tr(this)" >删除</td></tr> // 删除一行 function del_ ...
- 【网络爬虫】【java】微博爬虫(三):庖丁解牛——HTML结构分析与正则切分
在上一篇文章中已经通过请求的url地址把html页面爬取下来了,这里分别以网易微博的html和新浪微博的html为例来分析如何提取微博数据. 一.网易微博解析 相比新浪微博的html结构,网易微博的比 ...
- tomcat的bin文件夹下的.bat和.sh文件
tomcat的bin文件夹中存在一份.bat文件和相对应的.sh文件,一个是为了在window系统上执行的文件,另一个是linux下的批处理文件.例如:startup.bat和startup.sh. ...
- UVa 12105 Bigger is Better (DP)
题意:用不超过 n 根火柴,组成一个尽可能大的数. 析:很明显的一个DP题,首先不难想到这个dp[i][j] 表示前 i 根火柴,所能拼出的取模 m 为 j 的数,状态转移方程也很好写, dp[i][ ...