Open queenqueen99 opened 1 year ago
报错信息"service.vgroupMapping.${spring.application.name}-fescar-service-group configuration item is required"
tx-service-group
从配置文件spring.cloud.alibaba.seata.tx-service-group
获取- 否则默认读取
${spring.appilcaton.name}-fescar-service-group
作为tx-service-group
的值报错信息“service.vgroupMapping.${spring.cloud.seata.tx-service-group} configuration item is required”
service.vgroupMapping.${spring.cloud.seata.tx-service-group}
配置项从配置文件的seata.service.vgroupMapping.${spring.cloud.seata.tx-service-group}
获取。- 如果配置
spring.cloud.alibaba.seata.service.vgroupMapping.${spring.cloud.seata.tx-service-group}
将不能被seata的配置类扫描到报错信息"service.default.grouplist or service.grouplist.default configuration item is required"
GrouplistDataId
有新旧两种配置格式,Seata 1.7.0都兼容,分别是旧的配置项seata.service.default.grouplist
,和新的配置项seata.service.grouplist.default
GrouplistDataId
配置项从配置文件的seata.service.default.grouplist
或seata.service.grouplist.default
获取- 如果配置
spring.cloud.alibaba.seata.service.default.grouplist
将不能被seata的配置类扫描到
server:
port: 2001
spring:
application:
name: seata-order-service
cloud:
alibaba:
seata:
tx-service-group: order-tx-group
nacos:
discovery:
server-addr: 172.25.254.137:8848
# seata的tc地址通过nacos服务注册中心获取
# 为避免nacos配置混乱seata的配置信息通过本地application.yaml获取
# 如果seata client需要使用nacos配置中心,只需开启seata.config下的相关配置即可,(namespace,group,dataId)坐标唯一确定一个配置文件
seata:
registry:
type: nacos
# 从Nacos获取tc的服务器地址
nacos:
server-addr: 172.25.254.137:8848
namespace: 7aed383e-88da-466b-9153-9ba78255a921
group: SEATA_GROUP
applicatoin: seata-server
username: nacos
password: nacos
# config:
# type: nacos
# nacos:
# server-addr: 172.25.254.137:8848
# namespace: da64003c-9c4a-489e-8c7f-fbbf511284df
# group: SEATA_GROUP
# username: nacos
# password: nacos
# data-id: seataServer.properties
service:
# 事务组与tc服务cluster的映射关系
# 键为tx-service-group的值,将该自定义事务映射到seata-server服务默认的集群(默认为default)
# 需要匹配tc的application.yaml的seata.registry.nacos.cluster的值
# 首先程序中配置了事务分组(GlobalTransactionScanner 构造方法的txServiceGroup参数),程序会通过用户配置的配置中心去寻找service.vgroupMapping事务分组配置项,取得配置项的值就是TC集群的名称。拿到集群名称程序通过一定的前后缀+集群名称去构造服务名,各配置中心的服务名实现不同。拿到服务名去相应的注册中心去拉取相应服务名的服务列表,获得后端真实的TC服务列表。
vgroupMapping:
order-tx-group: DEFAULT
# seata.service.grouplist仅在seata.registry.type = file时生效
# 为了Seata Server(TC)在Nacos服务注册中心的集群名与其它微服务集群名全大写的命名规则保持一致,在创建Seata Server(TC)的配置项seata.registry.cluster就自定义配置为全大写的DEFAULT
# grouplist:
# DEFAULT: 172.25.254.137:8091
Seata Server 1.5.0版本开始,配置文件改为application.yml,同时向下兼容register.conf和file.conf两个配置文件。
本案例完全使用application.yml配置文件,无需创建配置register.conf和file.conf。
@queenqueen99
请问 Seata Server 2.0.0版本,seata.tx-service-group 值是可以设置多个吗?或者不设置会怎样?
seata:
application-id: springboot-dubbo-seata-business
tx-service-group: my_test_tx_group
参数配置文档也没有说明这个参数 https://seata.apache.org/zh-cn/docs/user/configurations/#%E9%99%84%E5%BD%95-1
@queenqueen99 Please use the latest sample from the master branch.
报错信息"service.vgroupMapping.${spring.application.name}-fescar-service-group configuration item is required"
tx-service-group
从配置文件spring.cloud.alibaba.seata.tx-service-group
获取- 否则默认读取
${spring.appilcaton.name}-fescar-service-group
作为tx-service-group
的值报错信息“service.vgroupMapping.${spring.cloud.seata.tx-service-group} configuration item is required”
service.vgroupMapping.${spring.cloud.seata.tx-service-group}
配置项从配置文件的seata.service.vgroupMapping.${spring.cloud.seata.tx-service-group}
获取。- 如果配置
spring.cloud.alibaba.seata.service.vgroupMapping.${spring.cloud.seata.tx-service-group}
将不能被seata的配置类扫描到报错信息"service.default.grouplist or service.grouplist.default configuration item is required"
GrouplistDataId
有新旧两种配置格式,Seata 1.7.0都兼容,分别是旧的配置项seata.service.default.grouplist
,和新的配置项seata.service.grouplist.default
GrouplistDataId
配置项从配置文件的seata.service.default.grouplist
或seata.service.grouplist.default
获取- 如果配置
spring.cloud.alibaba.seata.service.default.grouplist
将不能被seata的配置类扫描到server: port: 2001 spring: application: name: seata-order-service cloud: alibaba: seata: tx-service-group: order-tx-group nacos: discovery: server-addr: 172.25.254.137:8848 # seata的tc地址通过nacos服务注册中心获取 # 为避免nacos配置混乱seata的配置信息通过本地application.yaml获取 # 如果seata client需要使用nacos配置中心,只需开启seata.config下的相关配置即可,(namespace,group,dataId)坐标唯一确定一个配置文件 seata: registry: type: nacos # 从Nacos获取tc的服务器地址 nacos: server-addr: 172.25.254.137:8848 namespace: 7aed383e-88da-466b-9153-9ba78255a921 group: SEATA_GROUP applicatoin: seata-server username: nacos password: nacos # config: # type: nacos # nacos: # server-addr: 172.25.254.137:8848 # namespace: da64003c-9c4a-489e-8c7f-fbbf511284df # group: SEATA_GROUP # username: nacos # password: nacos # data-id: seataServer.properties service: # 事务组与tc服务cluster的映射关系 # 键为tx-service-group的值,将该自定义事务映射到seata-server服务默认的集群(默认为default) # 需要匹配tc的application.yaml的seata.registry.nacos.cluster的值 # 首先程序中配置了事务分组(GlobalTransactionScanner 构造方法的txServiceGroup参数),程序会通过用户配置的配置中心去寻找service.vgroupMapping事务分组配置项,取得配置项的值就是TC集群的名称。拿到集群名称程序通过一定的前后缀+集群名称去构造服务名,各配置中心的服务名实现不同。拿到服务名去相应的注册中心去拉取相应服务名的服务列表,获得后端真实的TC服务列表。 vgroupMapping: order-tx-group: DEFAULT # seata.service.grouplist仅在seata.registry.type = file时生效 # 为了Seata Server(TC)在Nacos服务注册中心的集群名与其它微服务集群名全大写的命名规则保持一致,在创建Seata Server(TC)的配置项seata.registry.cluster就自定义配置为全大写的DEFAULT # grouplist: # DEFAULT: 172.25.254.137:8091
Seata Server 1.5.0版本开始,配置文件改为application.yml,同时向下兼容register.conf和file.conf两个配置文件。 本案例完全使用application.yml配置文件,无需创建配置register.conf和file.conf。
请问 Seata Server 2.0.0版本,seata.tx-service-group 值是可以设置多个吗?或者不设置会怎样?
seata:
application-id: springboot-dubbo-seata-business
tx-service-group: my_test_tx_group
参数配置文档也没有说明这个参数 https://seata.apache.org/zh-cn/docs/user/configurations/#%E9%99%84%E5%BD%95-1
@queenqueen99 Hello, have you solved it? I also deployed server reports : service.vgroupMapping.default_tx_group configuration item is required
Probleam description: I manager to deplore seate-server 1.7.0 in docker, and I'm trying to rebuild the official quickstart project. When I modified the configuration file(completely abandon file type of “conf”,only use "yaml") in the way I thought was correct, the following error occurred: 'service.vgroupMapping.order-tx-group configuration item is required'.("order-tx-group" is my custom transaction service id). I have reviewed a large number of notes and cannot solve this problem, which is extremely troubling for me.
By the way,I noticed that the log of the seata server container has this line of content.I don't know if this error is related to my problem.
Version: seata-server:1.7.0 nacos:2.2.3 spring-boot:2.2.2.RELEASE spring-cloud:Hoxton.SR1
Error stack information:
Configuration file:
Seata-Server snapshot:
![image-20230806010522070](https://gitee.com/queenqueen99/imagebed/raw/master/202308060105278.png)