1.下载地址:
官方下载地址:https://github.com/seata/seata/releases
2.创建两类数据库表: db_store数据存储表和db_undo_log日志回滚表:
db_undo_log日志回滚表 :
UNDO_LOG(回滚日志)表:记录参与者的xid和相关的操作,用于对事务的回滚
db_store数据存储表:
在db模式下,我们需要针对全局事务的会话信息创建以下 3 张数据库表。
全局事务表,对应的表为:global_table
分支事务表,对应的表为:branch_table
全局锁表,对应的表为:lock_table
数据脚本在seata-server-0.9.0\conf下的db_store.sql和db_undo_log.sql
3.修改配置文件file.conf中的数据存储方式为db
第57行:mode=“file” 修改为 mode = “db” # 数据存储方式为db数据库
3.修改配置文件registry.conf中注册中心修改nacos注册中心
registry节点的注册中心
第3行:type=“file” 修改为 type = “nacos” # 使用nacos注册中心作为注册中心
调整nacos配置信息
第6行:serverAddr = “localhost” 修改为 serverAddr = “localhost:8848” #nacos的地址