国产亚洲精品福利在线无卡一,国产精久久一区二区三区,亚洲精品无码国模,精品久久久久久无码专区不卡

當(dāng)前位置: 首頁 > news >正文

男女主網(wǎng)站上做的popo白度指數(shù)

男女主網(wǎng)站上做的popo,白度指數(shù),南寧培訓(xùn)網(wǎng)站建設(shè),做網(wǎng)站找順的下載安裝包 鏈接: seata 配置seata-server 文件上傳Linux解壓 壓縮包我放在/usr/local/seata中 tar -zxvf seata-server-2.0.0.tar.gz修改配置文件 設(shè)置nacos為注冊和配置中心 進(jìn)入文件夾 cd /usr/local/seata/seata/conf修改application.yml文件 ...... ...... cons…

下載安裝包

鏈接: seata
在這里插入圖片描述

配置seata-server

文件上傳Linux解壓

壓縮包我放在/usr/local/seata中

tar -zxvf seata-server-2.0.0.tar.gz

修改配置文件

設(shè)置nacos為注冊和配置中心

  1. 進(jìn)入文件夾
cd /usr/local/seata/seata/conf
  1. 修改application.yml文件
......
......
console:user:username: seatapassword: seata
seata:config:# support: nacos, consul, apollo, zk, etcd3type: nacosnacos:server-addr: ip:8848group: 'DEFAULT_GROUP'namespace: '32e627d0-0b4xxxxxxx'dataId: "seataServer.properties"username: 'nacos'password: 'nacos'registry:# support: nacos, eureka, redis, zk, consul, etcd3, sofatype: nacospreferred-networks: xx.xx.*nacos:application: "seata-server"server-addr: ip:8848group: 'DEFAULT_GROUP'namespace: '32e627d0-0b4xxxxxxx'username: 'nacos'password: 'nacos'
......
......
  1. 將seata配置文件上傳到nacos

在nacos新建配置文件seataServer.properties
在這里插入圖片描述

官方供參考的配置文件: config.txt
以下為我修改后的配置文件

#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.default_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=db
store.session.mode=db
#Used for password encryption
# store.publicKey=#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://ip:3306/seata?useUnicode=true&rewriteBatchedStatements=true
store.db.user=root
store.db.password=root
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#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

創(chuàng)建seata數(shù)據(jù)庫及回滾表

  1. 在mysql新建了一個名為seata的數(shù)據(jù)庫

  2. 導(dǎo)入seata回滾所需的表,鏈接: 表結(jié)構(gòu)地址。根據(jù)自己的數(shù)據(jù)庫選擇。
    在這里插入圖片描述

  3. 在需要接入seata的相關(guān)微服務(wù)數(shù)據(jù)庫中,創(chuàng)建undo_log表。鏈接:表結(jié)構(gòu)地址,根據(jù)自己的數(shù)據(jù)庫選擇。(接入服務(wù)的數(shù)據(jù)庫不同,都要創(chuàng)建一次)

在這里插入圖片描述

設(shè)置seata自啟動

  1. 進(jìn)入文件夾
/etc/systemd/system
  1. 創(chuàng)建seata.service文件
#固定寫法,換一下路徑即可
#!/bin/sh
[Unit]
Description=seata-service
After=syslog.target network.target remote-fs.target nss-lookup.target
[Service]
Type=forking
Environment="JAVA_HOME=/usr/local/java/jdk1.8.0_311"
ExecStart=/usr/local/seata/seata/bin/seata-server.sh -p 8091 -h ip
PrivateTmp=true
[Install]
WantedBy=multi-user.target

【注意】:此處-h 后接當(dāng)前主機IP,如不接在nacos上注冊的,會顯示為172開頭的虛擬IP

  1. 設(shè)置開機自啟并刷新配置
systemctl enable seata
systemctl daemon-reload  # 刷新配置
  1. 啟動seata
systemctl start seata
systemctl status seata # 查看服務(wù)狀態(tài)
  1. 完成
    打開瀏覽器ip:7091,即可看到控制臺。賬號密碼為前面修改配置文件設(shè)置的密碼,即seata。
    在這里插入圖片描述
    在這里插入圖片描述

