未验证 提交 d3819824 编写于 作者: L Liang Zhang 提交者: GitHub

Update doc (#8162)

* Update doc

* Update doc
上级 0d8c1edd
...@@ -21,8 +21,8 @@ ds_key=host_name:host_port:db_name:user_name:pwd ...@@ -21,8 +21,8 @@ ds_key=host_name:host_port:db_name:user_name:pwd
// Example // Example
CREATE datasources ( CREATE datasources (
ds0=127.0.0.1:3306:demo_ds_2:root:pwd, ds0=127.0.0.1:3306:demo_ds_0:root:pwd,
ds1=127.0.0.1:3306:demo_ds_3:root:pwd) ds1=127.0.0.1:3306:demo_ds_1:root:pwd)
``` ```
- `CREATE SHARDINGRULE`,用于配置分片规则。 - `CREATE SHARDINGRULE`,用于配置分片规则。
```sql ```sql
...@@ -47,16 +47,19 @@ t_item=mod(item_id, 2) ...@@ -47,16 +47,19 @@ t_item=mod(item_id, 2)
## RDL使用实战 ## RDL使用实战
### 前置工作 ### 前置工作
1. Start the service of MySQL instances 1. Start the service of MySQL instances
2. Create MySQL databases (Viewed as the resources for ShardingProxy) 2. Create MySQL databases (Viewed as the resources for ShardingProxy)
3. Create a role or user with creating privileges for ShardingProxy 3. Create a role or user with creating privileges for ShardingProxy
4. Start the service of Zookeeper (For persisting configuration) 4. Start the service of Zookeeper (For persisting configuration)
### 启动ShardingProxy ### 启动ShardingProxy
1. Add `governance` and `authentication` setting item to the `server.yaml` (Please refer to the example in this file) 1. Add `governance` and `authentication` setting item to the `server.yaml` (Please refer to the example in this file)
2. Start the ShardingProxy ([Instruction](/en/quick-start/shardingsphere-proxy-quick-start/)) 2. Start the ShardingProxy ([Instruction](/en/quick-start/shardingsphere-proxy-quick-start/))
### 创建分布式数据库和分片表 ### 创建分布式数据库和分片表
1. 连接到ShardingProxy 1. 连接到ShardingProxy
2. 创建分布式数据库 2. 创建分布式数据库
...@@ -122,6 +125,7 @@ DROP DATABASE sharding_db ...@@ -122,6 +125,7 @@ DROP DATABASE sharding_db
``` ```
### 注意 ### 注意
1. 当前, `DROP DB`只会移除`逻辑的分布式数据库`,不会删除用户真实的数据库 (**TODO**)。 1. 当前, `DROP DB`只会移除`逻辑的分布式数据库`,不会删除用户真实的数据库 (**TODO**)。
2. `DROP TABLE`会将逻辑分片表和数据库中真实的表全部删除。 2. `DROP TABLE`会将逻辑分片表和数据库中真实的表全部删除。
3. `CREATE DB`只会创建`逻辑的分布式数据库`,所以需要用户提前创建好真实的数据库(**TODO**)。 3. `CREATE DB`只会创建`逻辑的分布式数据库`,所以需要用户提前创建好真实的数据库(**TODO**)。
......
...@@ -19,8 +19,8 @@ ds_key=host_name:host_port:db_name:user_name:pwd ...@@ -19,8 +19,8 @@ ds_key=host_name:host_port:db_name:user_name:pwd
// Example // Example
CREATE datasources ( CREATE datasources (
ds0=127.0.0.1:3306:demo_ds_2:root:pwd, ds0=127.0.0.1:3306:demo_ds_0:root:pwd,
ds1=127.0.0.1:3306:demo_ds_3:root:pwd) ds1=127.0.0.1:3306:demo_ds_1:root:pwd)
``` ```
- `CREATE SHARDINGRULE` to create sharding rule made by table rules - `CREATE SHARDINGRULE` to create sharding rule made by table rules
```sql ```sql
...@@ -45,16 +45,19 @@ t_item=mod(item_id, 2) ...@@ -45,16 +45,19 @@ t_item=mod(item_id, 2)
## A common scenario for RDL ## A common scenario for RDL
### Pre-work ### Pre-work
1. Start the service of MySQL instances 1. Start the service of MySQL instances
2. Create MySQL databases (Viewed as the resources for ShardingProxy) 2. Create MySQL databases (Viewed as the resources for ShardingProxy)
3. Create a role or user with creating privileges for ShardingProxy 3. Create a role or user with creating privileges for ShardingProxy
4. Start the service of Zookeeper (For persisting configuration) 4. Start the service of Zookeeper (For persisting configuration)
### Initialize ShardingProxy ### Initialize ShardingProxy
1. Add `governance` and `authentication` setting item to the `server.yaml` (Please refer to the example in this file) 1. Add `governance` and `authentication` setting item to the `server.yaml` (Please refer to the example in this file)
2. Start the ShardingProxy ([Instruction](/en/quick-start/shardingsphere-proxy-quick-start/)) 2. Start the ShardingProxy ([Instruction](/en/quick-start/shardingsphere-proxy-quick-start/))
### Create Sharding DBs and Tables ### Create Sharding DBs and Tables
1. Connect to ShardingProxy 1. Connect to ShardingProxy
2. Create a sharding database 2. Create a sharding database
...@@ -120,6 +123,7 @@ DROP DATABASE sharding_db ...@@ -120,6 +123,7 @@ DROP DATABASE sharding_db
``` ```
### Notices ### Notices
1. Currently, `DROP DB` only removes` the logic sharding schema` instead of removing the actual databases in MySQL instance (**TODO**). 1. Currently, `DROP DB` only removes` the logic sharding schema` instead of removing the actual databases in MySQL instance (**TODO**).
2. `DROP TABLE` will drop `the logic sharding table` and `the corresponding actual tables` in MySQL instance together. 2. `DROP TABLE` will drop `the logic sharding table` and `the corresponding actual tables` in MySQL instance together.
3. `CREATE DB` just create the logic sharding schema rather than create the actual databases in MySQL instance (**TODO**). 3. `CREATE DB` just create the logic sharding schema rather than create the actual databases in MySQL instance (**TODO**).
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册