mirror of
https://github.com/201206030/novel.git
synced 2025-04-27 07:30:50 +00:00
fix: 分库分表功能失效
shardingsphere-jdbc-core-spring-boot-starter 依赖版本过低
This commit is contained in:
parent
2270072d7e
commit
7b4b97569b
7
pom.xml
7
pom.xml
@ -22,7 +22,7 @@
|
|||||||
<elasticsearch.version>8.2.0</elasticsearch.version>
|
<elasticsearch.version>8.2.0</elasticsearch.version>
|
||||||
<xxl-job.version>2.3.1</xxl-job.version>
|
<xxl-job.version>2.3.1</xxl-job.version>
|
||||||
<sentinel.version>1.8.4</sentinel.version>
|
<sentinel.version>1.8.4</sentinel.version>
|
||||||
<shardingsphere-jdbc.version>5.1.1</shardingsphere-jdbc.version>
|
<shardingsphere-jdbc.version>5.2.1</shardingsphere-jdbc.version>
|
||||||
<redisson.version>3.19.1</redisson.version>
|
<redisson.version>3.19.1</redisson.version>
|
||||||
<spring-boot-admin.version>3.0.0-M1</spring-boot-admin.version>
|
<spring-boot-admin.version>3.0.0-M1</spring-boot-admin.version>
|
||||||
<springdoc-openapi.version>2.0.0</springdoc-openapi.version>
|
<springdoc-openapi.version>2.0.0</springdoc-openapi.version>
|
||||||
@ -149,6 +149,11 @@
|
|||||||
<artifactId>shardingsphere-jdbc-core-spring-boot-starter</artifactId>
|
<artifactId>shardingsphere-jdbc-core-spring-boot-starter</artifactId>
|
||||||
<version>${shardingsphere-jdbc.version}</version>
|
<version>${shardingsphere-jdbc.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.h2database</groupId>
|
||||||
|
<artifactId>h2</artifactId>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- Spring Boot 管理和监控 -->
|
<!-- Spring Boot 管理和监控 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -0,0 +1,24 @@
|
|||||||
|
package io.github.xxyopen.novel.core.config;
|
||||||
|
|
||||||
|
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ShardingSphere 配置类,控制是否开启 ShardingSphere
|
||||||
|
*
|
||||||
|
* @author xiongxiaoyang
|
||||||
|
* @date 2023/12/21
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
@EnableAutoConfiguration(exclude = {
|
||||||
|
org.apache.shardingsphere.spring.boot.ShardingSphereAutoConfiguration.class
|
||||||
|
})
|
||||||
|
@ConditionalOnProperty(
|
||||||
|
prefix = "spring.shardingsphere",
|
||||||
|
name = {"enabled"},
|
||||||
|
havingValue = "false"
|
||||||
|
)
|
||||||
|
public class ShardingSphereConfiguration {
|
||||||
|
|
||||||
|
}
|
@ -65,6 +65,12 @@
|
|||||||
"name": "spring.elasticsearch.ssl.verification-mode",
|
"name": "spring.elasticsearch.ssl.verification-mode",
|
||||||
"type": "java.lang.String",
|
"type": "java.lang.String",
|
||||||
"description": "设置 ssl 的认证模式,如果该配置项为 none ,说明不需要认证,信任所有的 ssl 证书."
|
"description": "设置 ssl 的认证模式,如果该配置项为 none ,说明不需要认证,信任所有的 ssl 证书."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"defaultValue": true,
|
||||||
|
"name": "spring.shardingsphere.enabled",
|
||||||
|
"description": "Whether enable shardingsphere or not.",
|
||||||
|
"type": "java.lang.Boolean"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -39,14 +39,15 @@ spring:
|
|||||||
mode:
|
mode:
|
||||||
# 单机模式
|
# 单机模式
|
||||||
type: Standalone
|
type: Standalone
|
||||||
|
# 元数据持久化
|
||||||
repository:
|
repository:
|
||||||
# 文件持久化
|
# 数据库持久化
|
||||||
type: File
|
type: JDBC
|
||||||
props:
|
props:
|
||||||
# 元数据存储路径
|
# 元数据存储类型
|
||||||
path: .shardingsphere
|
provider: H2
|
||||||
# 使用本地配置覆盖持久化配置
|
jdbc_url: jdbc:h2:./.h2/shardingsphere
|
||||||
overwrite: true
|
|
||||||
# 数据源配置
|
# 数据源配置
|
||||||
datasource:
|
datasource:
|
||||||
names: ds_0
|
names: ds_0
|
||||||
@ -87,7 +88,7 @@ spring:
|
|||||||
redis:
|
redis:
|
||||||
host: 127.0.0.1
|
host: 127.0.0.1
|
||||||
port: 6379
|
port: 6379
|
||||||
password: 123456
|
password: test123456
|
||||||
|
|
||||||
# Elasticsearch 配置
|
# Elasticsearch 配置
|
||||||
elasticsearch:
|
elasticsearch:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user