微服務(wù)接入seata

pom中引入seata依賴

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

yml配置文件設(shè)置

# seata配置
seata:enabled: trueapplication-id: ${spring.application.name}tx-service-group: default_tx_group# 關(guān)閉自動代理enable-auto-data-source-proxy: false# seata nacos注冊中心配置registry:type: nacosnacos:application: seata-serverserver-addr:  nacos的ip:8848group: DEFAULT_GROUPnamespace: 32e627d0-0b49-48de-b298-fb959134e1c5username: 'nacos'password: 'nacos'# seata nacos配置中心配置config:type: nacosnacos:server-addr:  nacos的IP:8848group: DEFAULT_GROUPnamespace: 32e627d0-0b49-48de-b298-fb959134e1c5data-id: seataServer.propertiesusername: 'nacos'password: 'nacos'

【注意】:這里需要非常注意的是tx-service-group的值,要和seataServer.properties里面的相同。

#Transaction routing rules configuration, only for the client
service.vgroupMapping.default_tx_group=default

使用

主接口增加注解 @GlobalTransactional,遠(yuǎn)程調(diào)用服務(wù)增加注解 @Transactional。項目接入多數(shù)據(jù)源,新建兩方法分別插入數(shù)據(jù)到不同庫,看回滾效果。
在這里插入圖片描述

TIPS:本項目使用的是mybatis-plus

http://aloenet.com.cn/news/38298.html

相關(guān)文章:

  • 硅云網(wǎng)站建設(shè)視頻專門做推廣的軟文
  • 哪個公司做企業(yè)網(wǎng)站好網(wǎng)站如何推廣營銷
  • 網(wǎng)站架構(gòu)的組成部分友情鏈接系統(tǒng)
  • 做網(wǎng)站做的自己做網(wǎng)站如何賺錢
  • 站長網(wǎng)站提交職業(yè)技能培訓(xùn)平臺
  • seo優(yōu)化方向浙江seo推廣
  • 網(wǎng)站直播是未開票收入怎么做信息流廣告推廣
  • 網(wǎng)上購物商城er圖楓林seo工具
  • php網(wǎng)站開發(fā)實戰(zhàn)教程谷歌瀏覽器下載手機版
  • 網(wǎng)站驗證錢的分錄怎么做百度競價開戶
  • 佛山抖音seo茶葉seo網(wǎng)站推廣與優(yōu)化方案
  • 企通互聯(lián)的網(wǎng)站建設(shè)失敗互聯(lián)網(wǎng)宣傳方式有哪些
  • Java電商網(wǎng)站開發(fā)資源專業(yè)營銷策劃團(tuán)隊
  • 營銷型企業(yè)網(wǎng)站模板重慶森林在線觀看
  • 網(wǎng)站建設(shè)項目評審意見搜狗收錄查詢
  • 做微商網(wǎng)站制作公司注冊
  • 免費下載建設(shè)銀行官方網(wǎng)站下載seo綜合查詢工具下載
  • 網(wǎng)站推銷話術(shù)seo搜索引擎招聘
  • 做黑枸杞的公司網(wǎng)站競價排名是什么
  • 適合學(xué)生做網(wǎng)頁練習(xí)的網(wǎng)站哪個杭州seo好
  • 自己的網(wǎng)站做一些誘惑新聞源發(fā)稿平臺
  • 做自己的第一個網(wǎng)站網(wǎng)站制作詳細(xì)流程
  • 如何做下載網(wǎng)站全渠道營銷案例
  • 衡陽網(wǎng)站建設(shè)公司設(shè)計公司企業(yè)網(wǎng)站
  • 寬帶套餐怎么辦理最劃算seo是什么意思為什么要做seo
  • 網(wǎng)站開發(fā)專業(yè)術(shù)語軟文營銷的五大注意事項
  • ps怎么做網(wǎng)站首頁和超鏈接國家大事新聞近三天
  • 網(wǎng)站關(guān)鍵詞可以添加嗎電商運營自學(xué)網(wǎng)站
  • 濰坊知名網(wǎng)站建設(shè)服務(wù)商娃哈哈軟文推廣
  • 怎么做自建站長沙疫情最新情況