Seata第二篇(安装)

Seata-Server安装

一、下载

下载地址:https://github.com/seata/seata/releases

二、安装

1、解压缩
在这里插入图片描述
2、修改conf目录下的file.conf配置文件

  • 先备份原始file.conf文件
    在这里插入图片描述

3、修改
自定义事务组名称+事务日志存储模式为db+数据库连接信息
在这里插入图片描述

如果是使用的更高版本的mysql则需要稍加修改:
driver-class-name = “com.mysql.cj.jdbc.Driver”
url = "jdbc:mysql://127.0.0.1:3306/seata?serverTimezone=UTC&useUnicode=true&characterEncoding=utf8&useSSL=false&allowPublicKeyRetrieval=true"


4、在mysql中新建seata库
![在这里插入图片描述](https://img-blog.csdnimg.cn/88eb1169d8f74fee8cbdd5420de82acc.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ1MDc4Nzgx,size_16,color_FFFFFF,t_70)
5、在seata库建表
- 新建查询,输入以下sql语句,并执行
```sql
drop table if exists global_table;
create table global_table (
xid varchar(128) not null,
transaction_id bigint,
status tinyint not null,
application_id varchar(32),
transaction_service_group varchar(32),
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)
);

drop table if exists branch_table;
create table branch_table (
branch_id bigint not null,
xid varchar(128) not null,
transaction_id bigint ,
resource_group_id varchar(32),
resource_id varchar(256) ,
lock_key varchar(128) ,
branch_type varchar(8) ,
status tinyint,
client_id varchar(64),
application_data varchar(2000),
gmt_create datetime,
gmt_modified datetime,
primary key (branch_id),
key idx_xid (xid)
);

drop table if exists lock_table;
create table lock_table (
row_key varchar(128) not null,
xid varchar(96),
transaction_id long ,
branch_id long,
resource_id varchar(256) ,
table_name varchar(32) ,
pk varchar(36) ,
gmt_create datetime ,
gmt_modified datetime,
primary key(row_key)
);

在这里插入图片描述
6、修改seata-server-0.9.0\seata\conf目录下的registry.conf配置文件

  • 先备份registry.conf文件
    在这里插入图片描述
  • 修改seata-server-0.9.0\seata\conf目录下的registry.conf配置文件
    在这里插入图片描述

三、测试

1、启动Nacos端口号8848
- 找到Nacos目录下的bin文件,双击startup.cmd
在这里插入图片描述
在这里插入图片描述

2、启动seata-server

  • 导航到seata目录下的bin文件,在导航栏输入cmd并回车
    在这里插入图片描述
  • 输入seata-server.bat启动seata(防止闪退)
    在这里插入图片描述

3、查看服务

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值