1、来到Dubbo的GITHUBhttps://github.com/apache/dubbo下载incubator-dubbo-ops-master.zip,解压,进入dubbo-monitor-simple目录
windows版:
(1)以管理员身份运行命令提示符:
(2)打包完成之后,在项目的target目录下,生成dubbo-monitor-simple-2.0.0.jar,在运行之前,还需要进行修改配置文件。
将dubbo-monitor-simple-2.0.0-assembly.tar.gz解压,修改conf下的dubbo.properties文件的zookeeper地址即可。
(3)找到官方文档schema配置参考手册http://dubbo.apache.org/zh-cn/docs/user/references/xml/dubbo-monitor.html
Linux版:
(1)将incubator-dubbo-ops-master.zip上传linx操作系统
[root@hadoop101 incubator-dubbo-ops-master]# cd dubbo-monitor-simple/
[root@hadoop101 dubbo-monitor-simple]# mvn clean package
(2)编译成功后的目标文件为:dubbo-monitor-simple-2.0.0-assembly.tar.gz,dubbo-monitor-simple-2.0.0.jar是可以直接运行的jar包
(3) 需要对dubbo-monitor-simple-2.0.0-assembly.tar.gz进行配置
dubbo.jetty.port : 服务启动后访问的端口
[root@hadoop101 dubbo-monitor-simple-2.0.0]# cd conf/
[root@hadoop101 conf]# ll
总用量 4
-rw-r--r--. 1 root root 1367 7月 24 2018 dubbo.properties
[root@hadoop101 conf]# vim dubbo.properties
(4)启动服务
[root@hadoop101 assembly.bin]# ll
总用量 24
-rwxr-xr-x. 1 root root 2286 5月 23 10:48 dump.sh
-rwxr-xr-x. 1 root root 49 5月 23 10:48 restart.sh
-rwxr-xr-x. 1 root root 413 5月 23 10:48 server.sh
-rwxr-xr-x. 1 root root 803 5月 23 10:48 start.bat
-rwxr-xr-x. 1 root root 3369 5月 23 10:48 start.sh
-rwxr-xr-x. 1 root root 852 5月 23 10:48 stop.sh
[root@hadoop101 assembly.bin]# ./start.sh
Starting the simple-monitor ........OK!
PID: 3658
STDOUT: logs/stdout.log
(5)访问服务,展示简易的监控中心
它若想监控到服务的调用信息等,需要在服务消费方进行配置
(6)配置使用监控中心,参照dubbo官方文档:http://dubbo.apache.org/zh-cn/docs/user/references/xml/dubbo-monitor.html
配置dubbo:monitor
监控中心协议,如果为protocol="registry",表示从注册中心发现监控中心地址,否则直连监控中心。
<!--配置使用监控中心-->
<dubbo:monitor protocol="registry"></dubbo:monitor>
服务提供方也需要进行相同配置
(7)启动服务提供者和消费者,进行测试