seata高可用集群部署

本文档详细介绍了如何在Seata 1.2.0版本中进行高可用集群部署,特别是使用db模式。内容包括创建seata_server数据库和表结构,配置file.conf和registry.conf以选择db存储模式和eureka注册中心,并在客户端进行相应的配置,如引入pom,创建GlobalTransactionScanner,配置数据源,以及客户端的file.conf、registry.conf和seata.conf文件。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

版本:seata1.2.0

参考官方文档:https://github.com/seata/seata-samples/tree/master/ha

注意:在store mode是file的模式下,是不支持集群部署

db模式

在1.3及以上的版本中支持redis的模式来实现集群部署

数据可配置

创建seata_server数据库及表结构,sql如下:

-- 创建数据库
create database seata_server;

-- the table to store GlobalSession data
drop table `global_table`;
create table `global_table` (
  `xid` varchar(128)  not null,
  `transaction_id` bigint,
  `status` tinyint not null,
  `application_id` varchar(64),
  `transaction_service_group` varchar(64),
  `transaction_name` varchar(128),
  `timeout` int,
  `begin_time` bigint,
  `application_data` varchar(2000),
  `gmt_create` datetime,
  `gmt_modified` datetime,
  primary key (`xid`),
  key `idx_gmt_modified_status` (`gmt_modified`, `status`),
  key `idx_transaction_id` (`transaction_id`)
);

-- the table to store BranchSession data
drop 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值