[seata][分享] seata:1.5.2结合nacos:2.1.0,seata-spring-boot-starter:1.5.2,相关的配置

2024-07-15 126 views
3
nacos

图1 图1 图2 图2 图3 图3

项目配置application.yml
# 完整配置: https://github.com/seata/seata/blob/develop/script/client/spring/application.yml
seata:
  application-id: ${spring.application.name}
  enable-auto-data-source-proxy: false
  registry:
    type: nacos
    nacos:
      server-addr: 192.168.0.143:8848
      group: SEATA_GROUP
      namespace: 02cf7241-260b-4d3b-ae1a-459bfc540007
      username: nacos
      password: nacos
      application: seata-server # 注意这个,跟图3的服务名要一致的
  config:
    type: nacos
    nacos:
      server-addr: 192.168.0.143:8848
      group: SEATA_GROUP
      namespace: 02cf7241-260b-4d3b-ae1a-459bfc540007
      username: nacos
      password: nacos
  tx-service-group: main_tx_group

感觉文档对于这些参数的解释不是很清楚(或者是我没好好的理解到文档?),经过调试代码,断点各种请求才最终成功!

FYI nacos的主机防火墙,要同时开放8848,7848,9848,9849的端口,才能保证正常访问。

回答

9

欢迎去https://github.com/seata/seata.github.io 优化下官网的文档

4

1.5.2 不是可以指定nacos中心的配置文件吗,还需要执行那个nacos.sh脚本吗?

6

要的,那是把seata的配置丢到nacos上的

1

图片 在nacos手动创建一个配置文件 然后修改seata的配置文件application.yml
图片

2

image 大佬好,请问Seata中Modify 'seata.transport.rpcRmRequestTimeout' so that it conforms to the canonical names requirements问题怎么解决呀.

8

他错误提示说得很清晰了呀,不要使用小驼峰,要用横杠作为分隔符

5

可是我没配值这个东西呀,seata1.4.2+spring-cloud-starter-alibaba-seata2021.1是可以跑的,换成1.5.2不行了

7

这个完整异常堆栈晒出来给我看下

3

请问有没有指定seata服务到nacos注册中心的ip的配置,之前旧版本是通过启动时-h指定的,1.5.1用了 preferredNetworks 这个参数但发现如果网卡里面本身没有那个ip还是无法指定。日志中会提示( Could not match ip by preferredNetworks:[113.118.248.46], will use default first ip 192.168.18.4 instead. ) 想指定是因为云服务器里面网卡显示的是内网IP, 但通过preferredNetworks去配置好像也是需要匹配上网卡的ip才会使用。

0

楼主 我跟你存在同样问题 请问你解决了么? 我也在官网提了一个issue

5

兄弟 我也遇到了个跟你一样的问题,我是这样解决的 1.把seata1.5.2版本代码下载下来 2.删掉截图中的配置 3.本地对seata-spring-autoconfigure-core工程重新打包 要删除的配置截图 image

2

感谢,我去试试

6

2022-07-28 16:57:29.156 ERROR 17868 --- [ main] c.t.c.a.Slf4jFailureAnalysisReporter :


APPLICATION FAILED TO START


Description:

Configuration property name 'seata.transport.rpcRmRequestTimeout' is not valid:

Invalid characters: 'R', 'R', 'T'
Reason: Canonical names should be kebab-case ('-' separated), lowercase alpha-numeric characters and must start with a letter

Action:

Modify 'seata.transport.rpcRmRequestTimeout' so that it conforms to the canonical names requirements.

2022-07-28 16:57:29.159 ERROR 17868 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :


APPLICATION FAILED TO START


Description:

Configuration property name 'seata.transport.rpcRmRequestTimeout' is not valid:

Invalid characters: 'R', 'R', 'T'
Reason: Canonical names should be kebab-case ('-' separated), lowercase alpha-numeric characters and must start with a letter

Action:

Modify 'seata.transport.rpcRmRequestTimeout' so that it conforms to the canonical names requirements.

2022-07-28 16:57:29.161 ERROR 17868 --- [ main] c.t.c.a.Slf4jFailureAnalysisReporter :


APPLICATION FAILED TO START


Description:

Configuration property name 'seata.transport.rpcRmRequestTimeout' is not valid:

Invalid characters: 'R', 'R', 'T'
Reason: Canonical names should be kebab-case ('-' separated), lowercase alpha-numeric characters and must start with a letter

Action:

Modify 'seata.transport.rpcRmRequestTimeout' so that it conforms to the canonical names requirements.

2022-07-28 16:57:29.162 ERROR 17868 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :


APPLICATION FAILED TO START


Description:

Configuration property name 'seata.transport.rpcRmRequestTimeout' is not valid:

Invalid characters: 'R', 'R', 'T'
Reason: Canonical names should be kebab-case ('-' separated), lowercase alpha-numeric characters and must start with a letter

Action:

Modify 'seata.transport.rpcRmRequestTimeout' so that it conforms to the canonical names requirements.

org.springframework.boot.context.properties.source.InvalidConfigurationPropertyNameException: Configuration property name 'seata.transport.rpcRmRequestTimeout' is not valid at org.springframework.boot.context.properties.source.ConfigurationPropertyName.elementsOf(ConfigurationPropertyName.java:577) at org.springframework.boot.context.properties.source.ConfigurationPropertyName.elementsOf(ConfigurationPropertyName.java:554) at org.springframework.boot.context.properties.source.ConfigurationPropertyName.of(ConfigurationPropertyName.java:545) at org.springframework.boot.context.properties.source.ConfigurationPropertyName.of(ConfigurationPropertyName.java:522) at org.springframework.boot.context.properties.migrator.PropertiesMigrationReporter.lambda$null$1(PropertiesMigrationReporter.java:103) at java.util.ArrayList.forEach(ArrayList.java:1259) at org.springframework.boot.context.properties.migrator.PropertiesMigrationReporter.lambda$getMatchingProperties$2(PropertiesMigrationReporter.java:101) at java.util.LinkedHashMap.forEach(LinkedHashMap.java:684) at org.springframework.boot.context.properties.migrator.PropertiesMigrationReporter.getMatchingProperties(PropertiesMigrationReporter.java:101) at org.springframework.boot.context.properties.migrator.PropertiesMigrationReporter.getReport(PropertiesMigrationReporter.java:64) at org.springframework.boot.context.properties.migrator.PropertiesMigrationListener.onApplicationPreparedEvent(PropertiesMigrationListener.java:66) at org.springframework.boot.context.properties.migrator.PropertiesMigrationListener.onApplicationEvent(PropertiesMigrationListener.java:55) at org.springframework.boot.context.properties.migrator.PropertiesMigrationListener.onApplicationEvent(PropertiesMigrationListener.java:44) at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176) at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131) at org.springframework.boot.context.event.EventPublishingRunListener.contextLoaded(EventPublishingRunListener.java:100) at org.springframework.boot.SpringApplicationRunListeners.lambda$contextLoaded$4(SpringApplicationRunListeners.java:71) at java.util.ArrayList.forEach(ArrayList.java:1259) at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:117) at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:111) at org.springframework.boot.SpringApplicationRunListeners.contextLoaded(SpringApplicationRunListeners.java:71) at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:426) at org.springframework.boot.SpringApplication.run(SpringApplication.java:338) at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:144) at org.springframework.cloud.bootstrap.BootstrapApplicationListener.bootstrapServiceContext(BootstrapApplicationListener.java:197) at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:114) at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:77) at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176) at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131) at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:82) at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:63) at java.util.ArrayList.forEach(ArrayList.java:1259) at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:117) at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:111) at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:62) at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:375) at org.springframework.boot.SpringApplication.run(SpringApplication.java:333) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1329) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1318) at com.tcl.tms.runcenter.TmsRuncenterApplication.main(TmsRuncenterApplication.java:16)

Process finished with exit code 0

2

兄弟 我找到根本原因了,你是不是引用了spring-boot-properties-migrator这个包 把这个包去掉就没问题了,更详细的坐标信息见附件图片

