1. clone源码
https://github.com/alibaba/dubbo.git
2. 安装dubbo-admin
2.1 编译dubbo-admin
在dubbo/dubbo-admin目录下运行命令mvn package
Error: 远程仓库中找不到Dubbo的2.5.4-SNAPSHOT版
解决办法:
将dubbo-admin/pom.xml 和 /pom.xml中的
<version>2.5.4-SNAPSHOT</version>
改为
<version>2.5.3</version>
2.2 安装dubbo-admin
在centos6上安装tomcat8,将dubbo-admin-2.5.3.war复制到webapps目录下,
修改配置文件:webapps/dubbo-admin-2.5.3/WEB-INF/dubbo.properties
dubbo.registry.address=zookeeper://127.0.0.1:2181
dubbo.admin.root.password=root
dubbo.admin.guest.password=guest
启动tomcat
Error:
java.lang.NoSuchMethodError: org.springframework.core.GenericTypeResolver.resolveTypeArguments
解决办法:
删掉dubbo-admin-2.5.3.war中的spring-2.5.6.SEC03.jar
浏览器中打开网址http://centos1:8080/dubbo-admin-2.5.3, 用户名root,密码root
3. 安装dubbo-simple-minitor
3.1 编译
将dubbo-simple-minitor/pom.xml 及其父pom.xml中的
<version>2.5.4-SNAPSHOT</version>
改为
<version>2.5.3</version>
运行命令 mvn package
3.2 安装
dubbo-monitor-simple-2.5.3-assembly.tar.gz 复制到centos6
tar -zxvf dubbo-monitor-simple-2.5.3-assembly.tar.gz
修改参数dubbo-monitor-simple-2.5.3/conf/dubbo.properties
dubbo.container=log4j,spring,registry,jetty
dubbo.application.name=simple-monitor
dubbo.application.owner=
#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=8087
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
运行命令 dubbo-monitor-simple-2.5.3/bin/start.sh
打开网址:http://centos1:8087/
4 运行Provider 和 provider
项目代码见附件,分别在eclipse中运行ProviderApp.java 和 CustomerApp.java
5 zookeeper节点分析
/dubbo/com.xinxin.mydubbo.CustomerService data=null
/dubbo/com.xinxin.mydubbo.CustomerService/consumers data=null
/dubbo/com.xinxin.mydubbo.CustomerService/consumers/consumer%3A%2F%2F192.168.56.1%2Fcom.xinxin.mydubbo.CustomerService%3Fapplication%3Dconsumer-of-helloworld-app%26category%3Dconsumers%26check%3Dfalse%26dubbo%3D2.5.3%26interface%3Dcom.xinxin.mydubbo.CustomerService%26methods%3DgetName%26pid%3D4204%26side%3Dconsumer%26timestamp%3D1498642368743 data=null
/dubbo/com.xinxin.mydubbo.CustomerService/consumers/consumer%3A%2F%2F192.168.56.1%2Fcom.xinxin.mydubbo.CustomerService%3Fapplication%3Dconsumer-of-helloworld-app%26category%3Dconsumers%26check%3Dfalse%26dubbo%3D2.5.3%26interface%3Dcom.xinxin.mydubbo.CustomerService%26methods%3DgetName%26pid%3D4204%26side%3Dconsumer%26timestamp%3D1498642368747 data=null
/dubbo/com.xinxin.mydubbo.CustomerService/configurators data=null
/dubbo/com.xinxin.mydubbo.CustomerService/configurators/override%3A%2F%2F192.168.56.1%3A20880%2Fcom.xinxin.mydubbo.CustomerService%3Fcategory%3Dconfigurators%26dynamic%3Dfalse%26enabled%3Dtrue%26weight%3D50 data=null
/dubbo/com.xinxin.mydubbo.CustomerService/configurators/override%3A%2F%2F192.168.56.1%3A20880%2Fcom.xinxin.mydubbo.CustomerService%3Fcategory%3Dconfigurators%26disabled%3Dtrue%26dynamic%3Dfalse%26enabled%3Dtrue data=null
/dubbo/com.xinxin.mydubbo.CustomerService/routers data=null
/dubbo/com.xinxin.mydubbo.CustomerService/providers data=null
/dubbo/com.xinxin.mydubbo.CustomerService/providers/dubbo%3A%2F%2F192.168.56.1%3A20880%2Fcom.xinxin.mydubbo.CustomerService%3Fanyhost%3Dtrue%26application%3Dxixi_provider%26dubbo%3D2.5.3%26interface%3Dcom.xinxin.mydubbo.CustomerService%26methods%3DgetName%26pid%3D15048%26side%3Dprovider%26timestamp%3D1498642361672 data=null
/dubbo/com.alibaba.dubbo.monitor.MonitorService data=null
/dubbo/com.alibaba.dubbo.monitor.MonitorService/consumers data=null
/dubbo/com.alibaba.dubbo.monitor.MonitorService/configurators data=null
/dubbo/com.alibaba.dubbo.monitor.MonitorService/configurators/override%3A%2F%2F192.168.1.151%3A7070%2Fcom.alibaba.dubbo.monitor.MonitorService%3Fcategory%3Dconfigurators%26disabled%3Dtrue%26dynamic%3Dfalse%26enabled%3Dtrue data=null
/dubbo/com.alibaba.dubbo.monitor.MonitorService/routers data=null
/dubbo/com.alibaba.dubbo.monitor.MonitorService/providers data=null
/dubbo/com.alibaba.dubbo.monitor.MonitorService/providers/dubbo%3A%2F%2F192.168.1.151%3A7070%2Fcom.alibaba.dubbo.monitor.MonitorService%3Fanyhost%3Dtrue%26application%3Dsimple-monitor%26delay%3D-1%26dubbo%3D2.5.3%26interface%3Dcom.alibaba.dubbo.monitor.MonitorService%26methods%3Dlookup%2Ccollect%26pid%3D1644%26revision%3D2.5.3%26side%3Dprovider%26timestamp%3D1498640092594 data=null
参考:
http://dubbo.io/Administrator+Guide-zh.htm
https://github.com/alibaba/dubbo/
http://repo1.maven.org/maven2/com/alibaba/dubbo/2.5.3/
http://blog.csdn.net/songjinbin/article/details/26006621
http://shiyanjun.cn/archives/category/opensource/dubbo