1.参数说明
https://github.com/seata/seata/blob/develop/script/config-center/config.txt
Seata 参数配置
2.表结构
??????https://github.com/seata/seata/blob/develop/script/server/db/mysql.sql
3.pom
1.依赖seata-spring-boot-starter,支持yml、properties配置(.conf可删除),内部已依赖seata-all
2.依赖spring-cloud-alibaba-seata,内部集成了seata,并实现了xid传递
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-seata</artifactId>
<version>2.2.0.RELEASE</version>
<exclusions>
<exclusion>
<groupId>io.seata</groupId>
<artifactId>seata-spring-boot-starter</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.seata</groupId>
<artifactId>seata-spring-boot-starter</artifactId>
<version>1.4.0</version>
<exclusions>
<exclusion>
<artifactId>druid</artifactId>
<groupId>com.alibaba</groupId>
</exclusion>
</exclusions>
</dependency>
4.yml(可以直接放在nacos对应的配置信息里面)
seata:
tx-service-group: yg_tx_group #与config.txt 中的service.vgroupMapping.yg_tx_group=default一致
service:
vgroup-mapping:
yg_tx_group: default #与config.txt 中的service.vgroupMapping.yg_tx_group=default一致
grouplist:
default: ip:8091 #seata 服务地址
5.seata-server服务注册参数配置
registry {
# file 、nacos 、eureka、redis、zk、consul、etcd3、sofa
type = "nacos"
nacos {
application = "seata-server"
serverAddr = "ip:18848"
group = "dev_seata_group"
namespace = "dev_namespace"
cluster = "default"
username = "nacos"
password = "nacos"
}
}
config {
# file、nacos 、apollo、zk、consul、etcd3
type = "nacos"
nacos {
serverAddr = "ip:18848"
namespace = "dev_namespace"
group = "dev_seata_group"
username = "nacos"
password = "nacos"
dataId = "seataServer.properties"
}
}
6.seataServer.properties
参照1
7.日期类型不支持对应解决方案
LocalDateTime转换异常,springboot版本:2.4.4 · Issue #3620 · seata/seata · GitHub
|