From f0fa7688b4c1845eef17c4544b37a63490292a2a Mon Sep 17 00:00:00 2001 From: Pace2Car Date: Wed, 20 Sep 2023 16:49:29 +0800 Subject: [PATCH 1/6] Add document of data source for proxy --- .../yaml-config/data-source.cn.md | 49 +++++++++++++++++++ .../yaml-config/data-source.en.md | 49 +++++++++++++++++++ 2 files changed, 98 insertions(+) create mode 100644 docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.cn.md create mode 100644 docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.en.md diff --git a/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.cn.md b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.cn.md new file mode 100644 index 0000000000000..5e4e265fd5d33 --- /dev/null +++ b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.cn.md @@ -0,0 +1,49 @@ ++++ +title = "数据源配置" +weight = 4 +chapter = true ++++ + +## 背景信息 + +ShardingSphere-PROXY 支持常见的数据库连接池: HikariCP、C3P0、DBCP。 + +可以通过参数 `dataSourceClassName` 指定连接池,当不指定时,默认的的数据库连接池为 HikariCP。 + +## 参数解释 + +```yaml +dataSources: # 数据源配置,可配置多个 + : # 数据源名称 + dataSourceClassName: # 数据源连接池完整类名 + driverClassName: # 数据库驱动类名,以数据库连接池自身配置为准 + jdbcUrl: # 数据库 URL 连接,以数据库连接池自身配置为准 + username: # 数据库用户名,以数据库连接池自身配置为准 + password: # 数据库密码,以数据库连接池自身配置为准 + # ... 数据库连接池的其它属性 +``` +## 配置示例 + +```yaml +dataSources: + ds_1: + dataSourceClassName: com.zaxxer.hikari.HikariDataSource + driverClassName: com.mysql.jdbc.Driver + jdbcUrl: jdbc:mysql://localhost:3306/ds_1 + username: root + password: + ds_2: + dataSourceClassName: com.mchange.v2.c3p0.ComboPooledDataSource + driverClassName: com.mysql.jdbc.Driver + jdbcUrl: jdbc:mysql://localhost:3306/ds_2 + username: root + password: + ds_3: + dataSourceClassName: org.apache.commons.dbcp2.BasicDataSource + driverClassName: com.mysql.jdbc.Driver + jdbcUrl: jdbc:mysql://localhost:3306/ds_3 + username: root + password: + + # 配置其他数据源 +``` diff --git a/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.en.md b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.en.md new file mode 100644 index 0000000000000..6321cd7ccb334 --- /dev/null +++ b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.en.md @@ -0,0 +1,49 @@ ++++ +title = "Data Source" +weight = 4 +chapter = true ++++ + +## Background + +ShardingSphere-PROXY supports common database connection pools: HikariCP, C3P0, DBCP. + +The connection pool can be specified through the parameter `dataSourceClassName`. When not specified, the default database connection pool is HikariCP. + +## Parameters + +```yaml +dataSources: # Data sources configuration, multiple available + : # Data source name + dataSourceClassName: # Data source connection pool full class name + driverClassName: # The database driver class name is subject to the configuration of the database connection pool itself + jdbcUrl: # The database URL connection is subject to the configuration of the database connection pool itself + username: # Database user name, subject to the configuration of the database connection pool itself + password: # The database password is subject to the configuration of the database connection pool itself + # ... Other properties of data source pool +``` +## Sample + +```yaml +dataSources: + ds_1: + dataSourceClassName: com.zaxxer.hikari.HikariDataSource + driverClassName: com.mysql.jdbc.Driver + jdbcUrl: jdbc:mysql://localhost:3306/ds_1 + username: root + password: + ds_2: + dataSourceClassName: com.mchange.v2.c3p0.ComboPooledDataSource + driverClassName: com.mysql.jdbc.Driver + jdbcUrl: jdbc:mysql://localhost:3306/ds_2 + username: root + password: + ds_3: + dataSourceClassName: org.apache.commons.dbcp2.BasicDataSource + driverClassName: com.mysql.jdbc.Driver + jdbcUrl: jdbc:mysql://localhost:3306/ds_3 + username: root + password: + + # Configure other data sources +``` From 3b98c011a41e8d5f137d37b1d6a8f748d8657763 Mon Sep 17 00:00:00 2001 From: Pace2Car Date: Wed, 20 Sep 2023 17:08:55 +0800 Subject: [PATCH 2/6] Fix document --- .../shardingsphere-proxy/yaml-config/data-source.cn.md | 10 +++------- .../shardingsphere-proxy/yaml-config/data-source.en.md | 10 +++------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.cn.md b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.cn.md index 5e4e265fd5d33..cd5d0d349e267 100644 --- a/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.cn.md +++ b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.cn.md @@ -27,21 +27,17 @@ dataSources: # 数据源配置,可配置多个 ```yaml dataSources: ds_1: - dataSourceClassName: com.zaxxer.hikari.HikariDataSource - driverClassName: com.mysql.jdbc.Driver - jdbcUrl: jdbc:mysql://localhost:3306/ds_1 + url: jdbc:mysql://localhost:3306/ds_1 username: root password: ds_2: dataSourceClassName: com.mchange.v2.c3p0.ComboPooledDataSource - driverClassName: com.mysql.jdbc.Driver - jdbcUrl: jdbc:mysql://localhost:3306/ds_2 + url: jdbc:mysql://localhost:3306/ds_2 username: root password: ds_3: dataSourceClassName: org.apache.commons.dbcp2.BasicDataSource - driverClassName: com.mysql.jdbc.Driver - jdbcUrl: jdbc:mysql://localhost:3306/ds_3 + url: jdbc:mysql://localhost:3306/ds_3 username: root password: diff --git a/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.en.md b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.en.md index 6321cd7ccb334..d9b36f447d327 100644 --- a/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.en.md +++ b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.en.md @@ -27,21 +27,17 @@ dataSources: # Data sources configuration, multiple available ```yaml dataSources: ds_1: - dataSourceClassName: com.zaxxer.hikari.HikariDataSource - driverClassName: com.mysql.jdbc.Driver - jdbcUrl: jdbc:mysql://localhost:3306/ds_1 + url: jdbc:mysql://localhost:3306/ds_1 username: root password: ds_2: dataSourceClassName: com.mchange.v2.c3p0.ComboPooledDataSource - driverClassName: com.mysql.jdbc.Driver - jdbcUrl: jdbc:mysql://localhost:3306/ds_2 + url: jdbc:mysql://localhost:3306/ds_2 username: root password: ds_3: dataSourceClassName: org.apache.commons.dbcp2.BasicDataSource - driverClassName: com.mysql.jdbc.Driver - jdbcUrl: jdbc:mysql://localhost:3306/ds_3 + url: jdbc:mysql://localhost:3306/ds_3 username: root password: From 33d9cd5755223aaf1741e620a603af9ec4164a6f Mon Sep 17 00:00:00 2001 From: Pace2Car Date: Wed, 20 Sep 2023 17:12:55 +0800 Subject: [PATCH 3/6] Fix document --- .../shardingsphere-proxy/yaml-config/data-source.cn.md | 2 +- .../shardingsphere-proxy/yaml-config/data-source.en.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.cn.md b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.cn.md index cd5d0d349e267..a4278fed27d34 100644 --- a/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.cn.md +++ b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.cn.md @@ -6,7 +6,7 @@ chapter = true ## 背景信息 -ShardingSphere-PROXY 支持常见的数据库连接池: HikariCP、C3P0、DBCP。 +ShardingSphere-Proxy 支持常见的数据库连接池: HikariCP、C3P0、DBCP。 可以通过参数 `dataSourceClassName` 指定连接池,当不指定时,默认的的数据库连接池为 HikariCP。 diff --git a/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.en.md b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.en.md index d9b36f447d327..15708a6400f9a 100644 --- a/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.en.md +++ b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.en.md @@ -6,7 +6,7 @@ chapter = true ## Background -ShardingSphere-PROXY supports common database connection pools: HikariCP, C3P0, DBCP. +ShardingSphere-Proxy supports common database connection pools: HikariCP, C3P0, DBCP. The connection pool can be specified through the parameter `dataSourceClassName`. When not specified, the default database connection pool is HikariCP. From ef394319226b03d0707133004baedeec36762871 Mon Sep 17 00:00:00 2001 From: Pace2Car Date: Wed, 20 Sep 2023 17:27:04 +0800 Subject: [PATCH 4/6] Fix document --- .../shardingsphere-jdbc/yaml-config/data-source.en.md | 10 +++++----- .../shardingsphere-proxy/yaml-config/data-source.cn.md | 3 +-- .../shardingsphere-proxy/yaml-config/data-source.en.md | 7 +++---- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/docs/document/content/user-manual/shardingsphere-jdbc/yaml-config/data-source.en.md b/docs/document/content/user-manual/shardingsphere-jdbc/yaml-config/data-source.en.md index d5bf857296fd5..e8595212d21f3 100644 --- a/docs/document/content/user-manual/shardingsphere-jdbc/yaml-config/data-source.en.md +++ b/docs/document/content/user-manual/shardingsphere-jdbc/yaml-config/data-source.en.md @@ -6,7 +6,7 @@ chapter = true ## Background -ShardingSphere-JDBC Supports all JDBC drivers and database connection pools. +ShardingSphere-JDBC Supports all JDBC drivers and data source connection pools. In this example, the database driver is MySQL, and the connection pool is HikariCP, which can be replaced with other database drivers and connection pools. When using ShardingSphere JDBC, the property name of the JDBC pool depends on the definition of the respective JDBC pool and is not defined by ShardingSphere. For related processing, please refer to the class org.apache.shardingsphere.infra.datasource.pool.creator.DataSourcePoolCreator. @@ -18,10 +18,10 @@ For example, with Alibaba Druid 1.2.9, using url instead of jdbcUrl in the examp dataSources: # Data sources configuration, multiple available : # Data source name dataSourceClassName: # Data source class name - driverClassName: # The database driver class name is subject to the configuration of the database connection pool itself - jdbcUrl: # The database URL connection is subject to the configuration of the database connection pool itself - username: # Database user name, subject to the configuration of the database connection pool itself - password: # The database password is subject to the configuration of the database connection pool itself + driverClassName: # The database driver class name is subject to the configuration of the data source connection pool itself + jdbcUrl: # The database URL connection is subject to the configuration of the data source connection pool itself + username: # Database username, subject to the configuration of the data source connection pool itself + password: # The database password is subject to the configuration of the data source connection pool itself # ... Other properties of data source pool ``` ## Sample diff --git a/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.cn.md b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.cn.md index a4278fed27d34..a66406cd32a45 100644 --- a/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.cn.md +++ b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.cn.md @@ -16,8 +16,7 @@ ShardingSphere-Proxy 支持常见的数据库连接池: HikariCP、C3P0、DBCP dataSources: # 数据源配置,可配置多个 : # 数据源名称 dataSourceClassName: # 数据源连接池完整类名 - driverClassName: # 数据库驱动类名,以数据库连接池自身配置为准 - jdbcUrl: # 数据库 URL 连接,以数据库连接池自身配置为准 + url: # 数据库 URL 连接,以数据库连接池自身配置为准 username: # 数据库用户名,以数据库连接池自身配置为准 password: # 数据库密码,以数据库连接池自身配置为准 # ... 数据库连接池的其它属性 diff --git a/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.en.md b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.en.md index 15708a6400f9a..01f032cdde19a 100644 --- a/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.en.md +++ b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.en.md @@ -6,9 +6,9 @@ chapter = true ## Background -ShardingSphere-Proxy supports common database connection pools: HikariCP, C3P0, DBCP. +ShardingSphere-Proxy supports common data source connection pools: HikariCP, C3P0, DBCP. -The connection pool can be specified through the parameter `dataSourceClassName`. When not specified, the default database connection pool is HikariCP. +The connection pool can be specified through the parameter `dataSourceClassName`. When not specified, the default data source connection pool is HikariCP. ## Parameters @@ -16,8 +16,7 @@ The connection pool can be specified through the parameter `dataSourceClassName` dataSources: # Data sources configuration, multiple available : # Data source name dataSourceClassName: # Data source connection pool full class name - driverClassName: # The database driver class name is subject to the configuration of the database connection pool itself - jdbcUrl: # The database URL connection is subject to the configuration of the database connection pool itself + url: # The database URL connection is subject to the configuration of the database connection pool itself username: # Database user name, subject to the configuration of the database connection pool itself password: # The database password is subject to the configuration of the database connection pool itself # ... Other properties of data source pool From 6c1dc0a273da821cb8c8c2be4ae8da6446df6cfc Mon Sep 17 00:00:00 2001 From: Pace2Car Date: Wed, 20 Sep 2023 17:30:23 +0800 Subject: [PATCH 5/6] Fix document --- .../shardingsphere-proxy/yaml-config/data-source.en.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.en.md b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.en.md index 01f032cdde19a..b8f52059efb60 100644 --- a/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.en.md +++ b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.en.md @@ -16,9 +16,9 @@ The connection pool can be specified through the parameter `dataSourceClassName` dataSources: # Data sources configuration, multiple available : # Data source name dataSourceClassName: # Data source connection pool full class name - url: # The database URL connection is subject to the configuration of the database connection pool itself - username: # Database user name, subject to the configuration of the database connection pool itself - password: # The database password is subject to the configuration of the database connection pool itself + url: # The database URL connection is subject to the configuration of the data source connection pool itself + username: # Database username, subject to the configuration of the data source connection pool itself + password: # The database password is subject to the configuration of the data source connection pool itself # ... Other properties of data source pool ``` ## Sample From 211ba4b6c185538c30bfddc6d5b585038a07deb2 Mon Sep 17 00:00:00 2001 From: Pace2Car Date: Wed, 20 Sep 2023 17:33:08 +0800 Subject: [PATCH 6/6] Fix document --- .../shardingsphere-proxy/yaml-config/data-source.cn.md | 6 +++--- .../shardingsphere-proxy/yaml-config/data-source.en.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.cn.md b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.cn.md index a66406cd32a45..51cc806077fbe 100644 --- a/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.cn.md +++ b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.cn.md @@ -16,9 +16,9 @@ ShardingSphere-Proxy 支持常见的数据库连接池: HikariCP、C3P0、DBCP dataSources: # 数据源配置,可配置多个 : # 数据源名称 dataSourceClassName: # 数据源连接池完整类名 - url: # 数据库 URL 连接,以数据库连接池自身配置为准 - username: # 数据库用户名,以数据库连接池自身配置为准 - password: # 数据库密码,以数据库连接池自身配置为准 + url: # 数据库 URL 连接 + username: # 数据库用户名 + password: # 数据库密码 # ... 数据库连接池的其它属性 ``` ## 配置示例 diff --git a/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.en.md b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.en.md index b8f52059efb60..0f44b8507578b 100644 --- a/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.en.md +++ b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.en.md @@ -16,9 +16,9 @@ The connection pool can be specified through the parameter `dataSourceClassName` dataSources: # Data sources configuration, multiple available : # Data source name dataSourceClassName: # Data source connection pool full class name - url: # The database URL connection is subject to the configuration of the data source connection pool itself - username: # Database username, subject to the configuration of the data source connection pool itself - password: # The database password is subject to the configuration of the data source connection pool itself + url: # The database URL connection + username: # Database username + password: # The database password # ... Other properties of data source pool ``` ## Sample