This is an automated email from the ASF dual-hosted git repository.
sunnianjun 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 012f22407f4 Update doc for alter storage unit (#31980)
012f22407f4 is described below
commit 012f22407f44c33ea8f40d2129ae210b4e77eb28
Author: Raigor <[email protected]>
AuthorDate: Thu Jul 4 16:36:02 2024 +0800
Update doc for alter storage unit (#31980)
---
.../alter-storage-unit.cn.md | 23 +++++++++------------
.../alter-storage-unit.en.md | 24 ++++++++++------------
2 files changed, 21 insertions(+), 26 deletions(-)
diff --git
a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/storage-unit-definition/alter-storage-unit.cn.md
b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/storage-unit-definition/alter-storage-unit.cn.md
index aac673d2575..efd493917c4 100644
---
a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/storage-unit-definition/alter-storage-unit.cn.md
+++
b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/storage-unit-definition/alter-storage-unit.cn.md
@@ -56,18 +56,15 @@ value ::=
### 补充说明
-- 修改存储单元前请确认已经在 Proxy 中创建逻辑数据库,并执行 `use` 命令成功选择一个逻辑数据库;
-- `ALTER STORAGE UNIT`不允许改变该存储单元关联的真实数据源;
+- 修改存储单元前请确认已经在 Proxy 中创建逻辑数据库,并执行 `use` 命令选择一个逻辑数据库;
+- `ALTER STORAGE UNIT`不允许改变该存储单元关联的真实数据源(通过 host、port 和 db 判断);
- `ALTER STORAGE UNIT`会发生连接池的切换,这个操作可能对进行中的业务造成影响,请谨慎使用;
-- 确认添加的存储单元是可以正常连接的, 否则将不能添加成功;
-- `storageUnitName` 区分大小写;
-- `storageUnitName` 在当前逻辑库中需要唯一;
-- `storageUnitName` 命名只允许使用字母、数字以及 `_` ,且必须以字母开头;
-- `poolProperty` 用于自定义连接池参数,`key` 必须和连接池参数名一致。
+- 请确认修改的存储单元是可以正常连接的, 否则将不能修改成功;
+- `PROPERTIES` 为可选参数,用于自定义连接池属性,`key` 必须和连接池参数名一致。
### 示例
-- 使用标准模式修改存储单元
+- 使用 HOST & PORT 方式修改存储单元
```sql
ALTER STORAGE UNIT ds_0 (
@@ -79,10 +76,10 @@ ALTER STORAGE UNIT ds_0 (
);
```
-- 使用标准模式修改存储单元并设置连接池参数
+- 使用 HOST & PORT 方式修改存储单元并设置连接池属性
```sql
-ALTER STORAGE UNIT ds_0 (
+ALTER STORAGE UNIT ds_1 (
HOST="127.0.0.1",
PORT=3306,
DB="db_1",
@@ -92,11 +89,11 @@ ALTER STORAGE UNIT ds_0 (
);
```
-- 使用 URL 模式修改存储单元并设置连接池参数
+- 使用 URL 模式修改存储单元并设置连接池属性
```sql
-ALTER STORAGE UNIT ds_0 (
- URL="jdbc:mysql://127.0.0.1:3306/db_2?serverTimezone=UTC&useSSL=false",
+ALTER STORAGE UNIT ds_2 (
+
URL="jdbc:mysql://127.0.0.1:3306/db_2?serverTimezone=UTC&useSSL=false&allowPublicKeyRetrieval=true",
USER="root",
PASSWORD="root",
PROPERTIES("maximumPoolSize"=10,"idleTimeout"="30000")
diff --git
a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/storage-unit-definition/alter-storage-unit.en.md
b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/storage-unit-definition/alter-storage-unit.en.md
index 4f3c35f76c6..6c7aee224e4 100644
---
a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/storage-unit-definition/alter-storage-unit.en.md
+++
b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/storage-unit-definition/alter-storage-unit.en.md
@@ -57,19 +57,17 @@ value ::=
### Supplement
- Before altering the storage units, please confirm that a database exists in
Proxy, and execute the `use` command to
- successfully select a database;
-- `ALTER STORAGE UNIT` is not allowed to change the real data source
associated with this storageUnit;
+ select a database;
+- `ALTER STORAGE UNIT` is not allowed to change the real data source
associated with this storageUnit (determined by host, port and db);
- `ALTER STORAGE UNIT` will switch the connection pool. This operation may
affect the ongoing business, please use it with
caution;
-- `storageUnitName` is case-sensitive;
-- `storageUnitName` needs to be unique within the current database;
-- `storageUnitName` name only allows letters, numbers and `_`, and must start
with a letter;
-- `poolProperty` is used to customize connection pool parameters, `key` must
be the same as the connection pool
- parameter name.
+- Please confirm that the storage unit to be altered can be connected
successfully, otherwise the altering will fail;
+- `PROPERTIES` is optional, used to customize connection pool properties,
`key` must be the same as the connection pool
+ property name.
### Example
-- Alter storage unit using standard mode
+- Alter storage unit using HOST & PORT method
```sql
ALTER STORAGE UNIT ds_0 (
@@ -81,10 +79,10 @@ ALTER STORAGE UNIT ds_0 (
);
```
-- Alter storage unit and set connection pool parameters using standard mode
+- Alter storage unit and set connection pool properties using HOST & PORT
method
```sql
-ALTER STORAGE UNIT ds_0 (
+ALTER STORAGE UNIT ds_1 (
HOST=127.0.0.1,
PORT=3306,
DB=db_1,
@@ -94,11 +92,11 @@ ALTER STORAGE UNIT ds_0 (
);
```
-- Alter storage unit and set connection pool parameters using URL patterns
+- Alter storage unit and set connection pool properties using URL method
```sql
-ALTER STORAGE UNIT ds_0 (
- URL="jdbc:mysql://127.0.0.1:3306/db_2?serverTimezone=UTC&useSSL=false",
+ALTER STORAGE UNIT ds_2 (
+
URL="jdbc:mysql://127.0.0.1:3306/db_2?serverTimezone=UTC&useSSL=false&allowPublicKeyRetrieval=true",
USER=root,
PASSWORD=root,
PROPERTIES("maximumPoolSize"=10,"idleTimeout"="30000")