Springcloud 集成seata 出现的坑
i.s.c.r.netty.NettyClientChannelManager : can not get cluster name in regist
出现这个错,首先得看一下config.txt 中的service.vgroupMapping.my_test_tx_group 和你yml中配置的tx-service-group是否一致。
seata: # 开启自动装配 # enabled: true # 本客户端的微服务名称 application-id: ${spring.application.name} # 读取哪个事务分组 tx-service-group: my_test_tx_group
如果不一致,就不行。我开始报这个错是因为之前不一致,但是我的配置已经传到nacos上了,所以导致无论怎么改配置文件都不起作用,后来我删除了nacos中的所有配置,重新上传了一遍,出现了另一个问题
no available service found in cluster ‘default‘, please make sure registry config correct and keep..
出现这个问题,我有检查了一遍配置文件,在registry.conf中找到了问题,还是在之前上传配置文件到nacos的时候,如果你配置了namespace ,那么在yml中就必须加上namespace属性,否则就找不到了。贴上我的yml
seata: # 开启自动装配 # enabled: true # 本客户端的微服务名称 application-id: ${spring.application.name} # 读取哪个事务分组 tx-service-group: my_test_tx_group # 配置中心设置 config: type: nacos nacos: username: nacos password: nacos # 读取的配置分组 group: SEATA_GROUP server-addr: 你的服务器ip:8848 namespace: 88b8f583-43f9-4272-bd46-78a9f89c56e8 # 注册中心设置 registry: type: nacos nacos: # SEATA服务中心的微服务名,此处与服务端保持一致 application: seata-server server-addr: 你的服务器ip:8848 username: nacos password: nacos group: SEATA_GROUP dataId: seataServer.properties namespace: 88b8f583-43f9-4272-bd46-78a9f89c56e8
上一篇:
IDEA上Java项目控制台中文乱码