一、dubbo从入门到放弃 dubbo-admin本地编译打包

由于zookeeper只是一个黑框,咱们没法看到是否存在了什么提供者或消费者,这时就要借助Dubbo-Admin管理平台来实时的查看,也能够经过这个平台来管理提者和消费者。
        dubbo-admin.war强烈建议本身编译一个,网上找的基本都不行,试了不少个,最后仍是本身来搞,编译的过程以下,必定在安装maven和jdk!java

dubbo的全部源码可在https://github.com/alibaba/dubbo上下载。下好以后解压git

解压后的文件内容,进入dubbo-admin.github

经过cmd进入dubbo-admin目录,输入命令web

而后输入命令spring

mvn package -Dmaven.skip.test=true

这里要本身把maven的环境变量配置好,这里的-Dmaven.skip.test表示不打包测试包。而后结果以下,表示打包成功apache

再打开项目的文件所在位置:E:\下载\dubbo-master\dubbo-master\dubbo-admin\targettomcat

target表示构建的本地路径,打开,里面有个文件dubbo-admin-2.5.4-SNAPSHOT.war表示打包成功,这个文件得放在Tomcat下才能运行安全

1.二、dubbo-admin安装

  dubbo-admin已打包成功,接下来就容易不少了app

1. 安装
将 dubbo-admin-2.5.4-SNAPSHOT.war 拷入 tomcat  webapps中
2. 配置
修改tomcat的端口8088,修改方法以下,打到conf下的文件 server.xml,由于zookeeper会用到8080的端口,因此为了避免冲突,把Tomcat的端口改一下。记得必定要改!!webapp

而后修改 

三、启动一下Tomcat,让它把war解压了发现webapp下多了一个文件夹

再把 Tomcat给关了

四、修改dubbo.properties

进入apache-tomcat-7.0.62\webapps\dubbo-admin-2.5.4-SNAPSHOT\WEB-INF

是不是以下内容

dubbo.registry.address=zookeeper://127.0.0.1:2181  
dubbo.admin.root.password=root  
dubbo.admin.guest.password=guest

若是是,就不用改,这里的127.0.0.1对应的是本身的电脑IP,由于这里zookeeper也在本身电脑上,因此要这么写才行。通常状况下都是不须要改的,由于初始都是本地的IP地址。但仍是看看比较安全

 


5. 访问:

这下所有都配置好了,首先,必定要先启动zookeeper启动后再去启动tomcat!必定要先启动zookeeper启动后再去启动tomcat!必定要先启动zookeeper启动后再去启动tomcat!重要的事情三遍!

启动zookeeper

启动tomcat

访问http://localhost:8088/dubbo-admin-2.5.4-SNAPSHOT/ 必定要注意名必定要和你webapp下的工程名同样!!

若是启动过程当中报如下错误请参考个人另外一篇文章 dubbo 2.5.4 在JDK8下启动错误

 

严重: Exception sending context initialized event to listener instance of class com.alibaba.citrus.webx.context.WebxContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'uriBrokerService': Cannot create inner bean '(inner bean)' of type
[com.alibaba.citrus.service.uribroker.impl.URIBrokerServiceImpl$URIBrokerInfo]
while setting bean property 'brokers' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name '(inner bean)#25': Cannot create inner bean 'server' of type
[com.alibaba.citrus.service.uribroker.uri.GenericURIBroker] while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'server': Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'URIType' of bean class [com.alibaba.citrus.service.uribroker.uri.GenericURIBroker]: Bean property 'URIType' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?

at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:230)
相关文章
相关标签/搜索