can not get cluster name in registry config ‘service.vgroupMapping.xxx-seata-service-group‘

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

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

该案例使用nacos作为seata服务的配置中心和注册中心

首先服务的配置文件应该没有指定seata.tx-service-group,所以会去默认拼接服务名后去寻找组,只需要增加配置文件后再去启动

如果Seata服务没有做修改就直接使用默认my_test_tx_group即可

微服务的配置文件

seata:
  tx-service-group: my_test_tx_group # 一定用这个默认的
  enabled: true
  registry:
    type: nacos
    nacos:
      application: seata-server
      server-addr: 127.0.0.1:8848
      group : SEATA_GROUP
      namespace: ""
      username: nacos
      password: nacos

其他配置文件也需要核对,使用脚本生成后的nacos配置不需要改动,也不需要增加特意增加一个xxx-seata-service-group配置,直接使用默认即可(这里namespace也可以空着)

seata的配置文件regustry.conf

registry {
  # file 、nacos 、eureka、redis、zk、consul、etcd3、sofa
  type = "nacos"

  nacos {
    application = "seata-server"
    serverAddr = "127.0.0.1:8848"
    group = "SEATA_GROUP"
    namespace = ""
    cluster = "default"
    username = "nacos"
    password = "nacos"
  }

}

config {
  # file、nacos 、apollo、zk、consul、etcd3
  type = "nacos"

  nacos {
    serverAddr = "127.0.0.1:8848"
    namespace = ""
    group = "SEATA_GROUP"
    username = "nacos"
    password = "nacos"
    #dataId = "seataServer.properties"
  }

}

nacos配置中存在service.vgroupMapping.my_test_tx_group

配置中没有需要添加一个,或者通过脚本重新生成

can not get cluster name in registry config ‘service.vgroupMapping.xxx-seata-service-group‘_第1张图片

服务都在同一个组中

can not get cluster name in registry config ‘service.vgroupMapping.xxx-seata-service-group‘_第2张图片

仅供参考,初次使用seata请多参考官网文档学习:http://seata.io/zh-cn/

你可能感兴趣的:(trouble,java,eureka,spring,cloud,seata)