seata报错:can not get cluster name in registry config service.vgroupMapping.xxx

can not get cluster name in registry config ‘service.vgroupMapping.xxx’, please make sure registry config correct

在注册表配置service.vgroupMapping中无法获取集群名称。xxx ,请确保注册表配置正确

当前项目配置为springclout + seata 1.4.2 + nacos 2.1.0,以下为异常信息

首先service.vgroupMapping 事务分组配置,我们是可以在nacos配置中心能看到的

service.vgroupMapping.rp_tx_group 事务分组, 这里的 rp_tx_group 是可以根据服务名称随意定义的,若nacos上没有对应名称的配置我们可以手动添加,点击查看seata安装部署详情

微服务项目配置

#seata config
seata.enabled=true
seata.enable-auto-data-source-proxy=false
seata.data-source-proxy-mode=AT
seata.use-jdk-proxy=false
seata.tx-service-group=rp_tx_group

#config seata by nacos
seata.config.type=nacos
seata.config.nacos.serverAddr=127.0.0.1:8848
seata.config.nacos.group=SEATA_GROUP
seata.config.nacos.password=nacos
seata.config.nacos.username=nacos
seata.config.nacos.namespace=bdddefe8-6a4c-4aae-8fb7-b5a248493dfd
# get seata-server by nacos
seata.registry.type=nacos
seata.registry.nacos.application=seata-server
seata.registry.nacos.group=SEATA_GROUP
seata.registry.nacos.username=nacos
seata.registry.nacos.password=nacos
seata.registry.nacos.serverAddr=127.0.0.1:8848
seata.registry.nacos.namespace=bdddefe8-6a4c-4aae-8fb7-b5a248493dfd
######## 分布式事务seata 配置#########

微服务配置中的nacos相关配置需保证与seata服务nacos配置一致

seata服务配置

# registry 节点中配置信息主要用于seata服务注册在哪个注册中心上
# 例我这里选择的是nacos,则seata服务配置成狗后会注册到nacos上
registry {
  # file 、nacos 、eureka、redis、zk、consul、etcd3、sofa
  #更改seata服务注册类型,这里我们使用nacos
  type = "nacos"

  nacos {
    # 服务名称,可以随意定义
    application = "seata-server"
    # nacos服务ip
    serverAddr = "127.0.0.1:8848"
    # nacos分组,为空及默认DEFAULT_GROUP
    group = "SEATA_GROUP"
    # nacos命名空间,可为空
    namespace = "bdddefe8-6a4c-4aae-8fb7-b5a248493dfd"
    # nacos集群,保持默认就好
    cluster = "default"
    # nacos 账户
    username = "nacos"
    # nacos 密码
    password = "nacos"
  }
}
# config 节点中配置信息主要用于seata服务相关配置是从哪个注册中心中获取
config {
  # file、nacos 、apollo、zk、consul、etcd3
  # 更改seata服务配置信息类型为nacos
  type = "nacos"

  nacos {
    # 与registry节点下nacos配置信息保持议一致即可
    serverAddr = "127.0.0.1:8848"
    namespace = "bdddefe8-6a4c-4aae-8fb7-b5a248493dfd"
    group = "SEATA_GROUP"
    username = "nacos"
    password = "nacos"
  }
}

细节点:确保微服务配置与seata配置 nacos命名空间 namespace 以及分组 group一致

若微服务项目启动后可查看到seata相关注册信息,则该服务已挂载至seata事务上

register TM success. client version:1.4.2, server version:1.4.2,channel

register RM success. client version:1.4.2, server version:1.4.2,channel

seata报错:can not get cluster name in registry config service.vgroupMapping.xxx_第1张图片

你可能感兴趣的:(error,record,java,分布式,spring,cloud)