spring cloud 集成seata记录

news/2024/4/30 9:44:52/文章来源:https://blog.csdn.net/weixin_43285931/article/details/126965776

spring cloud 集成seata记录

下载安装包

地址

在这里插入图片描述

解压

在这里插入图片描述

配置

解压后是没有config.txt文件的,需要新建三个文件

1. config.txt 放在seata根目录下

这个文件要修改下面几个地方
在这里插入图片描述

这里要对应配置文件的这里

在这里插入图片描述
在这里插入图片描述

注意:这里有个坑,部署到服务器上面会因为服务器的版本过高导致驱动不匹配

需要将store.db.driverClassName=com.mysql.cj.jdbc.Driver修改成这个,并且去这里找到你的数据库所对应的版本驱动

1、mysql>select version(); 查看mqsql版本,我的版本是8.0.19。
在这里插入图片描述
2.然后将下载好的驱动放到lib目录下的jdbc目录下,并且删掉其他的驱动

这里的要新建一个Seata数据库并新建表:sql如下

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;-- ----------------------------
-- Table structure for branch_table
-- ----------------------------
DROP TABLE IF EXISTS `branch_table`;
CREATE TABLE `branch_table`  (`branch_id` bigint(20) NOT NULL,`xid` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`transaction_id` bigint(20) NULL DEFAULT NULL,`resource_group_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,`resource_id` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,`branch_type` varchar(8) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,`status` tinyint(4) NULL DEFAULT NULL,`client_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,`application_data` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,`gmt_create` datetime(6) NULL DEFAULT NULL,`gmt_modified` datetime(6) NULL DEFAULT NULL,PRIMARY KEY (`branch_id`) USING BTREE,INDEX `idx_xid`(`xid`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;-- ----------------------------
-- Table structure for global_table
-- ----------------------------
DROP TABLE IF EXISTS `global_table`;
CREATE TABLE `global_table`  (`xid` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`transaction_id` bigint(20) NULL DEFAULT NULL,`status` tinyint(4) NOT NULL,`application_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,`transaction_service_group` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,`transaction_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,`timeout` int(11) NULL DEFAULT NULL,`begin_time` bigint(20) NULL DEFAULT NULL,`application_data` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,`gmt_create` datetime NULL DEFAULT NULL,`gmt_modified` datetime NULL DEFAULT NULL,PRIMARY KEY (`xid`) USING BTREE,INDEX `idx_gmt_modified_status`(`gmt_modified`, `status`) USING BTREE,INDEX `idx_transaction_id`(`transaction_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;-- ----------------------------
-- Table structure for lock_table
-- ----------------------------
DROP TABLE IF EXISTS `lock_table`;
CREATE TABLE `lock_table`  (`row_key` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`xid` varchar(96) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,`transaction_id` bigint(20) NULL DEFAULT NULL,`branch_id` bigint(20) NOT NULL,`resource_id` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,`table_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,`pk` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,`gmt_create` datetime NULL DEFAULT NULL,`gmt_modified` datetime NULL DEFAULT NULL,PRIMARY KEY (`row_key`) USING BTREE,INDEX `idx_branch_id`(`branch_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

并且需要在业务数据库新建一张undo表,如果有多个数据库则每个数据库都需要新建

-- ----------------------------
-- Table structure for undo_log
-- ----------------------------
DROP TABLE IF EXISTS `undo_log`;
CREATE TABLE `undo_log`  (`branch_id` bigint(20) NOT NULL COMMENT 'branch transaction id',`xid` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'global transaction id',`context` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'undo_log context,such as serialization',`rollback_info` longblob NOT NULL COMMENT 'rollback info',`log_status` int(11) NOT NULL COMMENT '0:normal status,1:defense status',`log_created` datetime(6) NOT NULL COMMENT 'create datetime',`log_modified` datetime(6) NOT NULL COMMENT 'modify datetime',UNIQUE INDEX `ux_undo_log`(`xid`, `branch_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = 'AT transaction mode undo table' ROW_FORMAT = Dynamic;SET FOREIGN_KEY_CHECKS = 1;
#For details about configuration items, see https://seata.io/zh-cn/docs/user/configurations.html
#Transport configuration, for client and server
transport.type=TCP
transport.server=NIO
transport.heartbeat=true
transport.enableTmClientBatchSendRequest=false
transport.enableRmClientBatchSendRequest=true
transport.enableTcServerBatchSendResponse=false
transport.rpcRmRequestTimeout=30000
transport.rpcTmRequestTimeout=30000
transport.rpcTcRequestTimeout=30000
transport.threadFactory.bossThreadPrefix=NettyBoss
transport.threadFactory.workerThreadPrefix=NettyServerNIOWorker
transport.threadFactory.serverExecutorThreadPrefix=NettyServerBizHandler
transport.threadFactory.shareBossWorker=false
transport.threadFactory.clientSelectorThreadPrefix=NettyClientSelector
transport.threadFactory.clientSelectorThreadSize=1
transport.threadFactory.clientWorkerThreadPrefix=NettyClientWorkerThread
transport.threadFactory.bossThreadSize=1
transport.threadFactory.workerThreadSize=default
transport.shutdown.wait=3
transport.serialization=seata
transport.compressor=none#Transaction routing rules configuration, only for the client
service.vgroupMapping.my_test_tx_group=default
#If you use a registry, you can ignore it
service.default.grouplist=127.0.0.1:8091
service.enableDegrade=false
service.disableGlobalTransaction=false#Transaction rule configuration, only for the client
client.rm.asyncCommitBufferLimit=10000
client.rm.lock.retryInterval=10
client.rm.lock.retryTimes=30
client.rm.lock.retryPolicyBranchRollbackOnConflict=true
client.rm.reportRetryCount=5
client.rm.tableMetaCheckEnable=true
client.rm.tableMetaCheckerInterval=60000
client.rm.sqlParserType=druid
client.rm.reportSuccessEnable=false
client.rm.sagaBranchRegisterEnable=false
client.rm.sagaJsonParser=fastjson
client.rm.tccActionInterceptorOrder=-2147482648
client.tm.commitRetryCount=5
client.tm.rollbackRetryCount=5
client.tm.defaultGlobalTransactionTimeout=60000
client.tm.degradeCheck=false
client.tm.degradeCheckAllowTimes=10
client.tm.degradeCheckPeriod=2000
client.tm.interceptorOrder=-2147482648
client.undo.dataValidation=true
client.undo.logSerialization=jackson
client.undo.onlyCareUpdateColumns=true
server.undo.logSaveDays=7
server.undo.logDeletePeriod=86400000
client.undo.logTable=undo_log
client.undo.compress.enable=true
client.undo.compress.type=zip
client.undo.compress.threshold=64k
#For TCC transaction mode
tcc.fence.logTableName=tcc_fence_log
tcc.fence.cleanPeriod=1h#Log rule configuration, for client and server
log.exceptionRate=100#Transaction storage configuration, only for the server. The file, db, and redis configuration values are optional.
store.mode=db
store.lock.mode=file
store.session.mode=file
#Used for password encryption
store.publicKey=#If `store.mode,store.lock.mode,store.session.mode` are not equal to `file`, you can remove the configuration block.
store.file.dir=file_store/data
store.file.maxBranchSessionSize=16384
store.file.maxGlobalSessionSize=512
store.file.fileWriteBufferCacheSize=16384
store.file.flushDiskMode=async
store.file.sessionReloadReadSize=100#These configurations are required if the `store mode` is `db`. If `store.mode,store.lock.mode,store.session.mode` are not equal to `db`, you can remove the configuration block.
store.db.datasource=druid
store.db.dbType=mysql
store.db.driverClassName=com.mysql.cj.jdbc.Driver
store.db.url=jdbc:mysql://192.168.1.102:3306/seata?useUnicode=true&rewriteBatchedStatements=true
store.db.user=demo
store.db.password=qweQWE@#$%^&*123456
store.db.minConn=5
store.db.maxConn=30
store.db.globalTable=global_table
store.db.branchTable=branch_table
store.db.distributedLockTable=distributed_lock
store.db.queryLimit=100
store.db.lockTable=lock_table
store.db.maxWait=5000#These configurations are required if the `store mode` is `redis`. If `store.mode,store.lock.mode,store.session.mode` are not equal to `redis`, you can remove the configuration block.
store.redis.mode=single
store.redis.single.host=127.0.0.1
store.redis.single.port=6379
store.redis.sentinel.masterName=
store.redis.sentinel.sentinelHosts=
store.redis.maxConn=10
store.redis.minConn=1
store.redis.maxTotal=100
store.redis.database=0
store.redis.password=
store.redis.queryLimit=100#Transaction rule configuration, only for the server
server.recovery.committingRetryPeriod=1000
server.recovery.asynCommittingRetryPeriod=1000
server.recovery.rollbackingRetryPeriod=1000
server.recovery.timeoutRetryPeriod=1000
server.maxCommitRetryTimeout=-1
server.maxRollbackRetryTimeout=-1
server.rollbackRetryTimeoutUnlockEnable=false
server.distributedLockExpireTime=10000
server.xaerNotaRetryTimeout=60000
server.session.branchAsyncQueueSize=5000
server.session.enableBranchAsyncRemove=false
server.enableParallelRequestHandle=false#Metrics configuration, only for the server
metrics.enabled=false
metrics.registryType=compact
metrics.exporterList=prometheus
metrics.exporterPrometheusPort=9898```

2. 这两个 放在conf目录下

在这里插入图片描述
nacos-config.sh

#!/bin/sh
# Copyright 1999-2019 Seata.io Group.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at、
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.while getopts ":h:p:g:t:u:w:" opt
docase $opt inh)host=$OPTARG;;p)port=$OPTARG;;g)group=$OPTARG;;t)tenant=$OPTARG;;u)username=$OPTARG;;w)password=$OPTARG;;?)echo " USAGE OPTION: $0 [-h host] [-p port] [-g group] [-t tenant] [-u username] [-w password] "exit 1;;esac
doneif [ -z ${host} ]; thenhost=localhost
fi
if [ -z ${port} ]; thenport=8848
fi
if [ -z ${group} ]; thengroup="SEATA_GROUP"
fi
if [ -z ${tenant} ]; thentenant=""
fi
if [ -z ${username} ]; thenusername=""
fi
if [ -z ${password} ]; thenpassword=""
finacosAddr=$host:$port
contentType="content-type:application/json;charset=UTF-8"echo "set nacosAddr=$nacosAddr"
echo "set group=$group"urlencode() {length="${#1}"i=0while [ $length -gt $i ]; dochar="${1:$i:1}"case $char in[a-zA-Z0-9.~_-]) printf $char ;;*) printf '%%%02X' "'$char" ;;esaci=`expr $i + 1`done
}failCount=0
tempLog=$(mktemp -u)
function addConfig() {dataId=`urlencode $1`content=`urlencode $2`curl -X POST -H "${contentType}" "http://$nacosAddr/nacos/v1/cs/configs?dataId=$dataId&group=$group&content=$content&tenant=$tenant&username=$username&password=$password" >"${tempLog}" 2>/dev/nullif [ -z $(cat "${tempLog}") ]; thenecho " Please check the cluster status. "exit 1fiif [ "$(cat "${tempLog}")" == "true" ]; thenecho "Set $1=$2 successfully "elseecho "Set $1=$2 failure "failCount=`expr $failCount + 1`fi
}count=0
COMMENT_START="#"
for line in $(cat $(dirname "$PWD")/config.txt | sed s/[[:space:]]//g); doif [[ "$line" =~ ^"${COMMENT_START}".*  ]]; thencontinueficount=`expr $count + 1`key=${line%%=*}value=${line#*=}addConfig "${key}" "${value}"
doneecho "========================================================================="
echo " Complete initialization parameters,  total-count:$count ,  failure-count:$failCount "
echo "========================================================================="if [ ${failCount} -eq 0 ]; thenecho " Init nacos config finished, please start seata-server. "
elseecho " init nacos config fail. "
fi

nacos-config.py

#!/usr/bin/env python3
#  -*- coding: UTF-8 -*-import http.client
import sys
import getopt as opts
import urllib.parse
import redef get_params() -> dict:params = {'-h': '127.0.0.1','-p': '8848','-t': '','-g': 'SEATA_GROUP','-u': '','-w': ''}inputs, args = opts.getopt(sys.argv[1:], shortopts='h:p:t:g:u:w:')for k, v in inputs:params[k] = vprint(params)return paramsdef error_exit():print('python nacos-config.py [-h host] [-p port] [-t tenant] [-g group] [-u username] [-w password]')exit()def get_pair(line: str) -> tuple:res = re.match(r"([\.\w]+)=(.*)",line)return res.groups() if res is not None else ['','']headers = {'content-type': "application/x-www-form-urlencoded"
}hasError = Falseparams = get_params()url_prefix = f"{params['-h']}:{params['-p']}"
tenant = params['-t']
username = params['-u']
password = params['-w']
group = params['-g']
url_postfix_base = f'/nacos/v1/cs/configs?group={group}&tenant={tenant}'if username != '' and password != '':url_postfix_base += f'&username={username}&password={password}'if url_prefix == ':':error_exit()for line in open('../config.txt'):pair = get_pair(line.rstrip("\n"))if len(pair) < 2 or pair[0] == '' or pair[0].startswith("#") or pair[1] == '':continueurl_postfix = url_postfix_base + f'&dataId={urllib.parse.quote(str(pair[0]))}&content={urllib.parse.quote(str(pair[1])).strip()}'conn = http.client.HTTPConnection(url_prefix)conn.request("POST", url_postfix, headers=headers)res = conn.getresponse()data = res.read().decode("utf-8")if data != "true":hasError = Trueprint(f"{pair[0]}={pair[1]} {data if hasError else 'success'}")if hasError:print("init nacos config fail.")
else:print("init nacos config finished, please start seata-server.")

3. registry.conf

在这里插入图片描述

registry {# file 、nacos 、eureka、redis、zk、consul、etcd3、sofatype = "nacos"nacos {application = "seata-server"serverAddr = "127.0.0.1:8848"group = "SEATA_GROUP"namespace = ""cluster = "default"username = ""password = ""}eureka {serviceUrl = "http://localhost:8761/eureka"application = "default"weight = "1"}redis {serverAddr = "localhost:6379"db = 0password = ""cluster = "default"timeout = 0}zk {cluster = "default"serverAddr = "127.0.0.1:2181"sessionTimeout = 6000connectTimeout = 2000username = ""password = ""}consul {cluster = "default"serverAddr = "127.0.0.1:8500"aclToken = ""}etcd3 {cluster = "default"serverAddr = "http://localhost:2379"}sofa {serverAddr = "127.0.0.1:9603"application = "default"region = "DEFAULT_ZONE"datacenter = "DefaultDataCenter"cluster = "default"group = "SEATA_GROUP"addressWaitTime = "3000"}file {name = "file.conf"}
}config {# file、nacos 、apollo、zk、consul、etcd3type = "nacos"nacos {serverAddr = "127.0.0.1:8848"namespace = ""group = "SEATA_GROUP"username = "nacos"password = "nacos"dataId = "seataServer.properties"}consul {serverAddr = "127.0.0.1:8500"aclToken = ""}apollo {appId = "seata-server"## apolloConfigService will cover apolloMetaapolloMeta = "http://192.168.1.204:8801"apolloConfigService = "http://192.168.1.204:8080"namespace = "application"apolloAccesskeySecret = ""cluster = "seata"}zk {serverAddr = "127.0.0.1:2181"sessionTimeout = 6000connectTimeout = 2000username = ""password = ""nodePath = "/seata/seata.properties"}etcd3 {serverAddr = "http://localhost:2379"}file {name = "file.conf"}
}

启动seata

1.使用conf目录下的nacos-config.sh,将config.txt文件里面的内容推送到nacos上

sudo bash nacos-config.sh -h localhost -p 8848 -u nacos -w nacos

注:windows平台可以使用Git 运行nacos-config.sh脚本
在这里插入图片描述
在这里插入图片描述

nacos-config.sh命令的参数如下:sh nacos-config.sh -h localhost -p 8848 -u username -w passwordParameter Description:-h: host, the default value is localhost.-p: port, the default value is 8848.-g: Configure grouping, the default value is 'SEATA_GROUP'.-t: Tenant information, corresponding to the namespace ID field of Nacos, the default value is ''.-u: username, nacos 1.2.0+ on permission control, the default value is ''.-w: password, nacos 1.2.0+ on permission control, the default value is ''.

执行成功后,打开nacos控制台
在这里插入图片描述

2.启动seata

执行 seata-server-1.4.2\bin 目录下的 seata-server.bat/seata-server.sh 启动seata服务
在这里插入图片描述
打开nacos控制台,此时seata已经成功注册到nacos注册中心

在这里插入图片描述

代码配置

在parent文件增加依赖

 <alibaba.cloud.version>2.2.5.RELEASE</alibaba.cloud.version><!--分布式事务 seata--><dependency><groupId>com.alibaba.cloud</groupId><artifactId>spring-cloud-starter-alibaba-seata</artifactId><version>${alibaba.cloud.version}</version></dependency>

以及所有子服务增加

		<dependency><groupId>com.alibaba.cloud</groupId><artifactId>spring-cloud-starter-alibaba-seata</artifactId></dependency>

根据不同的服务增加不同的yml配置

# seata config
seata:enabled: trueapplication-id: user-service # 这个根据不同的服务进行修改tx-service-group: my_test_tx_group # 事务群组(可以每个应用单独取名,也可以使用相同名字,独立起名需要配置nacos)registry:type: nacosnacos:server-addr: 127.0.0.1:8848namespace:cluster: defaultconfig:type: nacosnacos:namespace:server-addr: 127.0.0.1:8848

nacos配置也需要改变

spring:cloud:nacos:discovery:server-addr: 127.0.0.1:8848namespace: dev #根据不同的服务环境进行配置config:namespace: devserver-addr: 127.0.0.1:8848

使用

场景:A服务调用B服务

则在A服务的方法上增加这个注解

@GlobalTransactional(timeoutMills = 10000, name = "spring-cloud-seata", rollbackFor = Exception.class)

在这里插入图片描述

则在B服务的方法上增加这个注解

    @Transactional(rollbackFor = Exception.class)

在这里插入图片描述

参考链接

在linux执行.sh脚本启动seata的时候报gc的错,原因是jdk版本太高

在这里插入图片描述
解决方法:1是降低版本,2是去掉cms配置,但是去掉cms配置后又报下面的错

在这里插入图片描述
这里需要在配置文件增加一个这个

--add-opens=java.base/java.lang=ALL-UNNAMED

完整的linux启动脚本如下


# resolve links - $0 may be a softlink
PRG="$0"while [ -h "$PRG" ]; dols=`ls -ld "$PRG"`link=`expr "$ls" : '.*-> \(.*\)$'`if expr "$link" : '/.*' > /dev/null; thenPRG="$link"elsePRG=`dirname "$PRG"`/"$link"fi
donePRGDIR=`dirname "$PRG"`
BASEDIR=`cd "$PRGDIR/.." >/dev/null; pwd`# Reset the REPO variable. If you need to influence this use the environment setup file.
REPO=# OS specific support.  $var _must_ be set to either true or false.
cygwin=false;
darwin=false;
case "`uname`" inCYGWIN*) cygwin=true ;;Darwin*) darwin=trueif [ -z "$JAVA_VERSION" ] ; thenJAVA_VERSION="CurrentJDK"elseecho "Using Java version: $JAVA_VERSION"fiif [ -z "$JAVA_HOME" ]; thenif [ -x "/usr/libexec/java_home" ]; thenJAVA_HOME=`/usr/libexec/java_home`elseJAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/${JAVA_VERSION}/Homefifi       ;;
esacif [ -z "$JAVA_HOME" ] ; thenif [ -r /etc/gentoo-release ] ; thenJAVA_HOME=`java-config --jre-home`fi
fi# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin ; then[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`[ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
fi# If a specific java binary isn't specified search for the standard 'java' binary
if [ -z "$JAVACMD" ] ; thenif [ -n "$JAVA_HOME"  ] ; thenif [ -x "$JAVA_HOME/jre/sh/java" ] ; then# IBM's JDK on AIX uses strange locations for the executablesJAVACMD="$JAVA_HOME/jre/sh/java"elseJAVACMD="$JAVA_HOME/bin/java"fielseJAVACMD=`which java`fi
fiif [ ! -x "$JAVACMD" ] ; thenecho "Error: JAVA_HOME is not defined correctly." 1>&2echo "  We cannot execute $JAVACMD" 1>&2exit 1
fiif [ -z "$REPO" ]
thenREPO="$BASEDIR"/lib
fiCLASSPATH="$BASEDIR"/conf:"$REPO"/*ENDORSED_DIR=
if [ -n "$ENDORSED_DIR" ] ; thenCLASSPATH=$BASEDIR/$ENDORSED_DIR/*:$CLASSPATH
fiif [ -n "$CLASSPATH_PREFIX" ] ; thenCLASSPATH=$CLASSPATH_PREFIX:$CLASSPATH
fi# For Cygwin, switch paths to Windows format before running java
if $cygwin; then[ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --windows "$CLASSPATH"`[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`[ -n "$HOME" ] && HOME=`cygpath --path --windows "$HOME"`[ -n "$BASEDIR" ] && BASEDIR=`cygpath --path --windows "$BASEDIR"`[ -n "$REPO" ] && REPO=`cygpath --path --windows "$REPO"`
fiexec "$JAVACMD" $JAVA_OPTS -server --add-opens=java.base/java.lang=ALL-UNNAMED -Xmx2048m -Xms2048m -Xmn1024m -Xss512k -XX:SurvivorRatio=10 -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=256m -XX:MaxDirectMemorySize=1024m -XX:-OmitStackTraceInFastThrow -XX:-UseAdaptiveSizePolicy -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath="$BASEDIR"/logs/java_heapdump.hprof -XX:+DisableExplicitGC  -Xloggc:"$BASEDIR"/logs/seata_gc.log -verbose:gc -Dio.netty.leakDetectionLevel=advanced -Dlogback.color.disable-for-bat=true \-classpath "$CLASSPATH" \-Dapp.name="seata-server" \-Dapp.pid="$$" \-Dapp.repo="$REPO" \-Dapp.home="$BASEDIR" \-Dbasedir="$BASEDIR" \io.seata.server.Server \"$@"

启动成功

在这里插入图片描述

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

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

相关文章

算法入门之队列

算法入门之队列 前言 队列和栈及其类似&#xff0c;队列在现实生活中的例子就是隧道&#xff0c;单通道一条线&#xff0c;先进去的先出来&#xff0c;后进去的后出来。 在算法中的队列也是这样 队列中从队头位置出队&#xff0c;从队尾入队&#xff0c;队列中的元素永远是先…

三问 Python:能干什么?为什么火?会继续火吗?

前段时间&#xff0c;博主的学校出了毕业率的统计报告。基本就业率都有90%,由于我的大学里面并没有开设Python的学习课程&#xff0c;这意味着没有python的校招&#xff0c;在我的大学开设的主流课程还是java&#xff0c;c之类的。 没有校招&#xff0c;就是要自己去外面面试了…

【刷题日记】8.二分查找

目录 题目链接&#xff1a;704. 二分查找 - 力扣&#xff08;LeetCode&#xff09; 一、题目介绍 二、思路 左闭右闭区间写法 三、代码 总结 题目链接&#xff1a;704. 二分查找 - 力扣&#xff08;LeetCode&#xff09; 一、题目介绍 这道题就是基本的二分查找&#xff…

JavaScript面向对象

一、面向过程和面向对象 1、两大编程思想&#xff1a;面向过程和面向对象 面向过程编程&#xff08;OPP&#xff09; 装修房屋的流程&#xff1a; ​ 1.找张三设计&#xff0c;你要给张三提供房屋结构图纸 ​ 2.找李四安装水电&#xff0c;你要给李四买好水管电线 ​ 3.找…

室友打了一把王者我学会了CMake的使用(初学者必备)

CMakeCMake介绍CMake安装以及简单的使用利用CMake生成动静态库链接动静态库CMake介绍 CMake是开源、跨平台的构建工具&#xff0c;可以让我们通过编写简单的配置文件去生成本地的Makefile&#xff0c;这个配置文件是独立于运行平台和编译器的&#xff0c;这样就不用亲自去编写…

web协议-接口测试-Python自动化面试题

1、http和https的区别 http是超文本传输协议&#xff0c;端口是80 https是由SSLhttp协议构成&#xff08;https多了个加密协议&#xff0c;比http更安全&#xff09;&#xff0c;端口是443 2、TCP和UDP的区别 两者都属于传输层协议 TCP是面向连接的&#xff0c;建立TCP需要三…

Mysql主从切换流程

Mysql主从切换流程1.Mysql 版本2.场景3.环境4.切换步骤4.1 切断应用对主库的流量4.2 主库备库设置只读4.3 查看备库复制进程状态4.4 比对主备两边的GTID是否一致4.5 确认是否真正同完4.6 从库停掉复制进程并清空主从信息4.7 从库关闭只读开启读写&#xff0c;转为新主库4.8 主库…

在线反馈,急速解决,移动云视频客服让沟通从此不设限

对于产品而言&#xff0c;用户体验至关重要&#xff0c;而客服的服务质量就是用户体验的“灵魂”。随着移动云多达230全栈产品在云计算市场中的热卖&#xff0c;人们在使用产品中难免也会产生诸多问题&#xff0c;考虑到消费者在与客服沟通时打字描述太繁琐&#xff0c;在线沟通…

九零后程序员心塞:“30岁,月薪还没过万,是我的问题吗”

2020年有职场专家指出&#xff1a; 四千元的月薪&#xff0c;在国内算是中等的薪资水平。 每个月能赚到四千块&#xff0c;就打败了一半的国人&#xff1b; 如果每个月能赚8000~10000&#xff0c;那你就能跑赢90%的国人。 这几个数字是怎么得出来的&#xff1f; 我们可以从两…

上次没砍我的,这次我又来了;看完这篇还不明白 Binder 你砍我

最近一段时间由于工作&#xff0c;接触到 Framework 部分比较多一点&#xff0c;也难免要和 Binder 打一些交道&#xff0c; 因为在 Android 系统中&#xff0c;每一个应用程序都是由一些 Activity 和 Service 组成的&#xff0c;这些 Activity 和 Service 有可能运行在同一个进…

java基于springboot+vue的旅游心得分享攻略系统 elementui

SpringBoot是当前最流向的一个框架&#xff0c;它的配置更加的简单&#xff0c;使开发变得更加的简单迅速。 Spring Boot 的基础结构共三个文件&#xff0c;具体如下&#xff1a; src/main/java&#xff1a;程序开发以及主程序入口&#xff1b; src/main/resources&#xff1a;…

vue serve及其与vue-cli-service serve之间的关系

vue serve及其与vue-cli-service serve之间的关系 目录 vue serve及其与vue-cli-service serve之间的关系 一、前言 二、vue命令 三、package.json的preset预置的配置命令参数 3.1、依赖与开发依赖 3.2、vue/cli-service 的内部 3.3、vue -***命令如何跑起来 四、vue …

HTML篇三——(2)

目录一、HTML常用标签1.5 文本格式化标签1.6 <div> 和<span>标签一、HTML常用标签 标题标签、段落标签、换行标签见&#xff1a;https://editor.csdn.net/md/?articleId126970642 1.5 文本格式化标签 文本格式化标签是为文字设置粗体、斜体以及下划线等效果&am…

有了这个 Python 库,以后再也不用写正则表达式了

正则表达式大家应该有了解过吧&#xff1f;它功能很强大&#xff0c;但有一个痛点就是不太容易读写&#xff0c;我们需要了解正则的很多语法规则才能写出一个健壮的正则表达式&#xff0c;很多朋友估计听到正则表达式估计都焦头烂额了。 就没有解决办法吗&#xff1f; 有的&a…

单播以及多播的书写实验

实验目的&#xff1a; 学习对每个分类单播的理解以及书写 学习对每个分类多播的理解以及书写 实验说明&#xff1a; 通过此实验练习&#xff0c;可以更好的掌握IPv6地址书写以及分类 实验环境&#xff1a; 两台支持SPSERVICES的IOS的路由器 直通线以及串口线 实…

树莓派高级开发之树莓派博通BCM2835芯片手册导读与及“相关IO口驱动代码的编写”

首先我们要知道&#xff0c;驱动的两大利器&#xff1a;电路图&#xff08;通过电路图去寻找寄存器&#xff09;和芯片手册 一、寄存器的介绍 芯片手册第六章的89页&#xff0c;GPIO有41个寄存器&#xff0c;所有访问都是32位的。Description是寄存器的功能描述。GPFSEL0&…

2022年最新《Java八股文面试宝典》全网独一份!(效率最高、知识最新、包含各个技术栈)

今天在脉脉刷到了这么一条消息&#xff0c;现在这个大环境&#xff0c;都后悔学Java了&#xff0c;想转行学前端&#xff0c; 看完很是震惊&#xff0c;据大数据统计&#xff0c;Java的待遇是要好过前端的。小伙伴竟然被卷到想要转行......但是行情这个东西&#xff0c;也不是我…

vue3.x之isRef toRefs isRef readonly 公共数据配置 axios配置 路由配置

isRef toRefs toRef 参数&#xff1a; (源对象 , 源对象属性) 可以用来为源响应式对象上的某个 property 新创建一个 ref。然后&#xff0c;ref 可以被传递&#xff0c;它会保持对其源 property 的响应式连接。 也就是说源响应式对象(toRef的第一个参数) 上的某个 property…

【3D视觉】PointNet解析

您好&#xff0c;各位&#xff01;今天就基于3D点云数据的分类以及分割模型 : PointNet与PointNet做一个简单的解析&#xff0c;解析部分将结合论文与代码&#xff0c;加上一些我个人微不足道&#xff08;也不一定对&#xff09;的见解在里面。 在看PointNet与PointNet之前&am…

第三章实验

实例一print("今有物不知其数,三三数之剩二,五五数之剩三,七七数之剩二,问几何?\n") number = int(input("请输入您认为符合条件的数:")) if number%3 == 2 and number%5 == 3 and number%7 == 2:print(number,"符合条件:三三数之剩二,五五数…