欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

在win10系統(tǒng)下,如何配置Spring Cloud alibaba Seata以及出現(xiàn)問題時怎么解決

 更新時間:2021年06月16日 14:38:31   作者:釀醋廠廠長  
今天教大家如何在win10系統(tǒng)下,配置Spring Cloud alibaba Seata以及出現(xiàn)問題時怎么解決,文中有非常詳細(xì)的介紹及代碼示例,需要的朋友可以參考下

實戰(zhàn)開始

先看報錯問題:

config.txt: No such file or directory
=========================================================================
 Complete initialization parameters,  total-count:0 ,  failure-count:0
=========================================================================
 Init nacos config finished, please start seata-server.

在這里插入圖片描述

去nacos中,配置文件一個也沒有加到到自己的匿名空間里。慢慢聽我講

客官先別急,喝杯茶。

分布式事務(wù)seata要與nacos服務(wù)注冊與發(fā)現(xiàn)緊密使用。
nacos官方下載安裝包:https://github.com/alibaba/nacos/releases
seata官方下載安裝包:https://github.com/seata/seata/releases
seata官網(wǎng):http://seata.io/zh-cn/
下載自己喜歡的版本,我下載的是1.4.0

在這里插入圖片描述

第二步:創(chuàng)建數(shù)據(jù)庫
下載維護(hù)seata事務(wù)信息的mysql.sql

-- the table to store GlobalSession data
use seata;
drop table if exists `seata.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`)
);

-- the table to store BranchSession data
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`)
);

-- the table to store lock data
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`)
);

還需要下載:兩個文件config.txt、nacos-config.sh 這里我就不給下載鏈接了,直接復(fù)制就好
nacos-config.sh 這個文件不需要改動

#!/usr/bin/env bash
# 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
do
  case $opt in
  h)
    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
done

if [[ -z ${host} ]]; then
    host=localhost
fi
if [[ -z ${port} ]]; then
    port=8848
fi
if [[ -z ${group} ]]; then
    group="SEATA_GROUP"
fi
if [[ -z ${tenant} ]]; then
    tenant=""
fi
if [[ -z ${username} ]]; then
    username=""
fi
if [[ -z ${password} ]]; then
    password=""
fi

nacosAddr=$host:$port
contentType="content-type:application/json;charset=UTF-8"

echo "set nacosAddr=$nacosAddr"
echo "set group=$group"

failCount=0
tempLog=$(mktemp -u)
function addConfig() {
  curl -X POST -H "${contentType}" "http://$nacosAddr/nacos/v1/cs/configs?dataId=$1&group=$group&content=$2&tenant=$tenant&username=$username&password=$password" >"${tempLog}" 2>/dev/null
  if [[ -z $(cat "${tempLog}") ]]; then
    echo " Please check the cluster status. "
    exit 1
  fi
  if [[ $(cat "${tempLog}") =~ "true" ]]; then
    echo "Set $1=$2 successfully "
  else
    echo "Set $1=$2 failure "
    (( failCount++ ))
  fi
}

