Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
Shardingsphere
提交
d3819824
Shardingsphere
项目概览
apache
/
Shardingsphere
通知
56
Star
3
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Shardingsphere
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
d3819824
编写于
11月 15, 2020
作者:
L
Liang Zhang
提交者:
GitHub
11月 15, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update doc (#8162)
* Update doc * Update doc
上级
0d8c1edd
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
12 addition
and
4 deletion
+12
-4
docs/document/content/features/sharding/use-norms/rdl.cn.md
docs/document/content/features/sharding/use-norms/rdl.cn.md
+6
-2
docs/document/content/features/sharding/use-norms/rdl.en.md
docs/document/content/features/sharding/use-norms/rdl.en.md
+6
-2
未找到文件。
docs/document/content/features/sharding/use-norms/rdl.cn.md
浏览文件 @
d3819824
...
...
@@ -21,8 +21,8 @@ ds_key=host_name:host_port:db_name:user_name:pwd
//
Example
CREATE
datasources
(
ds0
=
127
.
0
.
0
.
1
:
3306
:
demo_ds_
2
:
root
:
pwd
,
ds1
=
127
.
0
.
0
.
1
:
3306
:
demo_ds_
3
:
root
:
pwd
)
ds0
=
127
.
0
.
0
.
1
:
3306
:
demo_ds_
0
:
root
:
pwd
,
ds1
=
127
.
0
.
0
.
1
:
3306
:
demo_ds_
1
:
root
:
pwd
)
```
-
`CREATE SHARDINGRULE`
,用于配置分片规则。
```
sql
...
...
@@ -47,16 +47,19 @@ t_item=mod(item_id, 2)
## RDL使用实战
### 前置工作
1.
Start the service of MySQL instances
2.
Create MySQL databases (Viewed as the resources for ShardingProxy)
3.
Create a role or user with creating privileges for ShardingProxy
4.
Start the service of Zookeeper (For persisting configuration)
### 启动ShardingProxy
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/
)
)
### 创建分布式数据库和分片表
1.
连接到ShardingProxy
2.
创建分布式数据库
...
...
@@ -122,6 +125,7 @@ DROP DATABASE sharding_db
```
### 注意
1.
当前,
`DROP DB`
只会移除
`逻辑的分布式数据库`
,不会删除用户真实的数据库 (
**TODO**
)。
2.
`DROP TABLE`
会将逻辑分片表和数据库中真实的表全部删除。
3.
`CREATE DB`
只会创建
`逻辑的分布式数据库`
,所以需要用户提前创建好真实的数据库(
**TODO**
)。
...
...
docs/document/content/features/sharding/use-norms/rdl.en.md
浏览文件 @
d3819824
...
...
@@ -19,8 +19,8 @@ ds_key=host_name:host_port:db_name:user_name:pwd
//
Example
CREATE
datasources
(
ds0
=
127
.
0
.
0
.
1
:
3306
:
demo_ds_
2
:
root
:
pwd
,
ds1
=
127
.
0
.
0
.
1
:
3306
:
demo_ds_
3
:
root
:
pwd
)
ds0
=
127
.
0
.
0
.
1
:
3306
:
demo_ds_
0
:
root
:
pwd
,
ds1
=
127
.
0
.
0
.
1
:
3306
:
demo_ds_
1
:
root
:
pwd
)
```
-
`CREATE SHARDINGRULE`
to create sharding rule made by table rules
```
sql
...
...
@@ -45,16 +45,19 @@ t_item=mod(item_id, 2)
## A common scenario for RDL
### Pre-work
1.
Start the service of MySQL instances
2.
Create MySQL databases (Viewed as the resources for ShardingProxy)
3.
Create a role or user with creating privileges for ShardingProxy
4.
Start the service of Zookeeper (For persisting configuration)
### Initialize ShardingProxy
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/
)
)
### Create Sharding DBs and Tables
1.
Connect to ShardingProxy
2.
Create a sharding database
...
...
@@ -120,6 +123,7 @@ DROP DATABASE sharding_db
```
### Notices
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.
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录