apache / apache/incubator-seata

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

Open
#4,776 14 comments 3 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
26k
Forks
8.8k
Avg merge
1d 8h
Merged PRs (30d)
4

Description

### nacos
图1
![图1](https://user-images.githubusercontent.com/84951843/178926188-0f044537-6a7d-4445-b36c-3deb8d64dab8.png)
图2
![图2](https://user-images.githubusercontent.com/84951843/178926297-d4cad6b6-ea39-4a46-a105-8b0f518b723b.png)
图3
![图3](https://user-images.githubusercontent.com/84951843/178926416-c439211d-4358-4cfd-a859-1938337cef62.png)

### 项目配置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的端口,才能保证正常访问。

Contributor guide

Open the contributing guide

Research direction

Start with script/client/spring/application.yml and compare its documented parameters with the posted application.yml, screenshots, and Nacos setup. Done means the relevant Seata/Nacos settings and required ports are explained clearly enough for users to reproduce the configuration without debugging through the code.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring-boot
Domain
backend, documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.