赞
踩
https://github.com/apache/dubbo.git
https://github.com/apache/dubbo-admin.git
(Dubbo Admin是一款为了Dubbo定制的监控运维平台)
参考文档:dubbo-admin编译部署
主要内容为修改配置文件:
/Users/****/dubbo-admin/dubbo-admin-server/src/main/resources/application.properties
# 注册中心地址 admin.registry.address=zookeeper://127.0.0.1:2181 # 配置中心地址 admin.config-center=zookeeper://127.0.0.1:2181 # 元数据中心地址 admin.metadata-report.address=zookeeper://127.0.0.1:2181 # 用户名 admin.root.user.name=root #密码 admin.root.user.password=root # session回话超时时间 admin.check.sessionTimeoutMilli=3600000 # admin启动占用的端口号 server.port=10010 server.compression.enabled=true server.compression.mime-types=text/css,text/javascript,application/javascript server.compression.min-response-size=10240
[INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.0:compile (default-compile) on project dubbo-admin-server: Compilation failure [ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? [ERROR] [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException [ERROR] [ERROR] After correcting the problems, you can resume the build with the command [ERROR] mvn <goals> -rf :dubbo-admin-server
原因是环境变量没有配置JAVA_HOME
解决方式:
获取JAVA的安装路径:
/usr/libexec/java_home -V
添加JAVA_HOME到profile(mac下编辑profile)
vi ~/.bash_profile
添加环境变量
JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home"
export JAVA_HOME
PATH=$PATH:$JAVA_HOME/bin
export PATH
保存并生效
source ~/.bash_profile
重新执行编译命令
ERROR (SpringApplication.java:847)- Application run failed
org.apache.dubbo.rpc.RpcException: Fail to start server(url: dubbo://30.96.216.200:20880/com.jiangzheng.course.dubbo.api.service.ServiceDemo?anyhost=true&application=provider&bind.ip=30.96.216.200&bind.port=20880&channel.readonly.sent=true&codec=dubbo&default=true&deprecated=false&dubbo=2.0.2&dynamic=true&generic=false&heartbeat=60000&interface=com.jiangzheng.course.dubbo.api.service.ServiceDemo&metadata-type=remote&methods=getName,getSelf&pid=76761&release=3.0.0.preview&side=provider×tamp=1640746962428) Failed to bind NettyServer on /30.96.216.200:20880, cause: Address already in use
at org.apache.dubbo.rpc.protocol.dubbo.DubboProtocol.createServer(DubboProtocol.java:348)
...
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1325)
at com.jiangzheng.course.dubbo.provider.DubboProviderApplication.main(DubboProviderApplication.java:12)
Caused by: org.apache.dubbo.remoting.RemotingException: Failed to bind NettyServer on /30.96.216.200:20880, cause: Address already in use
at org.apache.dubbo.remoting.transport.AbstractServer.<init>(AbstractServer.java:77)
...
at org.apache.dubbo.rpc.protocol.dubbo.DubboProtocol.createServer(DubboProtocol.java:346)
... 38 common frames omitted
原因:dubbo协议默认在20880端口暴露服务,又因为在dubbo-admin项目中有 org.apache.dubbo.mock.api.MockService
dubbo-admin中的org.apache.dubbo.mock.api.MockService会占用20880端口,所以导致prodiver的接口暴露的默认端口被占用
解决方式:
在prodiver项目的springContext-dubbo.xml文件中修改暴露端口号:
<dubbo:protocol name="dubbo" port="29014" />
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。