资讯 小学 初中 高中 语言 会计职称 学历提升 法考 计算机考试 医护考试 建工考试 教育百科
栏目分类:
子分类:
返回
空麓网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
空麓网 > 计算机考试 > 软件开发 > 后端开发 > Java

Seata下载安装步骤

Java 更新时间: 发布时间: 计算机考试归档 最新发布

Seata下载安装步骤

Seata下载安装步骤

1、下载安装包1.6.1

2、修改seata/seata/conf/application.yml内容,由于使用nacos作为注册中心主要seata的config、registry、store

修改前:

修改后:

seata:  config:    # support: nacos, consul, apollo, zk, etcd3    type: nacos    nacos:      server-addr: 127.0.0.1:8848      namespace: 967df0d8-156b-441a-a5ab-615b4a865168      group: MY_GROUP      ##if use MSE Nacos with auth, mutex with username/password attribute      #access-key: ""      #secret-key: ""      data-id: seataServer.properties   registry:    # support: nacos, eureka, redis, zk, consul, etcd3, sofa    type: nacos    # preferred-networks: 30.240.*    nacos:      application: seata-tc-server      server-addr: 127.0.0.1:8848      group: MY_GROUP      namespace: 967df0d8-156b-441a-a5ab-615b4a865168      #cluster: SH      ##if use MSE Nacos with auth, mutex with username/password attribute      #access-key: ""      #secret-key: ""      store:    # support: file 、 db 、 redis    mode: db    db:      datasource: druid      db-type: mysql      driver-class-name: com.mysql.cj.jdbc.Driver      url: jdbc:mysql://127.0.0.1:3306/seata?useUnicode=true&rewriteBatchedStatements=true&serverTimezone=GMT      user: root      password: 123456      min-conn: 5      max-conn: 100      global-table: global_table      branch-table: branch_table      lock-table: lock_table      distributed-lock-table: distributed_lock      query-limit: 100      max-wait: 5000

3、根据seata/seata/script/server/db/mysql.sql建数据库表seata

-- -------------------------------- The script used when storeMode is 'db' ---------------------------------- the table to store GlobalSession dataCREATE TABLE IF NOT EXISTS `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_status_gmt_modified` (`status` , `gmt_modified`),    KEY `idx_transaction_id` (`transaction_id`)) ENGINE = InnoDB  DEFAULT CHARSET = utf8mb4;-- the table to store BranchSession dataCREATE TABLE IF NOT EXISTS `branch_table`(    `branch_id`         BIGINT       NOT NULL,    `xid`               VARCHAr(128) NOT NULL,    `transaction_id`    BIGINT,    `resource_group_id` VARCHAr(32),    `resource_id`       VARCHAr(256),    `branch_type`       VARCHAr(8),    `status`            TINYINT,    `client_id`         VARCHAr(64),    `application_data`  VARCHAr(2000),    `gmt_create`        DATETIME(6),    `gmt_modified`      DATETIME(6),    PRIMARY KEY (`branch_id`),    KEY `idx_xid` (`xid`)) ENGINE = InnoDB  DEFAULT CHARSET = utf8mb4;-- the table to store lock dataCREATE TABLE IF NOT EXISTS `lock_table`(    `row_key`        VARCHAr(128) NOT NULL,    `xid`            VARCHAr(128),    `transaction_id` BIGINT,    `branch_id`      BIGINT       NOT NULL,    `resource_id`    VARCHAr(256),    `table_name`     VARCHAr(32),    `pk`             VARCHAr(36),    `status`         TINYINT      NOT NULL DEFAULT '0' COMMENT '0:locked ,1:rollbacking',    `gmt_create`     DATETIME,    `gmt_modified`   DATETIME,    PRIMARY KEY (`row_key`),    KEY `idx_status` (`status`),    KEY `idx_branch_id` (`branch_id`),    KEY `idx_xid` (`xid`)) ENGINE = InnoDB  DEFAULT CHARSET = utf8mb4;CREATE TABLE IF NOT EXISTS `distributed_lock`(    `lock_key`       CHAr(20) NOT NULL,    `lock_value`     VARCHAr(20) NOT NULL,    `expire`         BIGINT,    primary key (`lock_key`)) ENGINE = InnoDB  DEFAULT CHARSET = utf8mb4;INSERT INTO `distributed_lock` (lock_key, lock_value, expire) VALUES ('AsyncCommitting', ' ', 0);INSERT INTO `distributed_lock` (lock_key, lock_value, expire) VALUES ('RetryCommitting', ' ', 0);INSERT INTO `distributed_lock` (lock_key, lock_value, expire) VALUES ('RetryRollbacking', ' ', 0);INSERT INTO `distributed_lock` (lock_key, lock_value, expire) VALUES ('TxTimeoutCheck', ' ', 0);

4、在nacos中新增配置seataServer.properties

# 数据存储方式,db代表数据库store.mode=dbstore.db.datasource=druidstore.db.dbType=mysqlstore.db.driverClassName=com.mysql.cj.jdbc.Driverstore.db.url=jdbc:mysql://127.0.0.1:3306/seata?useUnicode=true&rewriteBatchedStatements=true&serverTimezone=GMT store.db.user=rootstore.db.password=123456store.db.minConn=5store.db.maxConn=30store.db.globalTable=global_tablestore.db.branchTable=branch_tablestore.db.queryLimit=100store.db.lockTable=lock_tablestore.db.maxWait=5000# 事务、日志等配置server.recovery.committingRetryPeriod=3000server.recovery.asynCommittingRetryPeriod=3000server.recovery.rollbackingRetryPeriod=3000server.recovery.timeoutRetryPeriod=3000server.maxCommitRetryTimeout=-1server.maxRollbackRetryTimeout=-1server.rollbackRetryTimeoutUnlockEnable=falseserver.undo.logSaveDays=7server.undo.logDeletePeriod=86400000 # 客户端与服务端传输方式transport.serialization=seatatransport.compressor=none# 关闭metrics功能,提高性能metrics.enabled=falsemetrics.registryType=compactmetrics.exporterList=prometheusmetrics.exporterPrometheusPort=9898

5、访问后台http://127.0.0.1:7091

账号:seata 密码:seata

转载请注明:文章转载自 http://www.konglu.com/
本文地址:http://www.konglu.com/it/1097117.html
免责声明:

我们致力于保护作者版权,注重分享,被刊用文章【Seata下载安装步骤】因无法核实真实出处,未能及时与作者取得联系,或有版权异议的,请联系管理员,我们会立即处理,本文部分文字与图片资源来自于网络,转载此文是出于传递更多信息之目的,若有来源标注错误或侵犯了您的合法权益,请立即通知我们,情况属实,我们会第一时间予以删除,并同时向您表示歉意,谢谢!

我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2023 成都空麓科技有限公司

ICP备案号:蜀ICP备2023000828号-2