add 整合 seata 1.4.2 对接 nacos 注册中心 配置中心
parent
d491e8d2fb
commit
0c2efd36cf
|
|
@ -210,20 +210,17 @@ seata:
|
||||||
application-id: ${spring.application.name}
|
application-id: ${spring.application.name}
|
||||||
# Seata 事务组编号,用于 TC 集群名
|
# Seata 事务组编号,用于 TC 集群名
|
||||||
tx-service-group: ${spring.application.name}-group
|
tx-service-group: ${spring.application.name}-group
|
||||||
# 服务配置项
|
|
||||||
service:
|
|
||||||
# 虚拟组和分组的映射
|
|
||||||
vgroup-mapping:
|
|
||||||
${spring.application.name}: default
|
|
||||||
config:
|
config:
|
||||||
type: nacos
|
type: nacos
|
||||||
nacos:
|
nacos:
|
||||||
serverAddr: ${spring.cloud.nacos.server-addr}
|
server-addr: ${spring.cloud.nacos.server-addr}
|
||||||
group: SEATA_GROUP
|
group: ${spring.cloud.nacos.config.group}
|
||||||
namespace:
|
namespace: ${spring.profiles.active}
|
||||||
|
data-id: seata-server.properties
|
||||||
registry:
|
registry:
|
||||||
type: nacos
|
type: nacos
|
||||||
nacos:
|
nacos:
|
||||||
application: seata-server
|
application: seata-server
|
||||||
server-addr: ${spring.cloud.nacos.server-addr}
|
server-addr: ${spring.cloud.nacos.server-addr}
|
||||||
namespace:
|
group: ${spring.cloud.nacos.discovery.group}
|
||||||
|
namespace: ${spring.profiles.active}
|
||||||
|
|
|
||||||
|
|
@ -17,12 +17,11 @@ spring:
|
||||||
username: ${datasource.system-master.username}
|
username: ${datasource.system-master.username}
|
||||||
password: ${datasource.system-master.password}
|
password: ${datasource.system-master.password}
|
||||||
# 从库数据源
|
# 从库数据源
|
||||||
slave:
|
# slave:
|
||||||
lazy: true
|
# driver-class-name:
|
||||||
driver-class-name:
|
# url:
|
||||||
url:
|
# username:
|
||||||
username:
|
# password:
|
||||||
password:
|
|
||||||
|
|
||||||
xxl:
|
xxl:
|
||||||
job:
|
job:
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,47 @@
|
||||||
|
service.vgroupMapping.ruoyi-auth-group=default
|
||||||
|
service.vgroupMapping.ruoyi-system-group=default
|
||||||
|
service.vgroupMapping.ruoyi-file-group=default
|
||||||
|
service.enableDegrade=false
|
||||||
|
service.disableGlobalTransaction=false
|
||||||
|
store.mode=db
|
||||||
|
store.publicKey=
|
||||||
|
store.db.datasource=druid
|
||||||
|
store.db.dbType=mysql
|
||||||
|
store.db.driverClassName=com.mysql.cj.jdbc.Driver
|
||||||
|
store.db.url=jdbc:mysql://172.30.0.36:3306/ry-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
|
||||||
|
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
|
||||||
|
client.undo.dataValidation=true
|
||||||
|
client.undo.logSerialization=kryo
|
||||||
|
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
|
||||||
|
log.exceptionRate=100
|
||||||
|
transport.serialization=seata
|
||||||
|
transport.compressor=none
|
||||||
|
metrics.enabled=false
|
||||||
|
metrics.registryType=compact
|
||||||
|
metrics.exporterList=prometheus
|
||||||
|
metrics.exporterPrometheusPort=9898
|
||||||
|
tcc.fence.logTableName=tcc_fence_log
|
||||||
|
tcc.fence.cleanPeriod=1h
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
registry {
|
||||||
|
# file 、nacos 、eureka、redis、zk、consul、etcd3、sofa
|
||||||
|
type = "nacos"
|
||||||
|
|
||||||
|
nacos {
|
||||||
|
application = "seata-server"
|
||||||
|
serverAddr = "172.30.0.40:8848"
|
||||||
|
group = "DEFAULT_GROUP"
|
||||||
|
namespace = "dev"
|
||||||
|
cluster = "default"
|
||||||
|
username = ""
|
||||||
|
password = ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
config {
|
||||||
|
# file、nacos 、apollo、zk、consul、etcd3
|
||||||
|
type = "nacos"
|
||||||
|
|
||||||
|
nacos {
|
||||||
|
serverAddr = "172.30.0.40:8848"
|
||||||
|
group = "DEFAULT_GROUP"
|
||||||
|
namespace = "dev"
|
||||||
|
username = ""
|
||||||
|
password = ""
|
||||||
|
dataId = "seata-server.properties"
|
||||||
|
}
|
||||||
|
}
|
||||||
7
pom.xml
7
pom.xml
|
|
@ -40,6 +40,7 @@
|
||||||
<redisson.version>3.16.7</redisson.version>
|
<redisson.version>3.16.7</redisson.version>
|
||||||
<lock4j.version>2.2.1</lock4j.version>
|
<lock4j.version>2.2.1</lock4j.version>
|
||||||
<dubbo.version>2.7.15</dubbo.version>
|
<dubbo.version>2.7.15</dubbo.version>
|
||||||
|
<seata.version>1.4.2</seata.version>
|
||||||
<spring.context.support.version>1.0.11</spring.context.support.version>
|
<spring.context.support.version>1.0.11</spring.context.support.version>
|
||||||
<xxl-job.version>2.3.0</xxl-job.version>
|
<xxl-job.version>2.3.0</xxl-job.version>
|
||||||
<knife4j-aggregation.version>2.0.9</knife4j-aggregation.version>
|
<knife4j-aggregation.version>2.0.9</knife4j-aggregation.version>
|
||||||
|
|
@ -120,6 +121,12 @@
|
||||||
<version>${dubbo.version}</version>
|
<version>${dubbo.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.seata</groupId>
|
||||||
|
<artifactId>seata-spring-boot-starter</artifactId>
|
||||||
|
<version>${seata.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba.spring</groupId>
|
<groupId>com.alibaba.spring</groupId>
|
||||||
<artifactId>spring-context-support</artifactId>
|
<artifactId>spring-context-support</artifactId>
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,11 @@
|
||||||
<artifactId>ruoyi-common-dubbo</artifactId>
|
<artifactId>ruoyi-common-dubbo</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<artifactId>ruoyi-common-seata</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- 自定义负载均衡(多团队开发使用) -->
|
<!-- 自定义负载均衡(多团队开发使用) -->
|
||||||
<!-- <dependency>-->
|
<!-- <dependency>-->
|
||||||
<!-- <groupId>com.ruoyi</groupId>-->
|
<!-- <groupId>com.ruoyi</groupId>-->
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@
|
||||||
<module>ruoyi-common-web</module>
|
<module>ruoyi-common-web</module>
|
||||||
<module>ruoyi-common-job</module>
|
<module>ruoyi-common-job</module>
|
||||||
<module>ruoyi-common-dubbo</module>
|
<module>ruoyi-common-dubbo</module>
|
||||||
|
<module>ruoyi-common-seata</module>
|
||||||
<module>ruoyi-common-loadbalancer</module>
|
<module>ruoyi-common-loadbalancer</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -89,6 +89,13 @@
|
||||||
<artifactId>ruoyi-common-dubbo</artifactId>
|
<artifactId>ruoyi-common-dubbo</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<artifactId>ruoyi-common-seata</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-common-loadbalancer</artifactId>
|
<artifactId>ruoyi-common-loadbalancer</artifactId>
|
||||||
|
|
|
||||||
|
|
@ -31,11 +31,5 @@
|
||||||
<version>${dynamic-ds.version}</version>
|
<version>${dynamic-ds.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- SpringBoot Seata -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.alibaba.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-starter-alibaba-seata</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
package com.ruoyi.common.datasource.env;
|
|
||||||
|
|
||||||
import org.springframework.boot.SpringApplication;
|
|
||||||
import org.springframework.boot.env.EnvironmentPostProcessor;
|
|
||||||
import org.springframework.core.Ordered;
|
|
||||||
import org.springframework.core.env.ConfigurableEnvironment;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* seata 在 springboot 2.6.x 存在循环引用问题的处理
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
public class ApplicationSeataInitializer implements EnvironmentPostProcessor, Ordered
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application)
|
|
||||||
{
|
|
||||||
System.setProperty("spring.main.allow-circular-references", "true");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getOrder()
|
|
||||||
{
|
|
||||||
return Ordered.LOWEST_PRECEDENCE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +1 @@
|
||||||
org.springframework.boot.env.EnvironmentPostProcessor=\
|
org.springframework.boot.env.EnvironmentPostProcessor=
|
||||||
com.ruoyi.common.datasource.env.ApplicationSeataInitializer
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<parent>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<artifactId>ruoyi-common</artifactId>
|
||||||
|
<version>0.3.0</version>
|
||||||
|
</parent>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<artifactId>ruoyi-common-seata</artifactId>
|
||||||
|
|
||||||
|
<description>
|
||||||
|
ruoyi-common-seata 分布式事务
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
|
||||||
|
<!-- SpringBoot Seata -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-seata</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 用于修复 seata 序列化问题 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.esotericsoftware</groupId>
|
||||||
|
<artifactId>kryo</artifactId>
|
||||||
|
<version>4.0.2</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>de.javakaffee</groupId>
|
||||||
|
<artifactId>kryo-serializers</artifactId>
|
||||||
|
<version>0.45</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
org.springframework.boot.autoconfigure.EnableAutoConfiguration=
|
||||||
|
|
@ -70,6 +70,11 @@
|
||||||
<artifactId>ruoyi-common-dubbo</artifactId>
|
<artifactId>ruoyi-common-dubbo</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<artifactId>ruoyi-common-seata</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-common-web</artifactId>
|
<artifactId>ruoyi-common-web</artifactId>
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,8 @@ import com.ruoyi.common.core.utils.file.FileUtils;
|
||||||
import com.ruoyi.file.api.domain.SysFile;
|
import com.ruoyi.file.api.domain.SysFile;
|
||||||
import com.ruoyi.file.service.ISysFileService;
|
import com.ruoyi.file.service.ISysFileService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import org.slf4j.Logger;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.slf4j.LoggerFactory;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
@ -18,12 +17,12 @@ import org.springframework.web.multipart.MultipartFile;
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@Api(tags = "文件处理")
|
@Api(tags = "文件处理")
|
||||||
|
@Slf4j
|
||||||
|
@RequiredArgsConstructor
|
||||||
@RestController
|
@RestController
|
||||||
public class SysFileController {
|
public class SysFileController {
|
||||||
private static final Logger log = LoggerFactory.getLogger(SysFileController.class);
|
|
||||||
|
|
||||||
@Autowired
|
private final ISysFileService sysFileService;
|
||||||
private ISysFileService sysFileService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文件上传请求
|
* 文件上传请求
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,9 @@ public class RemoteFileServiceImpl implements RemoteFileService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public SysFile upload(String name, String originalFilename, String contentType, byte[] file) {
|
public SysFile upload(String name, String originalFilename, String contentType, byte[] file) {
|
||||||
|
// todo 临时用于测试 seata
|
||||||
|
// throw new ServiceException("上传文件失败");
|
||||||
|
|
||||||
MultipartFile multipartFile = getMultipartFile(name, originalFilename, contentType, file);
|
MultipartFile multipartFile = getMultipartFile(name, originalFilename, contentType, file);
|
||||||
try {
|
try {
|
||||||
// 上传并返回访问地址
|
// 上传并返回访问地址
|
||||||
|
|
|
||||||
|
|
@ -15,5 +15,5 @@ public interface ISysFileService {
|
||||||
* @return 访问地址
|
* @return 访问地址
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public String uploadFile(MultipartFile file) throws Exception;
|
String uploadFile(MultipartFile file) throws Exception;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -86,6 +86,11 @@
|
||||||
<artifactId>ruoyi-common-dubbo</artifactId>
|
<artifactId>ruoyi-common-dubbo</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<artifactId>ruoyi-common-seata</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-common-job</artifactId>
|
<artifactId>ruoyi-common-job</artifactId>
|
||||||
|
|
|
||||||
|
|
@ -108,9 +108,13 @@ public class SysProfileController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 头像上传
|
* 头像上传
|
||||||
*/
|
*/
|
||||||
|
// @GlobalTransactional(rollbackFor = Exception.class)
|
||||||
@Log(title = "用户头像", businessType = BusinessType.UPDATE)
|
@Log(title = "用户头像", businessType = BusinessType.UPDATE)
|
||||||
@PostMapping("/avatar")
|
@PostMapping("/avatar")
|
||||||
public AjaxResult avatar(@RequestParam("avatarfile") MultipartFile file) throws IOException {
|
public AjaxResult avatar(@RequestParam("avatarfile") MultipartFile file) throws IOException {
|
||||||
|
// todo 临时用于测试 seata
|
||||||
|
// userService.insertUser(new SysUser().setUserName("test").setNickName("test"));
|
||||||
|
|
||||||
if (!file.isEmpty()) {
|
if (!file.isEmpty()) {
|
||||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||||
SysFile sysFile = remoteFileService.upload(file.getName(), file.getOriginalFilename(), file.getContentType(), file.getBytes());
|
SysFile sysFile = remoteFileService.upload(file.getName(), file.getOriginalFilename(), file.getContentType(), file.getBytes());
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,8 @@ insert into config_info(id, data_id, group_id, content, md5, gmt_create, gmt_mod
|
||||||
(9, 'ruoyi-file.yml', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:20:35', '2022-01-09 15:21:21', NULL, '0:0:0:0:0:0:0:1', '', 'dev', '文件服务', NULL, NULL, 'yaml', NULL),
|
(9, 'ruoyi-file.yml', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:20:35', '2022-01-09 15:21:21', NULL, '0:0:0:0:0:0:0:1', '', 'dev', '文件服务', NULL, NULL, 'yaml', NULL),
|
||||||
(10, 'sentinel-ruoyi-gateway.json', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:21:02', '2022-01-09 15:21:02', NULL, '0:0:0:0:0:0:0:1', '', 'dev', '限流策略', NULL, NULL, 'json', NULL),
|
(10, 'sentinel-ruoyi-gateway.json', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:21:02', '2022-01-09 15:21:02', NULL, '0:0:0:0:0:0:0:1', '', 'dev', '限流策略', NULL, NULL, 'json', NULL),
|
||||||
(11, 'ruoyi-xxl-job-admin.yml', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:21:02', '2022-01-09 15:21:02', NULL, '0:0:0:0:0:0:0:1', '', 'dev', '定时任务控制台', NULL, NULL, 'yaml', NULL),
|
(11, 'ruoyi-xxl-job-admin.yml', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:21:02', '2022-01-09 15:21:02', NULL, '0:0:0:0:0:0:0:1', '', 'dev', '定时任务控制台', NULL, NULL, 'yaml', NULL),
|
||||||
|
(12, 'seata-server.properties', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:21:02', '2022-01-09 15:21:02', NULL, '0:0:0:0:0:0:0:1', '', 'dev', 'seata配置文件', NULL, NULL, 'properties', NULL),
|
||||||
|
|
||||||
(101, 'application.yml', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:23:00', '2022-01-09 15:23:00', NULL, '0:0:0:0:0:0:0:1', '', 'prod', '通用配置基础配置', NULL, NULL, 'yaml', NULL),
|
(101, 'application.yml', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:23:00', '2022-01-09 15:23:00', NULL, '0:0:0:0:0:0:0:1', '', 'prod', '通用配置基础配置', NULL, NULL, 'yaml', NULL),
|
||||||
(102, 'datasource.yml', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:23:00', '2022-01-09 15:23:00', NULL, '0:0:0:0:0:0:0:1', '', 'prod', '数据源配置', NULL, NULL, 'yaml', NULL),
|
(102, 'datasource.yml', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:23:00', '2022-01-09 15:23:00', NULL, '0:0:0:0:0:0:0:1', '', 'prod', '数据源配置', NULL, NULL, 'yaml', NULL),
|
||||||
(103, 'ruoyi-gateway.yml', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:23:00', '2022-01-09 15:23:00', NULL, '0:0:0:0:0:0:0:1', '', 'prod', '网关模块', NULL, NULL, 'yaml', NULL),
|
(103, 'ruoyi-gateway.yml', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:23:00', '2022-01-09 15:23:00', NULL, '0:0:0:0:0:0:0:1', '', 'prod', '网关模块', NULL, NULL, 'yaml', NULL),
|
||||||
|
|
@ -53,7 +55,8 @@ insert into config_info(id, data_id, group_id, content, md5, gmt_create, gmt_mod
|
||||||
(108, 'ruoyi-job.yml', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:23:00', '2022-01-09 15:23:00', NULL, '0:0:0:0:0:0:0:1', '', 'prod', '定时任务', NULL, NULL, 'yaml', NULL),
|
(108, 'ruoyi-job.yml', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:23:00', '2022-01-09 15:23:00', NULL, '0:0:0:0:0:0:0:1', '', 'prod', '定时任务', NULL, NULL, 'yaml', NULL),
|
||||||
(109, 'ruoyi-file.yml', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:23:00', '2022-01-09 15:23:00', NULL, '0:0:0:0:0:0:0:1', '', 'prod', '文件服务', NULL, NULL, 'yaml', NULL),
|
(109, 'ruoyi-file.yml', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:23:00', '2022-01-09 15:23:00', NULL, '0:0:0:0:0:0:0:1', '', 'prod', '文件服务', NULL, NULL, 'yaml', NULL),
|
||||||
(110, 'sentinel-ruoyi-gateway.json', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:23:00', '2022-01-09 15:23:00', NULL, '0:0:0:0:0:0:0:1', '', 'prod', '限流策略', NULL, NULL, 'json', NULL),
|
(110, 'sentinel-ruoyi-gateway.json', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:23:00', '2022-01-09 15:23:00', NULL, '0:0:0:0:0:0:0:1', '', 'prod', '限流策略', NULL, NULL, 'json', NULL),
|
||||||
(111, 'ruoyi-xxl-job-admin.yml', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:21:02', '2022-01-09 15:21:02', NULL, '0:0:0:0:0:0:0:1', '', 'prod', '定时任务控制台', NULL, NULL, 'yaml', NULL);
|
(111, 'ruoyi-xxl-job-admin.yml', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:21:02', '2022-01-09 15:21:02', NULL, '0:0:0:0:0:0:0:1', '', 'prod', '定时任务控制台', NULL, NULL, 'yaml', NULL),
|
||||||
|
(112, 'seata-server.properties', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:21:02', '2022-01-09 15:21:02', NULL, '0:0:0:0:0:0:0:1', '', 'prod', 'seata配置文件', NULL, NULL, 'properties', NULL);
|
||||||
|
|
||||||
/******************************************/
|
/******************************************/
|
||||||
/* 表名称 = config_info_aggr */
|
/* 表名称 = config_info_aggr */
|
||||||
|
|
|
||||||
|
|
@ -51,15 +51,31 @@ CREATE TABLE IF NOT EXISTS `branch_table`
|
||||||
CREATE TABLE IF NOT EXISTS `lock_table`
|
CREATE TABLE IF NOT EXISTS `lock_table`
|
||||||
(
|
(
|
||||||
`row_key` VARCHAR(128) NOT NULL,
|
`row_key` VARCHAR(128) NOT NULL,
|
||||||
`xid` VARCHAR(96),
|
`xid` VARCHAR(128),
|
||||||
`transaction_id` BIGINT,
|
`transaction_id` BIGINT,
|
||||||
`branch_id` BIGINT NOT NULL,
|
`branch_id` BIGINT NOT NULL,
|
||||||
`resource_id` VARCHAR(256),
|
`resource_id` VARCHAR(256),
|
||||||
`table_name` VARCHAR(32),
|
`table_name` VARCHAR(32),
|
||||||
`pk` VARCHAR(36),
|
`pk` VARCHAR(36),
|
||||||
|
`status` TINYINT NOT NULL DEFAULT '0' COMMENT '0:locked ,1:rollbacking',
|
||||||
`gmt_create` DATETIME,
|
`gmt_create` DATETIME,
|
||||||
`gmt_modified` DATETIME,
|
`gmt_modified` DATETIME,
|
||||||
PRIMARY KEY (`row_key`),
|
PRIMARY KEY (`row_key`),
|
||||||
|
KEY `idx_status` (`status`),
|
||||||
KEY `idx_branch_id` (`branch_id`)
|
KEY `idx_branch_id` (`branch_id`)
|
||||||
|
) ENGINE = InnoDB
|
||||||
|
DEFAULT CHARSET = utf8;
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `distributed_lock`
|
||||||
|
(
|
||||||
|
`lock_key` CHAR(20) NOT NULL,
|
||||||
|
`lock_value` VARCHAR(20) NOT NULL,
|
||||||
|
`expire` BIGINT,
|
||||||
|
primary key (`lock_key`)
|
||||||
) ENGINE = InnoDB
|
) ENGINE = InnoDB
|
||||||
DEFAULT CHARSET = utf8mb4;
|
DEFAULT CHARSET = utf8mb4;
|
||||||
|
|
||||||
|
INSERT INTO `distributed_lock` (lock_key, lock_value, expire) VALUES ('AsyncCommitting', ' ', 0);
|
||||||
|
INSERT INTO `distributed_lock` (lock_key, lock_value, expire) VALUES ('RetryCommitting', ' ', 0);
|
||||||
|
INSERT INTO `distributed_lock` (lock_key, lock_value, expire) VALUES ('RetryRollbacking', ' ', 0);
|
||||||
|
INSERT INTO `distributed_lock` (lock_key, lock_value, expire) VALUES ('TxTimeoutCheck', ' ', 0);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue