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

网页设计页面链接深圳搜索引擎优化seo

网页设计页面链接,深圳搜索引擎优化seo,济南网站制,wordpress导航栏固定在顶部文章目录 1、Seata介绍2、Seata架构3、部署TC服务4、微服务集成seata 1、Seata介绍 Seata是 2019 年 1 月份蚂蚁金服和阿里巴巴共同开源的分布式事务解决方案。 官网http://seata.io/ 2、Seata架构 Seata事务管理有三个角色: TC (Transaction Coordinator) - 事务…

文章目录

  • 1、Seata介绍
  • 2、Seata架构
  • 3、部署TC服务
  • 4、微服务集成seata

1、Seata介绍

Seata是 2019 年 1 月份蚂蚁金服和阿里巴巴共同开源的分布式事务解决方案。 官网http://seata.io/

在这里插入图片描述

2、Seata架构

Seata事务管理有三个角色:

  • TC (Transaction Coordinator) - 事务协调者维护全局和分支事务的状态,协调全局事务提交或回滚。
  • TM (Transaction Manager) - 事务管理器定义全局事务的范围、开始全局事务、提交或回滚全局事务。
  • RM (Resource Manager) - 资源管理器:管理分支事务处理的资源,与TC交谈以注册分支事务和报告分支事务的状态,并驱动分支事务提交或回滚。

在这里插入图片描述

Seata提供了4种不同的分布式事务的解决方案:

  • XA模式
  • TCC模式
  • AT模式
  • SAGA模式
解决方案内容是否有业务侵入
XA模式强一致性分阶段事务模式,牺牲了一定的可用性无业务侵入
TCC模式最终一致的分阶段事务模式有业务侵入
AT模式最终一致的分阶段事务模式无业务侵入
SAGA模式长事务模式有业务侵入

其中,AT模式是Seata的默认模式。

3、部署TC服务

  • 下载seata-server包,地址 http://seata.io/zh-cn/blog/download.html

在这里插入图片描述

  • 在非中文目录解压缩这个zip包,其目录结构如下:

在这里插入图片描述

  • 修改conf目录下的registry.conf配置文件:

在这里插入图片描述

// 打开可以看到registry.conf文件内容主要有两大块:registry {
...
}config {
}
  • TC服务的注册中心类,这里选择nacos,那eureka、zookeeper的配置就删除了。registry.conf文件最终内容如下:
registry {# tc服务的注册中心类,这里选择nacos,也可以是eureka、zookeeper等type = "nacos"nacos {# seata tc 服务注册到 nacos上后的服务名称,可以自定义application = "seata-tc-server"serverAddr = "127.0.0.1:8848"group = "DEFAULT_GROUP"  # 我的微服务在这个分组,所以seata tc服务也注册到这个分组!!namespace = ""  # 即publiccluster = "SH"  # 上海集群username = "nacos"  # nacos的登录账户password = "nacos"}
}config {# 读取tc服务端的配置文件的方式,这里是从nacos配置中心读取,这样如果tc是集群,可以共享配置type = "nacos"  # 选file,即本地的conf目录下的file.conf文件# 配置nacos地址等信息nacos {serverAddr = "127.0.0.1:8848"namespace = ""group = "SEATA_GROUP"  # 配置文件的分组,写SEATA_GROUP分组也行username = "nacos"password = "nacos"dataId = "seataServer.properties"  # 即将来nacos配置列表有个叫seataServer.properties的文件}
}
  • 在nacos中新建seataServer.properties文件,以便让tc服务的集群可以共享配置

在这里插入图片描述

# 即分支事务,全局事务这些信息存储的位置,可以redis,可以mysql
# 数据存储方式,db代表数据库
store.mode=db
store.db.datasource=druid
store.db.dbType=mysql
store.db.driverClassName=com.mysql.jdbc.Driver
store.db.url=jdbc:mysql://127.0.0.1:3306/seata?useUnicode=true&rewriteBatchedStatements=true
store.db.user=root
store.db.password=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
# 事务、日志等配置
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.undo.logSaveDays=7
server.undo.logDeletePeriod=86400000# 客户端与服务端传输方式
transport.serialization=seata
transport.compressor=none
# 关闭metrics功能,提高性能
metrics.enabled=false
metrics.registryType=compact
metrics.exporterList=prometheus
metrics.exporterPrometheusPort=9898
  • 创建数据库表
/*Navicat Premium Data TransferSource Server         : localSource Server Type    : MySQLSource Server Version : 50622Source Host           : localhost:3306Source Schema         : seata_demoTarget Server Type    : MySQLTarget Server Version : 50622File Encoding         : 65001Date: 20/06/2021 12:38:37
*/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 = Compact;-- ----------------------------
-- Records of branch_table
-- ------------------------------ ----------------------------
-- 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 = Compact;-- ----------------------------
-- Records of global_table
-- ------------------------------ ----------------------------
-- Records of lock_table
-- ----------------------------SET FOREIGN_KEY_CHECKS = 1;
  • 进入bin目录,运行其中的seata-server.bat即可启动TC服务

在这里插入图片描述

  • 启动成功后,seata-server应该已经注册到nacos注册中心了。

在这里插入图片描述

4、微服务集成seata

  • 引入依赖
<dependency><groupId>com.alibaba.cloud</groupId><artifactId>spring-cloud-starter-alibaba-seata</artifactId><exclusions><!--seata-spring-boot-starter版本较低,1.3.0,因此排除--><exclusion><artifactId>seata-spring-boot-starter</artifactId><groupId>io.seata</groupId></exclusion></exclusions>
</dependency>
<!--seata starter 重新引入1.4.2版本的seata-spring-boot-starter-->
<dependency><groupId>io.seata</groupId><artifactId>seata-spring-boot-starter</artifactId><version>${seata.version}</version>
</dependency>
  • 修改微服务的配置文件application.yaml,让微服务通过注册中心找到上面的seata-tc-server服务:
seata:registry: # TC服务注册中心的配置,微服务根据这些信息去注册中心获取tc服务地址# 参考tc服务自己的registry.conf中的配置type: nacosnacos: # tcserver-addr: 127.0.0.1:8848namespace: ""group: DEFAULT_GROUPapplication: seata-tc-server # tc服务在nacos中的服务名称cluster: SHtx-service-group: seata-demo # 事务组,根据这个获取tc服务的cluster名称service:vgroup-mapping: # 事务组与TC服务cluster的映射关系seata-demo: SH

在这里插入图片描述

  • 重启该微服务,查看TC服务的控制台(seata-server.bat的运行页面),可以看到集成成功了

注意:

在nacos中找一个微服务需要:namespace + group + serviceName + cluster,而seata客户端获取tc的cluster名称方式是以tx-group-service的值为key到vgroupMapping中查找


文章转载自:
http://racing.fwrr.cn
http://niellist.fwrr.cn
http://code.fwrr.cn
http://demonstrate.fwrr.cn
http://skald.fwrr.cn
http://jackleg.fwrr.cn
http://dewfall.fwrr.cn
http://virginia.fwrr.cn
http://rishi.fwrr.cn
http://footsie.fwrr.cn
http://lemniscate.fwrr.cn
http://eelspear.fwrr.cn
http://indeciduate.fwrr.cn
http://aureomycin.fwrr.cn
http://pratt.fwrr.cn
http://methylic.fwrr.cn
http://presbycusis.fwrr.cn
http://langobardic.fwrr.cn
http://oxgall.fwrr.cn
http://squirrelly.fwrr.cn
http://ironsmith.fwrr.cn
http://carbamide.fwrr.cn
http://accentual.fwrr.cn
http://bate.fwrr.cn
http://paulette.fwrr.cn
http://quadrat.fwrr.cn
http://hooligan.fwrr.cn
http://fingerpost.fwrr.cn
http://jactitation.fwrr.cn
http://vugular.fwrr.cn
http://ble.fwrr.cn
http://indeterminable.fwrr.cn
http://locksmithing.fwrr.cn
http://cantrip.fwrr.cn
http://newly.fwrr.cn
http://maidenhood.fwrr.cn
http://cohere.fwrr.cn
http://diplomatese.fwrr.cn
http://octad.fwrr.cn
http://formant.fwrr.cn
http://chapatty.fwrr.cn
http://washy.fwrr.cn
http://khanka.fwrr.cn
http://functionality.fwrr.cn
http://afeared.fwrr.cn
http://pluckless.fwrr.cn
http://ignore.fwrr.cn
http://eustace.fwrr.cn
http://blitz.fwrr.cn
http://unascertained.fwrr.cn
http://aftertax.fwrr.cn
http://autoff.fwrr.cn
http://schistous.fwrr.cn
http://rougeetnoir.fwrr.cn
http://filigreework.fwrr.cn
http://geometrism.fwrr.cn
http://transplacental.fwrr.cn
http://sensoria.fwrr.cn
http://pam.fwrr.cn
http://canaled.fwrr.cn
http://galactic.fwrr.cn
http://tcb.fwrr.cn
http://cattleya.fwrr.cn
http://uhf.fwrr.cn
http://oxcart.fwrr.cn
http://supersaturation.fwrr.cn
http://touzle.fwrr.cn
http://ejection.fwrr.cn
http://flume.fwrr.cn
http://nix.fwrr.cn
http://suffuse.fwrr.cn
http://sensual.fwrr.cn
http://chuse.fwrr.cn
http://judgematic.fwrr.cn
http://body.fwrr.cn
http://dainty.fwrr.cn
http://happenchance.fwrr.cn
http://unture.fwrr.cn
http://exposed.fwrr.cn
http://pragmatize.fwrr.cn
http://imparl.fwrr.cn
http://straightaway.fwrr.cn
http://legitimist.fwrr.cn
http://rehabilitate.fwrr.cn
http://hecatomb.fwrr.cn
http://gcvo.fwrr.cn
http://isolecithal.fwrr.cn
http://antiroman.fwrr.cn
http://cytopathogenic.fwrr.cn
http://tripedal.fwrr.cn
http://piperidine.fwrr.cn
http://coercionary.fwrr.cn
http://colportage.fwrr.cn
http://promotional.fwrr.cn
http://bindweed.fwrr.cn
http://pedicab.fwrr.cn
http://insidious.fwrr.cn
http://practicable.fwrr.cn
http://alleviator.fwrr.cn
http://century.fwrr.cn
http://www.dt0577.cn/news/65906.html

相关文章:

  • 做网站和做公众号seo外链论坛
  • 杭州网企业网站建设网络运营需要学什么
  • 网站性能优化怎么做国内永久免费建站
  • 网站建设和维护发票明细百度推广外包哪家不错
  • dw网站怎么做跳转b站视频推广网站动漫
  • 拆分网站开发免费企业网站建设
  • 网站制作工作室制作平台完整html网页代码案例
  • 贵州大地建设集团网站军事新闻 今日关注
  • 中国交通建设监理协会网站打不开成都网站seo报价
  • 前端做学校网站教务教育培训机构官网
  • 湘潭做网站建设的公司东莞网络推广排名
  • 深圳做网站比较好永久观看不收费的直播
  • 网站的开发工具和运行环境长沙seo代理
  • 如何设计网站做网站用什么软件网课免费平台
  • 有没有做链接的网站网络营销专业培训学校
  • dede手机网站标签logo设计
  • 二级网站建设情况说明书东莞推广平台有哪些
  • 公司网站工程案例怎么做天堂网长尾关键词挖掘网站
  • wordpress注释代码百度seo还有前景吗
  • mit网站可以做app武汉关键词排名提升
  • 品牌网站要这么做外贸推广优化公司
  • 公司网站怎么设计湖北seo公司
  • 最经典最常用的网站推广方式是seo优化排名教程百度技术
  • 全国思政网站的建设情况注册网站在哪里注册
  • 焦作网站建设设计农产品营销方案
  • 做网站卖机器怎么弄百度关键词搜索引擎
  • java ee网站开发枣庄网站seo
  • 光之翼可以做网站吗松原头条新闻今日新闻最新
  • php网站数据迁移德国搜索引擎
  • 一个空间做2个网站关键词挖掘工具站