count=0
for line in $(cat $(dirname "$PWD")/config.txt | sed s/[[:space:]]//g); do
  (( count++ ))
	key=${line%%=*}
    value=${line#*=}
	addConfig "${key}" "${value}"
done

echo "========================================================================="
echo " Complete initialization parameters,  total-count:$count ,  failure-count:$failCount "
echo "========================================================================="

if [[ ${failCount} -eq 0 ]]; then
	echo " Init nacos config finished, please start seata-server. "
else
	echo " init nacos config fail. "
fi

config.txt 需要修改

transport.type=TCP
transport.server=NIO
transport.heartbeat=true
transport.enableClientBatchSendRequest=false
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
service.vgroupMapping.my_test_tx_group=default
service.default.grouplist=127.0.0.1:8091
service.enableDegrade=false
service.disableGlobalTransaction=false
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=false
client.rm.sqlParserType=druid
client.rm.reportSuccessEnable=false
client.rm.sagaBranchRegisterEnable=false
client.tm.commitRetryCount=5
client.tm.rollbackRetryCount=5
client.tm.defaultGlobalTransactionTimeout=60000
client.tm.degradeCheck=false
client.tm.degradeCheckAllowTimes=10
client.tm.degradeCheckPeriod=2000
store.mode=db   這個地方   記得把我寫的文字給刪除
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
store.db.datasource=druid
store.db.dbType=mysql
store.db.driverClassName=com.mysql.cj.jdbc.Driver     MySQL8.0以上需要加上:.cj.   記得刪除我寫的
store.db.url=jdbc:mysql://127.0.0.1:3306/seata?useUnicode=true
store.db.user=root   這個地方需要修改   記得刪除文字  
store.db.password=root#123    這個地方   記得刪除文字
store.db.minConn=5
store.db.maxConn=30
store.db.globalTable=global_table
store.db.branchTable=branch_table
store.db.queryLimit=100
store.db.lockTable=lock_table
store.db.maxWait=5000
store.redis.host=127.0.0.1
store.redis.port=6379
store.redis.maxConn=10
store.redis.minConn=1
store.redis.database=0
store.redis.password=null
store.redis.queryLimit=100
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
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.log.exceptionRate=100
transport.serialization=seata
transport.compressor=none
metrics.enabled=false
metrics.registryType=compact
metrics.exporterList=prometheus
metrics.exporterPrometheusPort=9898

看我文件路徑:

在這里插入圖片描述

一定記得把config.txt 放在 seata目錄的上級目錄

在這里插入圖片描述

解決問題:

是因為沒有找到那config.txt文件(注意文件路徑。nacos-config.sh這個文件的上級目錄中即可)

雙擊:nacos-config.sh這個文件

或者在git執(zhí)行命令:

sh nacos-config.sh -h 192.168.0.104 -p 8848 -g SEATA_GROUP -t 9704bb45-3e8b-479d-b491-f0f77765e2df

再去查看nacos中的配置列表:

在這里插入圖片描述

啟動seata服務(wù)

修改兩個文件:

在這里插入圖片描述
file.conf
在這里插入圖片描述

registry.conf 注意兩個地方

在這里插入圖片描述

在這里插入圖片描述

啟動seata服務(wù):

在這里插入圖片描述

查看nacos屬于自己的匿名空間:
服務(wù)列表:

到此這篇關(guān)于在win10系統(tǒng)下,如何配置Spring Cloud alibaba Seata以及出現(xiàn)問題時怎么解決的文章就介紹到這了,更多相關(guān)配置Spring Cloud alibaba Seata內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • Java使用 try-with-resources 實現(xiàn)自動關(guān)閉資源的方法

    Java使用 try-with-resources 實現(xiàn)自動關(guān)閉資源的方法

    這篇文章主要介紹了Java使用 try-with-resources 實現(xiàn)自動關(guān)閉資源的方法,本文通過示例代碼給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下
    2020-06-06
  • Java格式化日期和時間三種方法

    Java格式化日期和時間三種方法

    這篇文章主要給大家介紹了關(guān)于Java格式化日期和時間三種方法的相關(guān)資料,最近遇到很多在Java里獲取當(dāng)前時間的問題,文中通過圖文以及實例代碼介紹的非常詳細(xì),需要的朋友可以參考下
    2023-07-07
  • 新手場景Java線程相關(guān)問題及解決方案

    新手場景Java線程相關(guān)問題及解決方案

    這篇文章主要介紹了新手場景Java線程相關(guān)問題及解決方案,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友可以參考下
    2020-07-07
  • java 線程池封裝及拒絕策略示例詳解

    java 線程池封裝及拒絕策略示例詳解

    這篇文章主要為大家介紹了java 線程池封裝及拒絕策略示例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2022-12-12
  • Java中循環(huán)冗余校驗(CRC32)的實現(xiàn)

    Java中循環(huán)冗余校驗(CRC32)的實現(xiàn)

    CRC校驗實用程序庫在數(shù)據(jù)存儲和數(shù)據(jù)通訊領(lǐng)域,為了保證數(shù)據(jù)的正確,就不得不采用檢錯的手段,下面這篇文章主要給大家介紹了關(guān)于Java中循環(huán)冗余校驗(CRC32)實現(xiàn)的相關(guān)資料,需要的朋友可以參考借鑒,下面來一起看看吧。
    2017-10-10
  • 非常適合新手學(xué)生的Java線程池超詳細(xì)分析

    非常適合新手學(xué)生的Java線程池超詳細(xì)分析

    作者是一個來自河源的大三在校生,以下筆記都是作者自學(xué)之路的一些淺薄經(jīng)驗,如有錯誤請指正,將來會不斷的完善筆記,幫助更多的Java愛好者入門
    2022-03-03
  • SpringCloud Hystrix熔斷器使用方法介紹

    SpringCloud Hystrix熔斷器使用方法介紹

    通過hystrix可以解決雪崩效應(yīng)問題,它提供了資源隔離、降級機(jī)制、融斷、緩存等功能。接下來通過本文給大家分享SpringCloud集成Hystrix熔斷,感興趣的朋友一起看看吧
    2023-03-03
  • SpringBoot之webflux全面解析

    SpringBoot之webflux全面解析

    這篇文章主要介紹了SpringBoot之webflux全面解析,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教
    2022-02-02
  • 淺析java雙向冒泡排序算法

    淺析java雙向冒泡排序算法

    這篇文章主要介紹了淺析java雙向冒泡排序算法,并附上源碼,需要的朋友可以參考下
    2015-02-02
  • 一篇文章帶你學(xué)習(xí)Mybatis-Plus(新手入門)

    一篇文章帶你學(xué)習(xí)Mybatis-Plus(新手入門)

    這篇文章主要介紹了MyBatis-Plus 快速入門案例(小白教程),文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2021-08-08

最新評論