接上篇
seata-server1.4.2 使用nacos和mysql8_zsj777的专栏-CSDN博客
微服务业务数据库创建表
CREATE TABLE `undo_log` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`branch_id` bigint(20) NOT NULL,
`xid` varchar(100) NOT NULL,
`context` varchar(128) NOT NULL,
`rollback_info` longblob NOT NULL,
`log_status` int(11) NOT NULL,
`log_created` datetime NOT NULL,
`log_modified` datetime NOT NULL,
`ext` varchar(100) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `ux_undo_log` (`xid`,`branch_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8
system微服务配置
bootstrap.yml 配置
# Spring
spring:
application:
# 应用名称
name: yh-platform-system
profiles:
# 环境配置
active: dev
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: ${spring.cloud.nacos.config.server-addr}
namespace: ${spring.cloud.nacos.config.namespace}
config:
# 配置中心地址
server-addr: 127.0.0.1:8848
namespace: ab503e1a-d307-4e7f-981b-82610d9fe818
# 配置文件格式
file-extension: yml
shared-configs[0]:
data-id: application-dev.yml
group: DEFAULT_GROUP
refresh: true
shared-configs[1]:
data-id: pojo-redis.yml
group: common
refresh: true
shared-configs[2]:
data-id: pojo-database.yml
group: common
refresh: true
shared-configs[3]:
data-id: seata-client.yml
group: DEFAULT_GROUP
refresh: true
pom文件
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-seata</artifactId>
<exclusions>
<!-- 排除依赖 指定版本和服务器端一致 -->
<exclusion>
<groupId>io.seata</groupId>
<artifactId>seata-all</artifactId>
</exclusion>
<exclusion>
<groupId>io.seata</groupId>
<artifactId>seata-spring-boot-starter</artifactId>