I. Introduction
dubbo-monitor is mainly used for the monitoring center, service consumers and providers, which is mainly used to count the invocation times and invocation time of services. The data is graphed to display.
2. Construction of dubbo-monitor-simple
The service provider and consumer need to configure the following:
protocol is "registry", which means that the service provider and consumer discover the monitor address from the registry.Download the source code
Download the source code of dubbo at https://github.com/alibaba/dubbo/tree/2.5.x- Unzip the source code and enter the dubbo-2.5.x directory, the contents are as follows:
在该目录执行mvn clean package -Dmaven.test.skip=true会生成如下结果:
[INFO] ————————————————————————
[INFO] Reactor Summary:
[INFO]
[INFO] dubbo-parent ……………………………….. SUCCESS [2.857s]
[INFO] Hessian Lite(Alibaba embed version) …………… SUCCESS [6.518s]
[INFO] dubbo-common ……………………………….. SUCCESS [7.706s]
[INFO] dubbo-container …………………………….. SUCCESS [0.057s]
[INFO] dubbo-container-api …………………………. SUCCESS [3.398s]
[INFO] dubbo-container-spring ………………………. SUCCESS [1.099s]
[INFO] dubbo-container-jetty ……………………….. SUCCESS [1.164s]
[INFO] dubbo-container-log4j ……………………….. SUCCESS [1.196s]
[INFO] dubbo-container-logback ……………………… SUCCESS [1.138s]
[INFO] dubbo-remoting ……………………………… SUCCESS [0.045s]
[INFO] dubbo-remoting-api ………………………….. SUCCESS [3.615s]
[INFO] dubbo-remoting-netty ………………………… SUCCESS [1.959s]
[INFO] dubbo-remoting-mina …………………………. SUCCESS [1.602s]
[INFO] dubbo-remoting-grizzly ………………………. SUCCESS [1.752s]
[INFO] dubbo-remoting-p2p ………………………….. SUCCESS [2.148s]
[INFO] dubbo-remoting-http …………………………. SUCCESS [2.154s]
[INFO] dubbo-remoting-zookeeper …………………….. SUCCESS [2.165s]
[INFO] dubbo-remoting-netty4 ……………………….. SUCCESS [2.721s]
[INFO] dubbo-rpc ………………………………….. SUCCESS [0.060s]
[INFO] dubbo-rpc-api ………………………………. SUCCESS [3.397s]
[INFO] dubbo-rpc-default …………………………… SUCCESS [3.278s]
[INFO] dubbo-rpc-injvm …………………………….. SUCCESS [1.706s]
[INFO] dubbo-rpc-rmi ………………………………. SUCCESS [1.373s]
[INFO] dubbo-rpc-hessian …………………………… SUCCESS [1.791s]
[INFO] dubbo-rpc-http ……………………………… SUCCESS [1.210s]
[INFO] dubbo-rpc-webservice ………………………… SUCCESS [1.816s]
[INFO] dubbo-cluster ………………………………. SUCCESS [2.690s]
[INFO] dubbo-registry ……………………………… SUCCESS [0.033s]
[INFO] dubbo-registry-api ………………………….. SUCCESS [2.548s]
[INFO] dubbo-monitor ………………………………. SUCCESS [0.020s]
[INFO] dubbo-monitor-api …………………………… SUCCESS [1.309s]
[INFO] dubbo-filter ……………………………….. SUCCESS [0.023s]
[INFO] dubbo-filter-validation ……………………… SUCCESS [1.474s]
[INFO] dubbo-filter-cache ………………………….. SUCCESS [1.395s]
[INFO] dubbo-registry-default ………………………. SUCCESS [1.402s]
[INFO] dubbo-monitor-default ……………………….. SUCCESS [1.258s]
[INFO] dubbo-registry-multicast …………………….. SUCCESS [1.336s]
[INFO] dubbo-config ……………………………….. SUCCESS [0.018s]
[INFO] dubbo-config-api ……………………………. SUCCESS [3.498s]
[INFO] dubbo-config-spring …………………………. SUCCESS [3.326s]
[INFO] dubbo-rpc-thrift ……………………………. SUCCESS [2.115s]
[INFO] dubbo-rpc-memcached …………………………. SUCCESS [1.476s]
[INFO] dubbo-rpc-redis …………………………….. SUCCESS [1.367s]
[INFO] dubbo-registry-zookeeper …………………….. SUCCESS [1.597s]
[INFO] dubbo-registry-redis ………………………… SUCCESS [2.111s]
[INFO] dubbo-plugin ……………………………….. SUCCESS [0.027s]
[INFO] dubbo-qos ………………………………….. SUCCESS [2.574s]
[INFO] dubbo ……………………………………… SUCCESS [2.662s]
[INFO] dubbo-simple ……………………………….. SUCCESS [0.017s]
[INFO] dubbo-registry-simple ……………………….. SUCCESS [5.246s]
[INFO] dubbo-monitor-simple ………………………… SUCCESS [11.301s]
[INFO] dubbo-admin ………………………………… SUCCESS [11.472s]
[INFO] dubbo-demo …………………………………. SUCCESS [0.034s]
[INFO] dubbo-demo-api ……………………………… SUCCESS [1.097s]
[INFO] dubbo-demo-provider …………………………. SUCCESS [1.892s]
[INFO] dubbo-demo-consumer …………………………. SUCCESS [1.473s]
[INFO] dubbo-test …………………………………. SUCCESS [0.022s]
[INFO] dubbo-test-benchmark ………………………… SUCCESS [5.324s]
[INFO] dubbo-test-compatibility …………………….. SUCCESS [0.017s]
[INFO] dubbo-test-spring3 ………………………….. SUCCESS [1.719s]
[INFO] dubbo-test-integration ………………………. SUCCESS [0.149s]
[INFO] dubbo-test-examples …………………………. SUCCESS [3.413s]
[INFO] ————————————————————————
[INFO] BUILD SUCCESS
[INFO] ————————————————————————
[INFO] Total time: 2:16.562s
[INFO] Finished at: Wed Mar 14 17:19:06 CST 2018
[INFO] Final Memory: 38M/654M
[INFO] ————————————————————————
Enter the /Users/zhuizhumengxiang/Downloads/dubbo-2.5.x/dubbo-simple/dubbo-monitor-simple/target
directory, and you will find that dubbo-monitor-simple-2.5.10-assembly.tar.gz is generated:
- Unzip dubbo-monitor-simple-2.5.10-assembly.tar.gz, and modify it into dubbo-monitor-simple-2.5.10/conf/dubbo.properties:
Where dubbo.registry.address=zookeeper://127.0.0.1:2181 sets the address of the registration center, which is set to the address of zk here
Among them, dubbo.protocol.port=7070, which is the remote service listening port provided by the monitor. The service provider and the consumer will call the service provided by this port and send statistical information to the monitor.
dubbo.charts.directory and dubbo.statistics.directory are the locations of monitoring data files stored locally by the monitor
dubbo.jetty.port=8081 Set the listening address of the jetty container, similar to the port 8080 of tomcat, here is set to 8081
- Enter dubbo-monitor-simple-2.5.10/bin, execute sh start.sh to start monitor
At this point, the monitor has started to access http://127.0.0.1:8081/ and the following interface will appear:
3. Use of dubbo-monitor-simple
3.1 Application View
3.2 Service View
3.3 Registration Center View
3.4 Call data statistics
4. Summary
Dubbo-monitor is not a necessary component to build a distributed system with dubbo, but it is a monitoring center used to count the invocation times and invocation time of services. These data are helpful for system operation, maintenance and tuning.
Welcome everyone to join Knowledge Planet. In Knowledge Planet, we will discuss Java concurrent programming in depth, as well as JUC package source code; Java class loader principle; use of open source frameworks such as Spring, Springboot, Tomcat, Dubbo, and source code analysis; sharing author from graduation to The learning experience along the way now, how to study efficiently, how to read the source code; discuss the questions often encountered during career interviews and how to answer them, readers can identify the following QR code to join: