seata 从 0.8 到1.1.0 升级客户端报错: cause:can not register RM,err:can not connect to services-server.

错误报告:

2020-03-27 18:37:33.745 ERROR [XG-DATA-SOURCE-SERVICE-KARL,,,] 27528 --- [           main] i.s.c.r.netty.NettyClientChannelManager  : 0101 can not connect to 127.0.0.1:8091 cause:can not register RM,err:can not connect to services-server.

io.seata.common.exception.FrameworkException: can not register RM,err:can not connect to services-server.

at io.seata.core.rpc.netty.NettyClientChannelManager.doConnect(NettyClientChannelManager.java:210) ~[seata-all-1.0.0.jar:1.0.0]

at io.seata.core.rpc.netty.NettyClientChannelManager.acquireChannel(NettyClientChannelManager.java:103) ~[seata-all-1.0.0.jar:1.0.0]

 

 

 实际上我的配置是没有配置 127.0.0.1:8091 以及services-server,估计是使用了默认

 

 

 

 

追踪NettyClientChannelManager 

 

 

 

 

最终定位到类ConfigurationFactory

 

 可以看出config.type 竟然为 "file",实际上我的为"apollo"。实际上追踪发现新版的做了代码的增强,全部变成了config.type ="file"。旧版2.1.0的版本是可以读取用户的特色配置,比如配置到apollo的配置。想起多个月前问过清铭这个问题,为了兼容客户端没有apollo的情况下。实际上对于使用者,特别是spring cloud + apollo这种体系来看,确实不友好,对于使用者来说很疑惑,不免怀疑是不是设计上的问题。

解决方案是把对应的配置,都配到file.config,所需要的微服务都的需要添加这个配置文件。

 

posted @ 2020-04-01 11:14  小鱼鱼爱麦兜  阅读(6782)  评论(0)    收藏  举报