You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by ch...@apache.org on 2023/07/20 02:37:20 UTC
[shardingsphere] branch master updated: Add apollo shardingsphere driver url configuration document (#27316)
This is an automated email from the ASF dual-hosted git repository.
chengzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 5b6cac8090f Add apollo shardingsphere driver url configuration document (#27316)
5b6cac8090f is described below
commit 5b6cac8090fef46822c5d651a4700a6637ed9d08
Author: ZhangCheng <ch...@apache.org>
AuthorDate: Thu Jul 20 10:37:13 2023 +0800
Add apollo shardingsphere driver url configuration document (#27316)
* Add apollo shardingsphere driver url configuration document
* Add apollo shardingsphere driver url configuration document
---
.../yaml-config/jdbc-driver/_index.cn.md | 18 +++++++++++++++++-
.../yaml-config/jdbc-driver/_index.en.md | 18 +++++++++++++++++-
2 files changed, 34 insertions(+), 2 deletions(-)
diff --git a/docs/document/content/user-manual/shardingsphere-jdbc/yaml-config/jdbc-driver/_index.cn.md b/docs/document/content/user-manual/shardingsphere-jdbc/yaml-config/jdbc-driver/_index.cn.md
index 642176d19c1..71d8a5cc571 100644
--- a/docs/document/content/user-manual/shardingsphere-jdbc/yaml-config/jdbc-driver/_index.cn.md
+++ b/docs/document/content/user-manual/shardingsphere-jdbc/yaml-config/jdbc-driver/_index.cn.md
@@ -19,8 +19,9 @@ ShardingSphere-JDBC 提供了 JDBC 驱动,可以仅通过配置变更即可使
- 以 `jdbc:shardingsphere:` 为前缀
- 配置文件:`xxx.yaml`,配置文件格式与 [YAML 配置](/cn/user-manual/shardingsphere-jdbc/yaml-config/)一致
- 配置文件加载规则:
- - 无前缀表示从指定路径加载配置文件
+ - `absolutepath:` 前缀表示从绝对路径中加载配置文件
- `classpath:` 前缀表示从类路径中加载配置文件
+ - `apollo:` 前缀表示从 apollo 中加载配置文件
## 操作步骤
@@ -34,6 +35,16 @@ ShardingSphere-JDBC 提供了 JDBC 驱动,可以仅通过配置变更即可使
</dependency>
```
+如果使用 apollo 配置方式,还需要引入 `apollo-client` 依赖:
+
+```xml
+<dependency>
+ <groupId>com.ctrip.framework.apollo</groupId>
+ <artifactId>apollo-client</artifactId>
+ <version>${apollo-client.version}</version>
+</dependency>
+```
+
2. 使用驱动
* 使用原生驱动:
@@ -92,3 +103,8 @@ jdbc:shardingsphere:classpath:config.yaml
```
jdbc:shardingsphere:absolutepath:/path/to/config.yaml
```
+
+加载 apollo 指定 namespace 中的 yaml 配置文件的 JDBC URL:
+```
+jdbc:shardingsphere:apollo:TEST.test_namespace
+```
diff --git a/docs/document/content/user-manual/shardingsphere-jdbc/yaml-config/jdbc-driver/_index.en.md b/docs/document/content/user-manual/shardingsphere-jdbc/yaml-config/jdbc-driver/_index.en.md
index 292f2650156..1cf11a2dc5c 100644
--- a/docs/document/content/user-manual/shardingsphere-jdbc/yaml-config/jdbc-driver/_index.en.md
+++ b/docs/document/content/user-manual/shardingsphere-jdbc/yaml-config/jdbc-driver/_index.en.md
@@ -19,8 +19,9 @@ ShardingSphere-JDBC provides a JDBC Driver, which can be used only through confi
- Use jdbc:shardingsphere: as prefix
- Configuration file: xxx.yaml, keep consist format with [YAML Configuration](/en/user-manual/shardingsphere-jdbc/yaml-config/)
- Configuration file loading rule:
- - No prefix means to load the configuration file from the specified path
+ - `absolutepath:` prefix means to load the configuration file from the absolute path
- `classpath:` prefix indicates that the configuration file is loaded from the classpath
+ - `apollo:` prefix means to load the configuration file from apollo
## Procedure
@@ -34,6 +35,16 @@ ShardingSphere-JDBC provides a JDBC Driver, which can be used only through confi
</dependency>
```
+If you use the apollo configuration method, you also need to introduce the `apollo-client` dependency:
+
+```xml
+<dependency>
+ <groupId>com.ctrip.framework.apollo</groupId>
+ <artifactId>apollo-client</artifactId>
+ <version>${apollo-client.version}</version>
+</dependency>
+```
+
2. Use drive
* Use native drivers:
@@ -92,3 +103,8 @@ Load JDBC URL of config.yaml profile in absolute path
```
jdbc:shardingsphere:absolutepath:/path/to/config.yaml
```
+
+Load JDBC URL of the yaml configuration file in the specified namespace of apollo:
+```
+jdbc:shardingsphere:apollo:TEST.test_namespace
+```