windows dubbo-admin本地编译打包

  因为zookeeper只是一个黑框,我们无法看到是否存在了什么提供者或消费者,这时就要借助Dubbo-Admin管理平台来实时的查看,也可以通过这个平台来管理提者和消费者。
        dubbo-admin.war强烈建议自己编译一个,网上找的基本都不行,试了很多个,最后还是自己来搞,编译的过程如下,一定在安装maven和jdk!

dubbo的所有源码可在https://github.com/alibaba/dubbo上下载。下好之后解压


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


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


然后输入命令

[html]  view plain copy
  1. mvn package -Dmaven.skip.test=true  
这里要自己把maven的环境变量配置好,这里的-Dmaven.skip.test表示不打包测试包。然后结果如下,表示打包成功


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

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


这里我已上传这个war包,下载地址:http://download.csdn.net/detail/evankaka/9054273

1.2、dubbo-admin安装

       dubbo-admin已打包成功,接下来就容易很多了

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


然后修改 


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


再把 Tomcat给关了

4、修改dubbo.properties

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


是否是如下内容:

[html]  view plain copy
  1. dubbo.registry.address=zookeeper://127.0.0.1:2181  
  2. dubbo.admin.root.password=root  
  3. 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)


猜你喜欢

转载自blog.csdn.net/y534560449/article/details/73742237
今日推荐