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

公司门户网站怎么做织梦网站首页错位

公司门户网站怎么做,织梦网站首页错位,用phpcms建网站流程,网络营销推广方法总结正文 1、解决的应用场景是分布式事务#xff0c;每个服务有独立的数据库。 2、例如#xff1a;A服务的数据库是A1#xff0c;B服务的数据库是B2#xff0c;A服务通过feign接口调用B服务#xff0c;B涉及提交数据到B2#xff0c;业务是在B提交数据之后#xff0c;在A服…正文 1、解决的应用场景是分布式事务每个服务有独立的数据库。 2、例如A服务的数据库是A1B服务的数据库是B2A服务通过feign接口调用B服务B涉及提交数据到B2业务是在B提交数据之后在A服务内报错。 所以希望B能回滚事务。这就是跨库的数据回滚 下载 seata下载地址 seata的配置 1、创建一个数据库把seata的表生成出来 2、修改seata配置文件 注意有其他的需求可以参考example文件我这里直接展示本地修改后的 # 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.server:port: 7091spring:application:name: seata-serverlogging:config: classpath:logback-spring.xmlfile:path: ${user.home}/logs/seata#extend:#logstash-appender:# destination: 127.0.0.1:4560#kafka-appender:# bootstrap-servers: 127.0.0.1:9092# topic: logback_to_logstashconsole:user:username: seatapassword: seata seata:#data-source-proxy-mode: XA#tx-service-group: default#service:#vgroup-mapping: # 事务组与cluster的映射关系# default_tx_group: DEFAULT#grouplist:# DEFAULT: 127.0.0.1:8091config:# support: nacos, consul, apollo, zk, etcd3type: nacosnacos:application: seata-serverserver-addr: 127.0.0.1:8848group : WEIMEIZI_GROUPnamespace: username: nacospassword: nacos#data-id: seataServer.propertiesregistry:# support: nacos, eureka, redis, zk, consul, etcd3, sofatype: nacosnacos:application: seata-serverserver-addr: 127.0.0.1:8848group: WEIMEIZI_GROUPnamespace:cluster: defaultusername: nacospassword: nacosstore:# support: file 、 db 、 redismode: db# 数据源驱动类名称db:datasource: druiddb-type: mysqldriver-class-name: com.mysql.jdbc.Driverurl: jdbc:mysql://127.0.0.1:3306/seata?rewriteBatchedStatementstrueuser: rootpassword: rootmin-conn: 10max-conn: 100global-table: global_tablebranch-table: branch_tablelock-table: lock_tabledistributed-lock-table: distributed_lockquery-limit: 1000max-wait: 5000 # server: # service-port: 8091 #If not configured, the default is ${server.port} 1000security:secretKey: SeataSecretKey0c382ef121d778043159209298fd40bf3850a017tokenValidityInMilliseconds: 1800000ignore:urls: /,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.jpeg,/**/*.ico,/api/v1/auth/login3、修改nacos配置文件 新增 seata:data-source-proxy-mode: XAtx-service-group: defaultservice.vgroupMapping.default: defaultservice.default.grouplist: 127.0.0.1:8091注意如果你用的是其他版本的seata可能service.vgroupMapping.default和 service.default.grouplist在其他版本命名不一样报错就修改 4、涉及到分布式事务的数据库都要创建undo_log表 这张表在seata官方包里是没有的如果不创建代码会报错找不到表 SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS 0;-- ---------------------------- -- Table structure for undo_log -- ---------------------------- DROP TABLE IF EXISTS undo_log; CREATE TABLE undo_log (branch_id bigint(20) NOT NULL COMMENT 分支事务ID,xid varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 全局事务ID,context varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 上下文,rollback_info longblob NOT NULL COMMENT 回滚信息,log_status int(11) NOT NULL COMMENT 状态0正常1全局已完成,log_created datetime(6) NOT NULL COMMENT 创建时间,log_modified datetime(6) NOT NULL COMMENT 修改时间,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 Compact;SET FOREIGN_KEY_CHECKS 1; 服务注册 满足1、2、3步后启动 就会发现nacos注册上了seata 项目的代码 主要是两个注解 EnableAutoDataSourceProxy GlobalTransactional(rollbackFor Exception.class) A服务的方法 B服务的方法 B服务的方法正常执行并提交数据到B库但是A服务报错了所以B服务得回滚数据 A、B的Application都要加上EnableAutoDataSourceProxy 注意引入的pom文件 两个服务的pom都要引入seata注意有个包叫做seata-all这个包不要一起引入进去否则会报数据源错误 !-- Seata--dependencygroupIdcom.alibaba.cloud/groupIdartifactIdspring-cloud-starter-alibaba-seata/artifactIdversion2.0.4/version/dependencydependencygroupIdio.seata/groupIdartifactIdseata-spring-boot-starter/artifactIdversion1.7.0/version/dependency结语 事务回滚成功是根据XID以下是成功回滚的截图 A服务的控制台输出 B服务的控制台输出 备注 如果因为nacos的配置文件过大导致netty报错那么就修改netty的内存文件是application.yml #服务器端口 server:port: 8200netty:max-chunk-size: 1545270062max-initial-line-length: 1545270062h2c-max-content-length: 1545270062
http://www.w-s-a.com/news/688468/

相关文章:

  • 河南海华工程建设监理公司网站高端论坛网站建设
  • 网站建设网络推广方案图片编辑器免费
  • 如何用dw做网站设计设计头条
  • 网站建设基础及流程北京商场购物中心排名
  • 青州市城乡建设局网站自建网站步骤
  • wordpress文章延迟加载优化设计答案四年级上册语文
  • 做网站源码要给客户嘛怎么在运行打开wordpress
  • 北海住房和城乡建设局网站wordpress标题去掉私密
  • 织梦网站安装视频做网站都有那些步骤
  • 网站空间大小选择沈阳微信网站制作
  • 网站分享对联广告网站结构的类型
  • 三维家是在网站上做还是在app上北京网站建设 专业10年
  • 模拟网站建设网站建设认准猪八戒网
  • godaddy网站建设教程微信手机网站搭建
  • 网站建设 商城淄博网站制作哪家好
  • 廊坊手机网站团队国际贸易进口代理公司
  • 运用django做网站网站建设问题及解决办法
  • 商丘企业网站服务c mvc 网站开发
  • 太仓建设工程网站广州seo排名外包
  • 成都的教育品牌网站建设做网站不给提供ftp
  • 建站行业市场人力管理系统
  • qq钓鱼网站在线生成器google关键词搜索工具
  • 化妆网站模板移动网站建设模板
  • 欢迎访问语文建设杂志网站网站蓝色配色
  • 最新网站发布重庆城乡建设部网站首页
  • 网站建设费用高鄂尔多斯seo
  • dw做网站怎么发布网站无后台可以上框架
  • 网络公司如何建网站网站的建设需要多少钱
  • 代刷网站推广快速泉州网页定制
  • 网站优秀网站地址做宣传册的公司