dubbo+nacos部署到服务器上注册失败?
本地项目能够正常跑起来,然后我把项目jar包和nacos上传到服务器上跑,出现了错误:日志显示是无法注册成功。但是我服务器上的nacos已经能够正常访问,nacos telnet也能连通。项目的配置文件中nacos配置地址是服务器内网地址。8848,9848,9849端口都已放开。dubbo版本3.09,nacos版本2.1.0.(应该不是版本的问题,本地项目是能跑的)。
pom.xml
<!-- https://mvnrepository.com/artifact/org.apache.dubbo/dubbo -->
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo</artifactId>
<version>3.0.9</version>
</dependency>
<dependency>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-client</artifactId>
<version>2.1.0</version>
</dependency>
provider:
错误日志:
ClientAuthService com.alibaba.nacos.client.auth.ram.RamClientAuthServiceImpl success.
2023-08-13 21:59:30.343 ERROR 7132 --- [ main] o.a.d.c.s.n.NacosDynamicConfiguration : [DUBBO] http error, code=403,msg=unknown user!,dataId=dubbo.properties,group=dubbo,tenant=, dubbo version: 3.0.9, current host: x.x.x.x
2023-08-13 21:59:30.350 ERROR 7132 --- [ main] o.a.d.c.s.n.NacosDynamicConfiguration : [DUBBO] http error, code=403,msg=unknown user!,dataId=dubbo.properties,group=dubbo-springboot-demo-provider,tenant=, dubbo version: 3.0.9, current host: x.x.x.x
2023-08-13 21:59:37.315 ERROR 7132 --- [ main] o.a.d.c.deploy.DefaultModuleDeployer : [DUBBO] Dubbo Module[1.1.1] start failed: java.lang.IllegalStateException: Failed to register dubbo://x.x.x.x:20880/com.cz.czapicommon.service.InnerInterfaceInfoService?anyhost=true&application=dubbo-springboot-demo-provider&background=false&deprecated=false&dubbo=2.0.2&dynamic=true&generic=false&interface=com.cz.czapicommon.service.InnerInterfaceInfoService&methods=getInterfaceInfo&pid=7132&release=3.0.9&revision=0.0.1&service-name-mapping=true&side=provider×tamp=1691935176321 to registry x.x.x.x:8848, cause: Failed to register dubbo://x.x.x.x:20880/com.cz.czapicommon.service.InnerInterfaceInfoService?anyhost=true&application=dubbo-springboot-demo-provider&background=false&deprecated=false&dubbo=2.0.2&dynamic=true&generic=false&interface=com.cz.czapicommon.service.InnerInterfaceInfoService&methods=getInterfaceInfo&pid=7132&release=3.0.9&revision=0.0.1&service-name-mapping=true&side=provider×tamp=1691935176321 to nacos nacos://x.x.x.x:8848/org.apache.dubbo.registry.RegistryService?REGISTRY_CLUSTER=nacos-registry&application=dubbo-springboot-demo-provider&dubbo=2.0.2&interface=org.apache.dubbo.registry.RegistryService&pid=7132&release=3.0.9, cause: Request nacos server failed: , dubbo version: 3.0.9, current host: x.x.x.x
Caused by: org.apache.dubbo.rpc.RpcException: Failed to register dubbo://x.x.x.x:20880/com.cz.czapicommon.servic
Caused by: com.alibaba.nacos.api.exception.NacosException: Request nacos server failed:
Caused by: com.alibaba.nacos.api.exception.NacosException: unknown user!
telnet:共网IP 8848 能够连通内网IP 8848 不能连通内网IP 20880 不能连通(日志中报错也显示了注册失败到内网IP 20880)localhost 20880 毫无疑问能够连通不过是换了个ip,就无法连通了。。所以我怀疑是不是这里不能连通导致的错误。。但是要怎么去进一步排查解决,求大佬解惑。。
回复
1个回答
test
2024-06-29
看报错是权限问题,你可以先检查Nacos的权限配置,在Nacos的配置里加用户和权限,还有检查一下Nacos的认证配置:用户名和密码对不对。还有就是可以改一下日志的详细级别,在Nacos和Dubbo的配置里设置一下就行,这样可以看得更详细的问题出现在什么地方。
回复
适合作为回答的
- 经过验证的有效解决办法
- 自己的经验指引,对解决问题有帮助
- 遵循 Markdown 语法排版,代码语义正确
不该作为回答的
- 询问内容细节或回复楼层
- 与题目无关的内容
- “赞”“顶”“同问”“看手册”“解决了没”等毫无意义的内容