版本: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