You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@seata.apache.org by "LuGuiy (via GitHub)" <gi...@apache.org> on 2024/05/15 10:45:07 UTC

[I] 启动报错Failed to get available servers: service.vgroupMapping.default_tx_group configuration item is required [incubator-seata-samples]

LuGuiy opened a new issue, #677:
URL: https://github.com/apache/incubator-seata-samples/issues/677

   
   Ⅰ.服务启动报错io.seata.config.exception.ConfigNotFoundException: service.vgroupMapping.default_tx_group configuration item is required
   
   
   ### Ⅱ. 服务启动报找不到服务组
   
   io.seata.config.exception.ConfigNotFoundException: service.vgroupMapping.default_tx_group configuration item is required
   	at io.seata.discovery.registry.nacos.NacosRegistryServiceImpl.lookup(NacosRegistryServiceImpl.java:151)
   	at io.seata.core.rpc.netty.NettyClientChannelManager.getAvailServerList(NettyClientChannelManager.java:277)
   	at io.seata.core.rpc.netty.NettyClientChannelManager.reconnect(NettyClientChannelManager.java:213)
   	at io.seata.core.rpc.netty.TmNettyRemotingClient.initConnection(TmNettyRemotingClient.java:288)
   	at io.seata.core.rpc.netty.TmNettyRemotingClient.init(TmNettyRemotingClient.java:196)
   	at io.seata.tm.TMClient.init(TMClient.java:47)
   	at io.seata.spring.annotation.GlobalTransactionScanner.initClient(GlobalTransactionScanner.java:224)
   	at io.seata.spring.annotation.GlobalTransactionScanner.afterPropertiesSet(GlobalTransactionScanner.java:470)
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1853)
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1790)
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594)
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516)
   	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324)
   	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
   	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322)
   	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:207)
   	at org.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors(PostProcessorRegistrationDelegate.java:229)
   	at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:723)
   	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:536)
   	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143)
   	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758)
   	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750)
   	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:405)
   	at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
   	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237)
   	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)
   	at cn.com.goldwind.ercp.AppUILuncher.main(AppUILuncher.java:46)
   
   
   ### Ⅲ. 微服务项目配置
   
   
   
   ### Ⅳ. How to reproduce it (as minimally and precisely as possible)
   
   1.seata客户端 微服务项目配置
   seata:
     enabled: true
     enable-auto-data-source-proxy: true
     tx-service-group: hrs-tx-group
     data-source-proxy-mode: XA
     service:
       vgroupMapping:
         hrs-tx-group: hrs-cluster
       disable-global-transaction: false
   #  config:
   #    type: nacos
   #    nacos:
   #      server-addr: 10.12.7.154:30029
   #      namespace: c8a29ded-d91c-4828-97b0-f3eac84b9bfa
   #      group: SEATA_GROUP
   #      username: hrsnacos
   #      password: 1qaz@WSX
     registry:
       type: nacos
       nacos:
         application: seata-server
         server-addr: 10.12.7.154:30029
         group: SEATA_GROUP
         namespace: c8a29ded-d91c-4828-97b0-f3eac84b9bfa
         username: hrsnacos
         password: 1qaz@WSX
         cluster: hrs-cluster
   
   2. seata服务端配置
   server:
     port: 7091
   
   spring:
     application:
       name: seata-server
   
   logging:
     config: classpath:logback-spring.xml
     file:
       path: /data/seata/logs
         #extend:
         #logstash-appender:
         #destination: 127.0.0.1:4560
         #kafka-appender:
         #bootstrap-servers: 127.0.0.1:9092
       #topic: logback_to_logstash
   console:
     user:
       username: seata
       password: seata
   # 这里是主要的配置文件
   seata:
     config:
       # support: nacos 、 consul 、 apollo 、 zk  、 etcd3
       type: nacos
       nacos:
         server-addr: 10.12.7.154:30029
         # 如果在nacos上添加了命名空间,则配置命令空间ID
         namespace: c8a29ded-d91c-4828-97b0-f3eac84b9bfa
         # 配置分组
         group: SEATA_GROUP
         username: hrsnacos
         password: 1qaz@WSX
         data-id: seataServer.properties
     registry:
       # support: nacos 、 eureka 、 redis 、 zk  、 consul 、 etcd3 、 sofa
       type: nacos
       nacos:
         application: seata-server
         server-addr: 10.12.7.154:30029
         group: SEATA_GROUP
         namespace: c8a29ded-d91c-4828-97b0-f3eac84b9bfa
         username: hrsnacos
         password: 1qaz@WSX
         cluster: hrs-cluster
      
     security:
       secretKey: SeataSecretKey0c382ef121d778043159209298fd40bf3850a017
       tokenValidityInMilliseconds: 1800000
       ignore:
         urls: /,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.jpeg,/**/*.ico,/api/v1/auth/login,/metadata/v1/**
   
   3. 服务端nacos上配置seataServer.properties 
   
   # seata:
   service.vgroupMapping.hrs-tx-group=hrs-cluster
   
   # 数据存储方式,db代表数据库
   store.mode=db
   store.db.datasource=druid
   store.db.dbType=postgresql
   store.db.driverClassName=org.postgresql.Driver
   store.db.url=jdbc:postgresql://cortest-pg.goldwind.com:5432/hrs_nacos?currentSchema=public
   store.db.user=hrsuser
   store.db.password=dzzn7Wk^ci
   store.db.minConn=5
   store.db.maxConn=30
   store.db.globalTable=global_table
   store.db.branchTable=branch_table
   store.db.queryLimit=100
   store.db.lockTable=lock_table
   store.db.maxWait=5000
   # 事务、日志等配置
   server.recovery.committingRetryPeriod=1000
   server.recovery.asynCommittingRetryPeriod=1000
   server.recovery.rollbackingRetryPeriod=1000
   server.recovery.timeoutRetryPeriod=1000
   server.maxCommitRetryTimeout=-1
   server.maxRollbackRetryTimeout=-1
   server.rollbackRetryTimeoutUnlockEnable=false
   server.undo.logSaveDays=7
   server.undo.logDeletePeriod=86400000
   
   # 客户端与服务端传输方式
   transport.serialization=seata
   transport.compressor=none
   # 关闭metrics功能,提高性能
   metrics.enabled=false
   metrics.registryType=compact
   metrics.exporterList=prometheus
   metrics.exporterPrometheusPort=9898
   
   Minimal yet complete reproducer code (or URL to code):
   
   
   
   ### Ⅴ. 服务端启动成功也注册成功了,服务端和客户端服务组配置明明已经一致了,seata依赖包换了很多种方式启动还是报service.vgroupMapping.default_tx_group configuration item is required,并且vgroupMapping和vgroup-mapping都试了都不行报错依旧
   
   
   ### Ⅵ. Environment:
   
   - JDK version(e.g. `java -version`):1.8.0
   - Seata client/server version:  2.0
   - Database version:PostgreSQL 12.8 
   - OS(e.g. `uname -a`):linux
   - Others: nacos 2.2.3、spring-cloud Hoxton.SR9


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@seata.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@seata.apache.org
For additional commands, e-mail: dev-help@seata.apache.org


Re: [I] 启动报错Failed to get available servers: service.vgroupMapping.default_tx_group configuration item is required [incubator-seata-samples]

Posted by "LuGuiy (via GitHub)" <gi...@apache.org>.
LuGuiy commented on issue #677:
URL: https://github.com/apache/incubator-seata-samples/issues/677#issuecomment-2112173608

   ![nacos远程seata配置](https://github.com/apache/incubator-seata-samples/assets/169896462/5952502a-85a6-43c2-a01e-9559b89a3f68)
   ![seata服务端application配置](https://github.com/apache/incubator-seata-samples/assets/169896462/120799f5-3f18-4db6-b1d8-c8c35626725d)
   ![seata服务端注册成功](https://github.com/apache/incubator-seata-samples/assets/169896462/28e2ccd2-7bbc-4d90-abd8-ab829c239643)
   ![客户端微服务seata配置](https://github.com/apache/incubator-seata-samples/assets/169896462/5eea4a69-f0a2-46e9-90b7-8261e0167704)
   ![启动报错日志](https://github.com/apache/incubator-seata-samples/assets/169896462/4d05d763-4dca-451d-b5e2-1d9a79793eeb)
   ![微服务客户端依赖](https://github.com/apache/incubator-seata-samples/assets/169896462/35884389-a580-4062-8acb-fcdcfaedfb6c)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@seata.apache.org
For additional commands, e-mail: dev-help@seata.apache.org


Re: [I] 启动报错Failed to get available servers: service.vgroupMapping.default_tx_group configuration item is required [incubator-seata-samples]

Posted by "LuGuiy (via GitHub)" <gi...@apache.org>.
LuGuiy closed issue #677: 启动报错Failed to get available servers: service.vgroupMapping.default_tx_group configuration item is required
URL: https://github.com/apache/incubator-seata-samples/issues/677


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@seata.apache.org
For additional commands, e-mail: dev-help@seata.apache.org


Re: [I] 启动报错Failed to get available servers: service.vgroupMapping.default_tx_group configuration item is required [incubator-seata-samples]

Posted by "oniubi (via GitHub)" <gi...@apache.org>.
oniubi commented on issue #677:
URL: https://github.com/apache/incubator-seata-samples/issues/677#issuecomment-3509957377

   到底怎么解决的,我也遇到这个异常,搞了一天了。Seata 2.5.0、Spring Boot 3.5.7、Spring Cloud 2025.0.0、 Spring Cloud Alibaba 2023.0.3.4版本组合。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@seata.apache.org
For additional commands, e-mail: dev-help@seata.apache.org


Re: [I] 启动报错Failed to get available servers: service.vgroupMapping.default_tx_group configuration item is required [incubator-seata-samples]

Posted by "big666666 (via GitHub)" <gi...@apache.org>.
big666666 commented on issue #677:
URL: https://github.com/apache/incubator-seata-samples/issues/677#issuecomment-2562271955

   @LuGuiy 
   `spring:
     application:
       name: cloud_cart
   
     cloud:
       nacos:
         discovery:
           server-addr: 127.0.0.1:8848
       sentinel: #流量控制中心
         transport:
           dashboard: localhost:8089 # sentinel-dashboard地址
           port: 8721
         eager: true
         filter:
           enabled: true
       seata:
         application-id: ${spring.application.name}
         tx-service-group: default_tx_group
         registry:
           type: nacos
           nacos:
             application: seata-server
             server-addr: 127.0.0.1:8848
             namespace:
             group: SEATA_GROUP
             cluster: default
             username: nacos
             password: nacos
         config:
           type: nacos
           nacos:
             server-addr: 127.0.0.1:8848
             group: SEATA_GROUP
             username: nacos
             password: nacos
             namespace:
             data-id: seataServer.properties
   # 解决service.vgroupMapping.default_tx_group configuration item is required错误
   seata:
     service:
       vgroup-mapping:
         default_tx_group: default
       grouplist:
         default: 127.0.0.1:8091
       disable-global-transaction: false
       
   ![屏幕截图 2024-12-26 154611](https://github.com/user-attachments/assets/eeee3f5e-8b5a-4408-b7ba-726213302c8d)
   `


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@seata.apache.org
For additional commands, e-mail: dev-help@seata.apache.org


Re: [I] 启动报错Failed to get available servers: service.vgroupMapping.default_tx_group configuration item is required [incubator-seata-samples]

Posted by "big666666 (via GitHub)" <gi...@apache.org>.
big666666 commented on issue #677:
URL: https://github.com/apache/incubator-seata-samples/issues/677#issuecomment-2562267981

   spring:
     application:
       name: cloud_cart
   
     cloud:
       nacos:
         discovery:
           server-addr: 127.0.0.1:8848
       sentinel: #流量控制中心
         transport:
           dashboard: localhost:8089 # sentinel-dashboard地址
           port: 8721
         eager: true
         filter:
           enabled: true
       seata:
         application-id: ${spring.application.name}
         tx-service-group: default_tx_group
         registry:
           type: nacos
           nacos:
             application: seata-server
             server-addr: 127.0.0.1:8848
             namespace:
             group: SEATA_GROUP
             cluster: default
             username: nacos
             password: nacos
         config:
           type: nacos
           nacos:
             server-addr: 127.0.0.1:8848
             group: SEATA_GROUP
             username: nacos
             password: nacos
             namespace:
             data-id: seataServer.properties
   # 解决service.vgroupMapping.default_tx_group configuration item is required错误,添加下配置
   seata:
     service:
       vgroup-mapping:
         default_tx_group: default
       grouplist:
         default: 127.0.0.1:8091
       disable-global-transaction: false


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@seata.apache.org
For additional commands, e-mail: dev-help@seata.apache.org


Re: [I] 启动报错Failed to get available servers: service.vgroupMapping.default_tx_group configuration item is required [incubator-seata-samples]

Posted by "yxsnake (via GitHub)" <gi...@apache.org>.
yxsnake commented on issue #677:
URL: https://github.com/apache/incubator-seata-samples/issues/677#issuecomment-2456240926

   有解决吗?
   
   ![Uploading image.png…]()
   ![Uploading image.png…]()
   ![Uploading image.png…]()
   ![Uploading image.png…]()
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@seata.apache.org
For additional commands, e-mail: dev-help@seata.apache.org


Re: [I] 启动报错Failed to get available servers: service.vgroupMapping.default_tx_group configuration item is required [incubator-seata-samples]

Posted by "slarkkk (via GitHub)" <gi...@apache.org>.
slarkkk commented on issue #677:
URL: https://github.com/apache/incubator-seata-samples/issues/677#issuecomment-2421165997

   怎么解决  这报错太奇怪了


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@seata.apache.org
For additional commands, e-mail: dev-help@seata.apache.org