Seata分布式事务管理

Seata 是一款开源的分布式事务解决方案,致力于在微服务架构下提供高性能和简单易用的分布式事务服务

1.下载 :http://seata.io/zh-cn/blog/download.html

2.修改配置

1.file.conf 自定义事务组名称,事务日志存储模式改为db,数据库连接信息

1.自定义事务组名称
service {
  #vgroup->rgroup
  vgroup_mapping.my_test_tx_group = "my_tx_group"
  #only support single node
  default.grouplist = "127.0.0.1:8091"
  #degrade current not support
  enableDegrade = false
  #disable
  disable = false
  #unit ms,s,m,h,d represents milliseconds, seconds, minutes, hours, days, default permanent
  max.commit.retry.timeout = "-1"
  max.rollback.retry.timeout = "-1"
}
## 2.store mode: file、db、redis
  mode = "db"
## 3.database store property
  db {
    ## the implement of javax.sql.DataSource, such as DruidDataSource(druid)/BasicDataSource(dbcp)/HikariDataSource(hikari) etc.
    datasource = "druid"
    ## mysql/oracle/postgresql/h2/oceanbase etc.
    dbType = "mysql"
    driverClassName = "com.mysql.jdbc.Driver"
    url = "jdbc:mysql://127.0.0.1:3306/seata"
    user = "root"
    password = "1234"
    minConn = 5
    maxConn = 30
    globalTable = "global_table"
    branchTable = "branch_table"
    lockTable = "lock_table"
    queryLimit = 100
    maxWait = 5000
  }

2.创建名为seata的数据库并执行seata自带的db_store.sql

3.修改registry.conf

# 1.file 、nacos 、eureka、redis、zk、consul、etcd3、sofa
  type = "nacos"

  nacos {
    #2.
    serverAddr = "127.0.0.1:8848"
    namespace = ""
    cluster = "default"
  }

3.启动:先启动nacos,再启动seata

你可能感兴趣的:(Seata分布式事务管理)