---原始邮件--- 发件人: @.> 发送时间: 2022年7月28日(周四) 下午5:11 收件人: @.>; 抄送: @.**@.>; 主题: Re: [seata/seata] [分享] seata:1.5.2结合nacos:2.1.0,seata-spring-boot-starter:1.5.2,相关的配置 (Issue #4776)

大佬好,请问Seata中Modify 'seata.transport.rpcRmRequestTimeout' so that it conforms to the canonical names requirements问题怎么解决呀.

他错误提示说得很清晰了呀,不要使用小驼峰,要用横杠作为分隔符

可是我没配值这个东西呀,seata1.4.2+spring-cloud-starter-alibaba-seata2021.1是可以跑的,换成1.5.2不行了

这个完整异常堆栈晒出来给我看下

2022-07-28 16:57:29.156 ERROR 17868 --- [ main] c.t.c.a.Slf4jFailureAnalysisReporter :

APPLICATION FAILED TO START

Description:

Configuration property name 'seata.transport.rpcRmRequestTimeout' is not valid: Invalid characters: 'R', 'R', 'T' Reason: Canonical names should be kebab-case ('-' separated), lowercase alpha-numeric characters and must start with a letter
Action:

Modify 'seata.transport.rpcRmRequestTimeout' so that it conforms to the canonical names requirements.

2022-07-28 16:57:29.159 ERROR 17868 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :

APPLICATION FAILED TO START

Description:

Configuration property name 'seata.transport.rpcRmRequestTimeout' is not valid: Invalid characters: 'R', 'R', 'T' Reason: Canonical names should be kebab-case ('-' separated), lowercase alpha-numeric characters and must start with a letter
Action:

Modify 'seata.transport.rpcRmRequestTimeout' so that it conforms to the canonical names requirements.

2022-07-28 16:57:29.161 ERROR 17868 --- [ main] c.t.c.a.Slf4jFailureAnalysisReporter :

APPLICATION FAILED TO START

Description:

Configuration property name 'seata.transport.rpcRmRequestTimeout' is not valid: Invalid characters: 'R', 'R', 'T' Reason: Canonical names should be kebab-case ('-' separated), lowercase alpha-numeric characters and must start with a letter
Action:

Modify 'seata.transport.rpcRmRequestTimeout' so that it conforms to the canonical names requirements.

2022-07-28 16:57:29.162 ERROR 17868 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :

APPLICATION FAILED TO START

Description:

Configuration property name 'seata.transport.rpcRmRequestTimeout' is not valid: Invalid characters: 'R', 'R', 'T' Reason: Canonical names should be kebab-case ('-' separated), lowercase alpha-numeric characters and must start with a letter
Action:

Modify 'seata.transport.rpcRmRequestTimeout' so that it conforms to the canonical names requirements.

org.springframework.boot.context.properties.source.InvalidConfigurationPropertyNameException: Configuration property name 'seata.transport.rpcRmRequestTimeout' is not valid at org.springframework.boot.context.properties.source.ConfigurationPropertyName.elementsOf(ConfigurationPropertyName.java:577) at org.springframework.boot.context.properties.source.ConfigurationPropertyName.elementsOf(ConfigurationPropertyName.java:554) at org.springframework.boot.context.properties.source.ConfigurationPropertyName.of(ConfigurationPropertyName.java:545) at org.springframework.boot.context.properties.source.ConfigurationPropertyName.of(ConfigurationPropertyName.java:522) at org.springframework.boot.context.properties.migrator.PropertiesMigrationReporter.lambda$null$1(PropertiesMigrationReporter.java:103) at java.util.ArrayList.forEach(ArrayList.java:1259) at org.springframework.boot.context.properties.migrator.PropertiesMigrationReporter.lambda$getMatchingProperties$2(PropertiesMigrationReporter.java:101) at java.util.LinkedHashMap.forEach(LinkedHashMap.java:684) at org.springframework.boot.context.properties.migrator.PropertiesMigrationReporter.getMatchingProperties(PropertiesMigrationReporter.java:101) at org.springframework.boot.context.properties.migrator.PropertiesMigrationReporter.getReport(PropertiesMigrationReporter.java:64) at org.springframework.boot.context.properties.migrator.PropertiesMigrationListener.onApplicationPreparedEvent(PropertiesMigrationListener.java:66) at org.springframework.boot.context.properties.migrator.PropertiesMigrationListener.onApplicationEvent(PropertiesMigrationListener.java:55) at org.springframework.boot.context.properties.migrator.PropertiesMigrationListener.onApplicationEvent(PropertiesMigrationListener.java:44) at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176) at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131) at org.springframework.boot.context.event.EventPublishingRunListener.contextLoaded(EventPublishingRunListener.java:100) at org.springframework.boot.SpringApplicationRunListeners.lambda$contextLoaded$4(SpringApplicationRunListeners.java:71) at java.util.ArrayList.forEach(ArrayList.java:1259) at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:117) at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:111) at org.springframework.boot.SpringApplicationRunListeners.contextLoaded(SpringApplicationRunListeners.java:71) at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:426) at org.springframework.boot.SpringApplication.run(SpringApplication.java:338) at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:144) at org.springframework.cloud.bootstrap.BootstrapApplicationListener.bootstrapServiceContext(BootstrapApplicationListener.java:197) at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:114) at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:77) at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176) at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131) at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:82) at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:63) at java.util.ArrayList.forEach(ArrayList.java:1259) at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:117) at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:111) at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:62) at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:375) at org.springframework.boot.SpringApplication.run(SpringApplication.java:333) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1329) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1318) at com.tcl.tms.runcenter.TmsRuncenterApplication.main(TmsRuncenterApplication.java:16)

Process finished with exit code 0

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>