Ubuntu 部署 Seata1.7.1

news/2023/12/3 11:26:29/文章来源:https://blog.csdn.net/qq_19734597/article/details/133276711

 一、环境说明

IP操作系统程序备注
10.0.61.22ubuntu20.04PostgreSQL-14.11已提前部署
10.0.61.21ubuntu20.04Nacos-2.1.0已提前部署
10.0.61.22ubuntu20.04seata-server-1.7.1本文将要部署

二、部署

1. 下载

wget https://github.com/seata/seata/releases/download/v1.7.1/seata-server-1.7.1.tar.gz

2. 解压

tar -zxvf seata-server-1.7.1.tar.gz
# 解压出的文件名 seata,改个名,标注版本
mv seata seata-1.7.1

3. 配置

3.1 application.yml 配置

cd  seata-1.7.1
# 备份
cp ./conf/application.yml  ./conf/application.yml.bak
# 修改
vim ./conf/application.yml

        内容如下,具体配置参照 application.example.yml 中配置修改

server:port: 8891spring:application:name: seata-serverlogging:config: classpath:logback-spring.xmlfile:path: ./logs/seataconsole:user:username: seatapassword: seataseata:config:type: nacosnacos:server-addr: 10.0.61.21:8848group: SEATA_GROUPnamespace: b1b4b131-0fa9-47cf-8ddb-afe1a4c3e7e2username: xxxxpassword: xxxxregistry:type: nacosnacos:application: seata-serverserver-addr: 10.0.61.21:8848group: SEATA_GROUPnamespace: b1b4b131-0fa9-47cf-8ddb-afe1a4c3e7e2cluster: defaultusername: xxxxpassword: xxxxsecurity:secretKey: SeataSecretKey0c382ef121d778043159209298fd40bf3850a017tokenValidityInMilliseconds: 1800000ignore:urls: /,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-fe/public/**,/api/v1/auth/login

3.2 seataServer.properties配置

        属性配置官方文档说明(未更新,还是1.4.2版本):https://seata.io/zh-cn/docs/user/configurations.html
详细配置(由于Github访问限制,给个Gitee仓库的链接):https://gitee.com/seata-io/seata/blob/v1.7.1/script/config-center/config.txt

  • 创建 seataServer.properties ,注意 namespace 、 group 、data-id 和上述 application.yml 配置中心的配置 保持一致,内容参照 详细配置链接 中配置按需配即可
  • 事务分组概念: https://seata.io/zh-cn/docs/user/txgroup/transaction-group.html

在这里插入图片描述

#transport
transport.compressor=none
transport.enableRmClientBatchSendRequest=true
transport.enableTcServerBatchSendResponse=false
transport.enableTmClientBatchSendRequest=false
transport.heartbeat=true
transport.rpcRmRequestTimeout=30000
transport.rpcTcRequestTimeout=30000
transport.rpcTmRequestTimeout=30000
transport.serialization=seata
transport.server=NIO
transport.shutdown.wait=3
transport.threadFactory.bossThreadPrefix=NettyBoss
transport.threadFactory.bossThreadSize=1
transport.threadFactory.clientSelectorThreadPrefix=NettyClientSelector
transport.threadFactory.clientSelectorThreadSize=1
transport.threadFactory.clientWorkerThreadPrefix=NettyClientWorkerThread
transport.threadFactory.serverExecutorThreadPrefix=NettyServerBizHandler
transport.threadFactory.shareBossWorker=false
transport.threadFactory.workerThreadPrefix=NettyServerNIOWorker
transport.threadFactory.workerThreadSize=default
transport.type=TCP
#service
service.default.grouplist=10.0.61.21:8891
service.disableGlobalTransaction=false
service.enableDegrade=false
service.vgroupMapping.swkj_tx_group=default
#client
client.rm.asyncCommitBufferLimit=10000
client.rm.lock.retryInterval=10
client.rm.lock.retryPolicyBranchRollbackOnConflict=true
client.rm.lock.retryTimes=30
client.rm.reportRetryCount=5
client.rm.reportSuccessEnable=false
client.rm.sagaBranchRegisterEnable=false
client.rm.sagaJsonParser=fastjson
client.rm.sqlParserType=druid
client.rm.tableMetaCheckEnable=true
client.rm.tableMetaCheckerInterval=60000
client.rm.tccActionInterceptorOrder=-2147482648
client.tm.commitRetryCount=5
client.tm.defaultGlobalTransactionTimeout=60000
client.tm.degradeCheck=false
client.tm.degradeCheckAllowTimes=10
client.tm.degradeCheckPeriod=2000
client.tm.interceptorOrder=-2147482648
client.tm.rollbackRetryCount=5
client.undo.compress.enable=true
client.undo.compress.threshold=64k
client.undo.compress.type=zip
client.undo.dataValidation=true
client.undo.logSerialization=jackson
client.undo.logTable=undo_log
client.undo.onlyCareUpdateColumns=true
#server
server.distributedLockExpireTime=10000
server.enableParallelRequestHandle=false
server.maxCommitRetryTimeout=-1
server.maxRollbackRetryTimeout=-1
server.recovery.asynCommittingRetryPeriod=1000
server.recovery.committingRetryPeriod=1000
server.recovery.rollbackingRetryPeriod=1000
server.recovery.timeoutRetryPeriod=1000
server.rollbackRetryTimeoutUnlockEnable=false
server.session.branchAsyncQueueSize=5000
server.session.enableBranchAsyncRemove=false
server.undo.logDeletePeriod=86400000
server.undo.logSaveDays=7
server.xaerNotaRetryTimeout=60000
#tcc
tcc.fence.cleanPeriod=1h
tcc.fence.logTableName=tcc_fence_log
#log
log.exceptionRate=100
#store
store.db.branchTable=branch_table
store.db.datasource=druid
store.db.dbType=postgresql
store.db.distributedLockTable=distributed_lock
store.db.driverClassName=org.postgresql.Driver
store.db.globalTable=global_table
store.db.lockTable=lock_table
store.db.maxConn=30
store.db.maxWait=5000
store.db.minConn=5
store.db.password=xxx
store.db.queryLimit=100
store.db.url=jdbc:postgresql://10.0.61.22:8832/postgres?useUnicode=true&characterEncoding=UTF-8&useSSL=false
store.db.user=postgres
store.file.dir=file_store/data
store.file.fileWriteBufferCacheSize=16384
store.file.flushDiskMode=async
store.file.maxBranchSessionSize=16384
store.file.maxGlobalSessionSize=512
store.file.sessionReloadReadSize=100
store.lock.mode=db
store.mode=db
store.redis.database=0
store.redis.maxConn=10
store.redis.maxTotal=100
store.redis.minConn=1
store.redis.mode=single
store.redis.password=xxx
store.redis.queryLimit=100
store.redis.single.host=10.0.61.21
store.redis.single.port=8879
store.session.mode=db
#metrics
metrics.enabled=false
metrics.exporterList=prometheus
metrics.exporterPrometheusPort=9898
metrics.registryType=compact

3.3 PostgreSQL脚本

        client端:

-- for AT mode you must to init this sql for you business database. the seata server not need it.
CREATE TABLE IF NOT EXISTS public.undo_log
(id            SERIAL       NOT NULL,branch_id     BIGINT       NOT NULL,xid           VARCHAR(128) NOT NULL,context       VARCHAR(128) NOT NULL,rollback_info BYTEA        NOT NULL,log_status    INT          NOT NULL,log_created   TIMESTAMP(0) NOT NULL,log_modified  TIMESTAMP(0) NOT NULL,CONSTRAINT pk_undo_log PRIMARY KEY (id),CONSTRAINT ux_undo_log UNIQUE (xid, branch_id)
);CREATE SEQUENCE IF NOT EXISTS undo_log_id_seq INCREMENT BY 1 MINVALUE 1 ;

        Server端: 

-- -------------------------------- The script used when storeMode is 'db' --------------------------------
-- the table to store GlobalSession data
CREATE TABLE IF NOT EXISTS public.global_table
(xid                       VARCHAR(128) NOT NULL,transaction_id            BIGINT,status                    SMALLINT     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                TIMESTAMP(0),gmt_modified              TIMESTAMP(0),CONSTRAINT pk_global_table PRIMARY KEY (xid)
);CREATE INDEX idx_status_gmt_modified ON public.global_table (status, gmt_modified);
CREATE INDEX idx_transaction_id ON public.global_table (transaction_id);-- the table to store BranchSession data
CREATE TABLE IF NOT EXISTS public.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            SMALLINT,client_id         VARCHAR(64),application_data  VARCHAR(2000),gmt_create        TIMESTAMP(6),gmt_modified      TIMESTAMP(6),CONSTRAINT pk_branch_table PRIMARY KEY (branch_id)
);CREATE INDEX idx_xid ON public.branch_table (xid);-- the table to store lock data
CREATE TABLE IF NOT EXISTS public.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         SMALLINT     NOT NULL DEFAULT 0,gmt_create     TIMESTAMP(0),gmt_modified   TIMESTAMP(0),CONSTRAINT pk_lock_table PRIMARY KEY (row_key)
);comment on column public.lock_table.status is '0:locked ,1:rollbacking';
CREATE INDEX idx_branch_id ON public.lock_table (branch_id);
CREATE INDEX idx_xid ON public.lock_table (xid);
CREATE INDEX idx_status ON public.lock_table (status);CREATE TABLE distributed_lock (lock_key     VARCHAR(20)  NOT NULL,lock_value        VARCHAR(20)  NOT NULL,expire       BIGINT       NOT NULL,CONSTRAINT pk_distributed_lock_table PRIMARY KEY (lock_key)
);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);

       注:在部署过程中遇到一个问题导致Seata无法启动,要注意Seata Server端需要配置环境变量在/etc/profile中:

#seata
export SEATA_IP=192.168.28.128

       环境变量生效,命令如下:

# source /etc/profile

        启动 seata-server,命令如下:

# nohup bash ./bin/seata-server.sh start -h 192.168.28.128 -m db &> seata.log &

        开启以下端口:

8891,9891

        到此Centos7 安装Seata1.7.1介绍完成。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.ldbm.cn/p/138330.html

如若内容造成侵权/违法违规/事实不符,请联系编程新知网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

科技资讯|AirPods Pro基于定位控制的自适应音频功能

在接受 TechCrunch 媒体采访时,苹果高管 Ron Huang 和 Eric Treski 谈到了关于 AirPods Pro 自适应音频(Adaptive Audio)功能的轶事,曾考虑基于 GPS 信号来控制自适应音频级别。 Treski 表示在探索自适应音频功能初期&#xff0…

数字孪生智慧能源:风光储一体化能源中心

自“双碳”目标提出以来,我国能源产业不断朝着清洁低碳化、绿色化的方向发展。其中,风能、太阳能等可再生能源在促进全球能源可持续发展、共建清洁美丽世界中被寄予厚望。风能、太阳能具有波动性、间歇性、随机性等特点,主要通过转化为电能再…

C. MEX Repetition

题目:样例: 输入 5 1 2 1 3 1 0 1 3 2 2 0 2 5 5 1 2 3 4 5 10 100 5 3 0 4 2 1 6 9 10 8输出 1 2 0 1 2 1 2 3 4 5 0 7 5 3 0 4 2 1 6 9 10 思路: 从题目和样例中,我们可以知道,从一个数组中,按照包括0的自…

设计模式5、原型模式 Prototype

解释说明:使用原型实例指定待创建对象的类型,并且通过复制这个原型阿里创建型的对象 UML 结构图: 抽象原型(Prototype):规定了具体原型对象必须实现的clone()方法 具体原型(ConcretePrototype&…

使用python脚本的时间盲注完整步骤

文章目录 一、获取数据库名称长度二、获取数据库名称三、获取表名总长度四、获取表名五、获取指定表列名总长度六、获取指定表列名七、获取指定表指定列的表内数据总长度八、获取指定表指定列的表内数据 一、获取数据库名称长度 测试环境是bwapp靶场 SQL Injection - Blind - …

Arcgis克里金插值报错:ERROR 010079: 无法估算半变异函数。 执行(Kriging)失败。

Arcgis克里金插值报错:ERROR 010079: 无法估算半变异函数。 执行(Kriging)失败。 问题描述: 原因: shape文件的问题,此图可以看出,待插值的点有好几个都超出了地理范围之外,这个不知道是坐标系配准的问…

【无标题】ICCV 2023 | CAPEAM:基于上下文感知规划和环境感知记忆机制构建具身智能体

文章链接: https://arxiv.org/abs/2308.07241 2023年,大型语言模型(LLMs)以及AI Agents的蓬勃发展为整个机器智能领域带来了全新的发展机遇。一直以来,研究者们对具身智能(Embodied Artificial Intelligenc…

vue3+eleement plus日历选择季度

<template><div class"el-quarter-wrap"><el-popover width"280" v-model"visible"><template #reference><el-input v-model"quarterDate" placeholder"请选择季度" clearable :prefix-icon&qu…

ESP32IDF — 硬件I2C使用教程

前言 &#xff08;1&#xff09;最近刚做完ESP32的一个模块的驱动移植&#xff0c;使用到了I2C。感觉ESP32的硬件I2C还是挺容易使用的。 &#xff08;2&#xff09;本文将只会介绍ESP32的硬件I2C使用&#xff0c;如果想知道软件I2C使用&#xff0c;可看其他的任意一款芯片软件I…

【李沐深度学习笔记】损失函数

课程地址和说明 损失函数p2 本系列文章是我学习李沐老师深度学习系列课程的学习笔记&#xff0c;可能会对李沐老师上课没讲到的进行补充。 损失函数 损失函数是用来衡量预测值 y ^ \hat{y} y^​或 y ′ y y′与真实值 y y y的差别&#xff0c;下面给出常见的损失函数类型&am…

Docker-Windows安装使用

1.下载docker https://cr.console.aliyun.com/cn-hangzhou/instances/mirrors 2.配置虚拟化环境 通过控制面板“设置”启用 Hyper-V 角色 右键单击 Windows 按钮并选择“应用和功能”。选择相关设置下右侧的“程序和功能”。选择“打开或关闭 Windows 功能”。选择“Hyper-…

节日灯饰灯串灯出口欧洲CE认证办理

灯串&#xff08;灯带&#xff09;&#xff0c;这个产品的形状就象一根带子一样&#xff0c;再加上产品的主要原件就是LED&#xff0c;因此叫做灯串或者灯带。2022年&#xff0c;我国灯具及相关配件产品出口总额超过460亿美元。其中北美是最大的出口市场。其次是欧洲市场&#…

平台登录页面实现(一)

文章目录 一、实现用户名、密码、登录按钮、记住用户表单1、全局css代码定义在asserts/css/global.css 二、用户名、密码、记住用户的双向绑定三、没有用户&#xff0c;点击注册功能实现四、实现输入用户名、密码、点击登录按钮进行登录操作五、实现表单项校验六、提交表单预验…

git报错:Failed to connect to 127.0.0.1 port 1080

Bug描述 由于在试了网上的这条命令 git config --global http.proxy socks5 127.0.0.1:1080 git config --global https.proxy socks5 127.0.0.1:1080git config --global http.proxy 127.0.0.1:1080 git config --global https.proxy 127.0.0.1:1080Bug描述&#xff1a;Faile…

《Upload-Labs》01. Pass 1~13

Upload-Labs 索引前言Pass-01题解 Pass-02题解总结 Pass-03题解总结 Pass-04题解 Pass-05题解总结 Pass-06题解总结 Pass-07题解总结 Pass-08题解总结 Pass-09题解 Pass-10题解 Pass-11题解 Pass-12题解总结 Pass-13题解 靶场部署在 VMware - Win7。 靶场地址&#xff1a;https…

性格孤僻怎么办?改变性格孤僻的4种方法

性格孤僻是比较常见的说法&#xff0c;日常中我们说某人性格孤僻&#xff0c;意思就是这人不太合群&#xff0c;喜欢独来独往&#xff0c;话少&#xff0c;人际关系不太好&#xff0c;其言行往往不符合大众的价值观。从性格孤僻的角度来看&#xff0c;可能跟很多种心理疾病存在…

uniapp 实现下拉筛选框 二次开发定制

前言 最近又收到了一个需求&#xff0c;需要在uniapp 小程序上做一个下拉筛选框&#xff0c;然后找了一下插件市场&#xff0c;确实有找到&#xff0c;但不过他不支持搜索&#xff0c;于是乎&#xff0c;我就自动动手&#xff0c;进行了二开定制&#xff0c;站在巨人的肩膀上&…

经历网 微信二维码 制作方法

1、谷歌浏览器&#xff0c;打开要制作微信二维码的 网站页面 2、点击页面空白处&#xff08;此步为了使鼠标激活页面&#xff0c;可省&#xff09;&#xff0c;点击鼠标右键&#xff0c;弹窗 点选 为此页面创建二维码&#xff0c;点击下载到自己指定的地方。完成。 下载下来的…

【前段基础入门之】=>CSS 常用的字体文本属性

导读&#xff1a; 这一章&#xff0c;主要分享一些 CSS 中的一些&#xff0c;常用的 字体和文本方面的属性。 文章目录 字体属性字体大小字体族字体风格字体粗细字体复合写法 文本属性文本间距文本修饰文本缩进文本水平对齐行高vertical-align 字体属性 字体大小 属性名&…

inndy_echo

inndy_echo Arch: i386-32-little RELRO: Partial RELRO Stack: No canary found NX: NX enabled PIE: No PIE (0x8048000)32位&#xff0c;只开了NX int __cdecl __noreturn main(int argc, const char **argv, const char **envp) {char s; // [espCh…