You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2020/09/14 05:42:51 UTC
[shardingsphere] branch master updated: Update scaling usage
document. (#7433)
This is an automated email from the ASF dual-hosted git repository.
zhangyonglun 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 1849f8d Update scaling usage document. (#7433)
1849f8d is described below
commit 1849f8d1f03372713367be0c48848f6a496d7ea6
Author: 邱鹿 Lucas <lu...@163.com>
AuthorDate: Mon Sep 14 13:42:28 2020 +0800
Update scaling usage document. (#7433)
Co-authored-by: qiulu3 <Lucas209910>
---
.../shardingsphere-scaling-quick-start.cn.md | 27 +--------
.../shardingsphere-scaling-quick-start.en.md | 23 --------
.../user-manual/shardingsphere-scaling/usage.cn.md | 66 +++++++++++++++++-----
.../user-manual/shardingsphere-scaling/usage.en.md | 66 +++++++++++++++++-----
4 files changed, 106 insertions(+), 76 deletions(-)
diff --git a/docs/document/content/quick-start/shardingsphere-scaling-quick-start.cn.md b/docs/document/content/quick-start/shardingsphere-scaling-quick-start.cn.md
index 425cfe5..4273b30 100644
--- a/docs/document/content/quick-start/shardingsphere-scaling-quick-start.cn.md
+++ b/docs/document/content/quick-start/shardingsphere-scaling-quick-start.cn.md
@@ -20,31 +20,8 @@ weight = 3
sh %SHARDINGSPHERE_SCALING_HOME%/bin/start.sh
```
-## 4. 创建迁移任务
+## 4. 任务管理
通过相应的 HTTP 接口管理迁移任务。
-创建迁移任务:
-
-```bash
-curl -X POST \
- http://localhost:8888/scaling/job/start \
- -H 'content-type: application/json' \
- -d '{
- "ruleConfiguration": {
- "sourceDatasource":"dataSources:\n ds_0:\n dataSourceClassName: com.zaxxer.hikari.HikariDataSource\n props:\n jdbcUrl: jdbc:mysql://127.0.0.1:3306/test?serverTimezone=UTC&useSSL=false\n username: root\n password: '123456'\n connectionTimeout: 30000\n idleTimeout: 60000\n maxLifetime: 1800000\n maxPoolSize: 50\n minPoolSize: 1\n maintenanceIntervalMilliseconds: 30000\n readOnly: false\n",
- "sourceRule": "defaultDatabaseStrategy:\n inline:\n algorithmExpression: ds_${user_id % 2}\n shardingColumn: user_id\ntables:\n t1:\n actualDataNodes: ds_0.t1\n keyGenerateStrategy:\n column: order_id\n type: SNOWFLAKE\n logicTable: t1\n tableStrategy:\n inline:\n algorithmExpression: t1\n shardingColumn: order_id\n t2:\n actualDataNodes: ds_0.t2\n keyGenerateStrategy:\n column: order_item_id\n type: SNOWFLAKE\n l [...]
- "destinationDataSources": {
- "name": "dt_0",
- "password": "123456",
- "url": "jdbc:mysql://127.0.0.1:3306/test2?serverTimezone=UTC&useSSL=false",
- "username": "root"
- }
- },
- "jobConfiguration": {
- "concurrency": 3
- }
-}'
-```
-
-更多管理接口详情请参见[使用手册](/cn/user-manual/shardingsphere-scaling/usage/)。
+详情参见[使用手册](/cn/user-manual/shardingsphere-scaling/usage/)。
diff --git a/docs/document/content/quick-start/shardingsphere-scaling-quick-start.en.md b/docs/document/content/quick-start/shardingsphere-scaling-quick-start.en.md
index 58eff44..c7df807 100644
--- a/docs/document/content/quick-start/shardingsphere-scaling-quick-start.en.md
+++ b/docs/document/content/quick-start/shardingsphere-scaling-quick-start.en.md
@@ -24,27 +24,4 @@ sh %SHARDINGSPHERE_SCALING_HOME%/bin/start.sh
Use HTTP interface to manage the migration jobs.
-Create migration job:
-
-```bash
-curl -X POST \
- http://localhost:8888/scaling/job/start \
- -H 'content-type: application/json' \
- -d '{
- "ruleConfiguration": {
- "sourceDatasource":"dataSources:\n ds_0:\n dataSourceClassName: com.zaxxer.hikari.HikariDataSource\n props:\n jdbcUrl: jdbc:mysql://127.0.0.1:3306/test?serverTimezone=UTC&useSSL=false\n username: root\n password: '123456'\n connectionTimeout: 30000\n idleTimeout: 60000\n maxLifetime: 1800000\n maxPoolSize: 50\n minPoolSize: 1\n maintenanceIntervalMilliseconds: 30000\n readOnly: false\n",
- "sourceRule": "defaultDatabaseStrategy:\n inline:\n algorithmExpression: ds_${user_id % 2}\n shardingColumn: user_id\ntables:\n t1:\n actualDataNodes: ds_0.t1\n keyGenerateStrategy:\n column: order_id\n type: SNOWFLAKE\n logicTable: t1\n tableStrategy:\n inline:\n algorithmExpression: t1\n shardingColumn: order_id\n t2:\n actualDataNodes: ds_0.t2\n keyGenerateStrategy:\n column: order_item_id\n type: SNOWFLAKE\n l [...]
- "destinationDataSources": {
- "name": "dt_0",
- "password": "123456",
- "url": "jdbc:mysql://127.0.0.1:3306/test2?serverTimezone=UTC&useSSL=false",
- "username": "root"
- }
- },
- "jobConfiguration": {
- "concurrency": 3
- }
-}'
-```
-
Please refer to [Configuration Manual](/en/user-manual/shardingsphere-scaling/usage/) for more details.
diff --git a/docs/document/content/user-manual/shardingsphere-scaling/usage.cn.md b/docs/document/content/user-manual/shardingsphere-scaling/usage.cn.md
index af0d1a8..8c16255 100644
--- a/docs/document/content/user-manual/shardingsphere-scaling/usage.cn.md
+++ b/docs/document/content/user-manual/shardingsphere-scaling/usage.cn.md
@@ -70,20 +70,58 @@ curl -X POST \
http://localhost:8888/scaling/job/start \
-H 'content-type: application/json' \
-d '{
- "ruleConfiguration": {
- "sourceDatasource":"dataSources:\n ds_0:\n dataSourceClassName: com.zaxxer.hikari.HikariDataSource\n props:\n jdbcUrl: jdbc:mysql://127.0.0.1:3306/test?serverTimezone=UTC&useSSL=false\n username: root\n password: '123456'\n connectionTimeout: 30000\n idleTimeout: 60000\n maxLifetime: 1800000\n maxPoolSize: 50\n minPoolSize: 1\n maintenanceIntervalMilliseconds: 30000\n readOnly: false\n",
- "sourceRule": "defaultDatabaseStrategy:\n inline:\n algorithmExpression: ds_${user_id % 2}\n shardingColumn: user_id\ntables:\n t1:\n actualDataNodes: ds_0.t1\n keyGenerateStrategy:\n column: order_id\n type: SNOWFLAKE\n logicTable: t1\n tableStrategy:\n inline:\n algorithmExpression: t1\n shardingColumn: order_id\n t2:\n actualDataNodes: ds_0.t2\n keyGenerateStrategy:\n column: order_item_id\n type: SNOWFLAKE\n l [...]
- "destinationDataSources": {
- "name": "dt_0",
- "password": "123456",
- "url": "jdbc:mysql://127.0.0.1:3306/test2?serverTimezone=UTC&useSSL=false",
- "username": "root"
- }
- },
- "jobConfiguration": {
- "concurrency": 3
- }
-}'
+ "ruleConfiguration": {
+ "sourceDatasource":"
+ dataSources:
+ ds_0:
+ dataSourceClassName: com.zaxxer.hikari.HikariDataSource
+ props:
+ driverClassName: com.mysql.jdbc.Driver
+ jdbcUrl: jdbc:mysql://127.0.0.1:3306/scaling?useSSL=false
+ username: scaling
+ password: scaling
+ ds_1:
+ dataSourceClassName: com.zaxxer.hikari.HikariDataSource
+ props:
+ driverClassName: com.mysql.jdbc.Driver
+ jdbcUrl: jdbc:mysql://127.0.0.1:3306/scaling?useSSL=false
+ username: scaling
+ password: scaling
+ ",
+ "sourceRule":"
+ tables:
+ t_order:
+ actualDataNodes: ds_$->{0..1}.t_order_$->{0..1}
+ databaseStrategy:
+ standard:
+ shardingColumn: order_id
+ shardingAlgorithmName: t_order_db_algorith
+ logicTable: t_order
+ tableStrategy:
+ standard:
+ shardingColumn: user_id
+ shardingAlgorithmName: t_order_tbl_algorith
+ shardingAlgorithms:
+ t_order_db_algorith:
+ type: INLINE
+ props:
+ algorithm-expression: ds_$->{order_id % 2}
+ t_order_tbl_algorith:
+ type: INLINE
+ props:
+ algorithm-expression: t_order_$->{user_id % 2}
+ ",
+ "destinationDataSources":{
+ "username":"root",
+ "password":"root",
+ "url":"jdbc:mysql://127.0.0.1:3307/sharding_db?serverTimezone=UTC&useSSL=false"
+ }
+ },
+ "jobConfiguration":{
+ "jobName": "jobName",
+ "concurrency":"3"
+ }
+ }'
```
返回信息:
diff --git a/docs/document/content/user-manual/shardingsphere-scaling/usage.en.md b/docs/document/content/user-manual/shardingsphere-scaling/usage.en.md
index 72dcbd7..16272ef 100644
--- a/docs/document/content/user-manual/shardingsphere-scaling/usage.en.md
+++ b/docs/document/content/user-manual/shardingsphere-scaling/usage.en.md
@@ -70,20 +70,58 @@ curl -X POST \
http://localhost:8888/scaling/job/start \
-H 'content-type: application/json' \
-d '{
- "ruleConfiguration": {
- "sourceDatasource":"dataSources:\n ds_0:\n dataSourceClassName: com.zaxxer.hikari.HikariDataSource\n props:\n jdbcUrl: jdbc:mysql://127.0.0.1:3306/test?serverTimezone=UTC&useSSL=false\n username: root\n password: '123456'\n connectionTimeout: 30000\n idleTimeout: 60000\n maxLifetime: 1800000\n maxPoolSize: 50\n minPoolSize: 1\n maintenanceIntervalMilliseconds: 30000\n readOnly: false\n",
- "sourceRule": "defaultDatabaseStrategy:\n inline:\n algorithmExpression: ds_${user_id % 2}\n shardingColumn: user_id\ntables:\n t1:\n actualDataNodes: ds_0.t1\n keyGenerateStrategy:\n column: order_id\n type: SNOWFLAKE\n logicTable: t1\n tableStrategy:\n inline:\n algorithmExpression: t1\n shardingColumn: order_id\n t2:\n actualDataNodes: ds_0.t2\n keyGenerateStrategy:\n column: order_item_id\n type: SNOWFLAKE\n l [...]
- "destinationDataSources": {
- "name": "dt_0",
- "password": "123456",
- "url": "jdbc:mysql://127.0.0.1:3306/test2?serverTimezone=UTC&useSSL=false",
- "username": "root"
- }
- },
- "jobConfiguration": {
- "concurrency": 3
- }
-}'
+ "ruleConfiguration": {
+ "sourceDatasource":"
+ dataSources:
+ ds_0:
+ dataSourceClassName: com.zaxxer.hikari.HikariDataSource
+ props:
+ driverClassName: com.mysql.jdbc.Driver
+ jdbcUrl: jdbc:mysql://127.0.0.1:3306/scaling?useSSL=false
+ username: scaling
+ password: scaling
+ ds_1:
+ dataSourceClassName: com.zaxxer.hikari.HikariDataSource
+ props:
+ driverClassName: com.mysql.jdbc.Driver
+ jdbcUrl: jdbc:mysql://127.0.0.1:3306/scaling?useSSL=false
+ username: scaling
+ password: scaling
+ ",
+ "sourceRule":"
+ tables:
+ t_order:
+ actualDataNodes: ds_$->{0..1}.t_order_$->{0..1}
+ databaseStrategy:
+ standard:
+ shardingColumn: order_id
+ shardingAlgorithmName: t_order_db_algorith
+ logicTable: t_order
+ tableStrategy:
+ standard:
+ shardingColumn: user_id
+ shardingAlgorithmName: t_order_tbl_algorith
+ shardingAlgorithms:
+ t_order_db_algorith:
+ type: INLINE
+ props:
+ algorithm-expression: ds_$->{order_id % 2}
+ t_order_tbl_algorith:
+ type: INLINE
+ props:
+ algorithm-expression: t_order_$->{user_id % 2}
+ ",
+ "destinationDataSources":{
+ "username":"root",
+ "password":"root",
+ "url":"jdbc:mysql://127.0.0.1:3307/sharding_db?serverTimezone=UTC&useSSL=false"
+ }
+ },
+ "jobConfiguration":{
+ "jobName": "jobName",
+ "concurrency":"3"
+ }
+ }'
```
Response: