当前位置: 首页 > news >正文

seata 1.5.2 升级到2.1.0版本

一、部署1.5.2

 1、解压缩  tar  -xvf     apache-seata-***-incubating-bin.tar.gz
  2、修改conf下的application.yml   只需要修改seata下的此配置,然后再nacos中添加其它配置,下面是application.yml的配置:
server:port: 7091spring:application:name: seata-serverlogging:config: classpath:logback-spring.xmlfile:path: /usr/local/seata/logsconsole:user:username: seatapassword: *******seata:config:# support: nacos 、 consul 、 apollo 、 zk  、 etcd3type: nacosnacos:# nacos ip地址server-addr: 127.0.0.1:8848group: SEATA_GROUPnamespace: mesusername: nacospassword: *******##if use MSE Nacos with auth, mutex with username/password attribute#access-key: ""#secret-key: ""# 读取nacos上的配置文件data-id: seataServer.ymlregistry:# support: nacos 、 eureka 、 redis 、 zk  、 consul 、 etcd3 、 sofatype: nacosnacos:application: seata-server# nacos ip地址server-addr: 127.0.0.1:8848group: SEATA_GROUPnamespace: mescluster: defaultusername: nacospassword: ********##if use MSE Nacos with auth, mutex with username/password attribute#access-key: ""#secret-key: ""
#  store:   //可以在此配置也可以在nacos的seata配置文件yml中配置# support: file 、 db 、 redis
#    mode: file
#  server:
#    service-port: 8091 #If not configured, the default is '${server.port} + 1000'security:secretKey: SeataSecretKey0c382ef121d778043159209298fd40bf3850a017tokenValidityInMilliseconds: 1800000ignore:urls: /,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-fe/public/**,/api/v1/auth/login
3、在nacos配置seata的服务端配置
  •  建立一个SEATA_GROUP的分组,专门放置seata客户端和服务端的配置 

  •  建seataServer.yml配置,如图示:
  • 具体服务端配置如下:
    service:vgroupMapping:system-group: defaultjob-group: defaultjimureport-group: defaultauth-group: defaultmonitor-group: defaultgen-group: defaultgateway-group: defaultfile-group: defaultmes-baseinfo-group: defaultmes-technology-group: defaultmes-planning-group: defaultmes-warehouse-group: defaultmes-produce-group: defaultmes-integrate-group: default
    store:db:datasource: druiddbType: mysqldriverClassName: com.mysql.cj.jdbc.Driverurl: jdbc:mysql://*****:3306/seata?useUnicode=trueuser: rootpassword: *******globalTable: global_tablelockTable: lock_tablebranchTable: branch_tablemaxConn: 30maxWait: 5000minConn: 5queryLimit: 100mode: dbsession: mode: dblock:mode: db

    其中store下的配置也可以直接放到seata的conf下的application.yml中,其实conf下的application.yml+nacos下的seataServer.yml总体构成了总的配置文件。

4、在nacos配置seata的客户端配置 

     所有的微服务加seata配置

  • 在SEATA_GROUP组中加配置

  • 在 微服务配置中加seata配置
    # seata配置
    seata:# 默认关闭,如需启用spring.datasource.dynami.seata需要同时开启enabled: true# Seata 应用编号,默认为 ${spring.application.name}application-id: ${spring.application.name}# Seata 事务组编号,用于 TC 集群名tx-service-group: ${spring.application.name}-group# 关闭自动代理enable-auto-data-source-proxy: false# 服务配置项service:# 虚拟组和分组的映射vgroup-mapping:mes-baseinfo-group: defaultconfig:type: nacosnacos:server-addr: ****:8848group: SEATA_GROUPnamespace: et-mesusername: nacospassword: *****registry:type: nacosnacos:application: seata-serverserver-addr: ****:8848namespace: et-mesgroup: SEATA_GROUPusername: nacospassword: ****cluster: default
    5、启动seata   
  • 在bin下执行sh seata-server.sh  启动命令,成功后可以在nacos的注册中心看到seata服务

 二、升级seata1.5.2到2.1.0

1、经过比对,数据库脚本没变

2、把1.5.2的application.yml拷过来覆盖默认配置

3、关键到了,2.1.0中lib下jdbc文件夹下没有jar,需要我们从其它地方复制一个jdbc的jar过来,才能启动成功。

 4、启动,完美成功。

相关文章:

  • 力扣HOT100之链表:146. LRU 缓存
  • Inference-Time Scaling for Generalist Reward Modeling
  • (四)Java逻辑运算符和位运算符全面解析
  • 通配符 DNS 记录:应用场景与相关风险
  • SEO关键词与长尾词精准布局策略
  • 【Bootstrap V4系列】学习入门教程之 组件-折叠(Collapse)
  • mysql修改root密码
  • C++20新特新——02特性的补充
  • 性能比拼: Redis Streams vs Pub/Sub
  • 解决使用lettuce连接Redis超时的问题(tcpUserTimeout 参数失效问题)
  • YOLOv1:开创实时目标检测新纪元
  • Wireshark抓账号密码
  • 普通笔记本与军用加固笔记本电脑的区别,探索防水、防爆、防摔的真·移动工作站!
  • 在线PDF阅读方案:jQuery + PDF.js
  • 内网和外网怎么互通?外网访问内网的几种简单方式
  • 解决HomeAssistant 无法安装 samba share问题
  • 【数据库原理及安全实验】实验六 角色访问控制
  • 《C++ Templates》:有关const、引用、指针的一些函数模板实参推导的例子
  • C#——NET Core 中实现汉字转拼音
  • Redis 8.0 正式版发布,新特性很强!
  • 中山大学人类学系原系主任冯家骏逝世,享年95岁
  • 体验中国传统文化、采购非遗文创,波兰游客走进上海市群艺馆
  • 上海劳模风采馆焕新升级后重新开放,展示480位劳模先进故事
  • 总粉丝破亿!当网络大V遇见硬核科技,互联网时代如何书写上海故事?
  • 夜读丨喜马拉雅山的背夫
  • 遇冰雹天气,西安机场新航站楼成“水帘洞”