Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
武汉红喜
whatsmars
提交
d1703bf7
W
whatsmars
项目概览
武汉红喜
/
whatsmars
通知
3
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
W
whatsmars
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
d1703bf7
编写于
8月 24, 2019
作者:
武汉红喜
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
upgrade to org.apache.shardingsphere
上级
8f8b027a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
147 addition
and
155 deletion
+147
-155
whatsmars-shardingsphere/pom.xml
whatsmars-shardingsphere/pom.xml
+1
-1
whatsmars-shardingsphere/src/main/resources/application.yml
whatsmars-shardingsphere/src/main/resources/application.yml
+146
-154
未找到文件。
whatsmars-shardingsphere/pom.xml
浏览文件 @
d1703bf7
...
...
@@ -15,7 +15,7 @@
<description>
shardingjdbc demo
</description>
<properties>
<shardingsphere.version>
4.0.0-RC
1
</shardingsphere.version>
<shardingsphere.version>
4.0.0-RC
2
</shardingsphere.version>
</properties>
<dependencies>
...
...
whatsmars-shardingsphere/src/main/resources/application.yml
浏览文件 @
d1703bf7
...
...
@@ -12,13 +12,13 @@ spring:
names
:
ds0,ds1
ds0
:
type
:
org.apache.commons.dbcp.BasicDataSource
driver-class-name
:
com.mysql.jdbc.Driver
driver-class-name
:
com.mysql.
cj.
jdbc.Driver
url
:
jdbc:mysql://db.hongxi.org:3306/demo_ds_0
username
:
root
password
:
n36bxXMnHina
ds1
:
type
:
org.apache.commons.dbcp.BasicDataSource
driver-class-name
:
com.mysql.jdbc.Driver
driver-class-name
:
com.mysql.
cj.
jdbc.Driver
url
:
jdbc:mysql://db.hongxi.org:3306/demo_ds_1
username
:
root
password
:
n36bxXMnHina
...
...
@@ -46,167 +46,159 @@ spring:
---
spring
:
profiles
:
sharding-db
sharding
:
jdbc
:
config
:
sharding
:
default-database-strategy
:
inline
:
algorithm-expression
:
ds_${user_id % 2}
sharding-column
:
user_id
tables
:
t_order
:
actual-data-nodes
:
ds_${0..1}.t_order
key-generator-column-name
:
order_id
t_order_item
:
actual-data-nodes
:
ds_${0..1}.t_order_item
key-generator-column-name
:
order_item_id
datasource
:
ds_0
:
driver-class-name
:
com.mysql.jdbc.Driver
password
:
'
'
type
:
org.apache.commons.dbcp.BasicDataSource
url
:
jdbc:mysql://localhost:3306/demo_ds_0
username
:
root
ds_1
:
driver-class-name
:
com.mysql.jdbc.Driver
password
:
'
'
type
:
org.apache.commons.dbcp.BasicDataSource
url
:
jdbc:mysql://localhost:3306/demo_ds_1
username
:
root
names
:
ds_0,ds_1
shardingsphere
:
sharding
:
default-database-strategy
:
inline
:
algorithm-expression
:
ds_${user_id % 2}
sharding-column
:
user_id
tables
:
t_order
:
actual-data-nodes
:
ds_${0..1}.t_order
key-generator-column-name
:
order_id
t_order_item
:
actual-data-nodes
:
ds_${0..1}.t_order_item
key-generator-column-name
:
order_item_id
datasource
:
ds_0
:
driver-class-name
:
com.mysql.cj.jdbc.Driver
password
:
'
'
type
:
org.apache.commons.dbcp.BasicDataSource
url
:
jdbc:mysql://localhost:3306/demo_ds_0
username
:
root
ds_1
:
driver-class-name
:
com.mysql.cj.jdbc.Driver
password
:
'
'
type
:
org.apache.commons.dbcp.BasicDataSource
url
:
jdbc:mysql://localhost:3306/demo_ds_1
username
:
root
names
:
ds_0,ds_1
---
spring
:
profiles
:
sharding-tbl
sharding
:
jdbc
:
config
:
sharding
:
tables
:
t_order
:
actual-data-nodes
:
ds.t_order_${0..1}
key-generator-column-name
:
order_id
table-strategy
:
inline
:
algorithm-expression
:
t_order_${order_id % 2}
sharding-column
:
order_id
t_order_item
:
actual-data-nodes
:
ds.t_order_item_${0..1}
key-generator-column-name
:
order_item_id
table-strategy
:
inline
:
algorithm-expression
:
t_order_item_${order_id % 2}
sharding-column
:
order_id
datasource
:
ds
:
driver-class-name
:
com.mysql.jdbc.Driver
password
:
'
'
type
:
org.apache.commons.dbcp.BasicDataSource
url
:
jdbc:mysql://localhost:3306/demo_ds
username
:
root
names
:
ds
shardingsphere
:
sharding
:
tables
:
t_order
:
actual-data-nodes
:
ds.t_order_${0..1}
key-generator-column-name
:
order_id
table-strategy
:
inline
:
algorithm-expression
:
t_order_${order_id % 2}
sharding-column
:
order_id
t_order_item
:
actual-data-nodes
:
ds.t_order_item_${0..1}
key-generator-column-name
:
order_item_id
table-strategy
:
inline
:
algorithm-expression
:
t_order_item_${order_id % 2}
sharding-column
:
order_id
datasource
:
ds
:
driver-class-name
:
com.mysql.cj.jdbc.Driver
password
:
'
'
type
:
org.apache.commons.dbcp.BasicDataSource
url
:
jdbc:mysql://localhost:3306/demo_ds
username
:
root
names
:
ds
---
spring
:
profiles
:
masterslave
sharding
:
jdbc
:
config
:
masterslave
:
load-balance-algorithm-type
:
round_robin
master-data-source-name
:
ds_master
name
:
ds_ms
slave-data-source-names
:
ds_slave_0,ds_slave_1
datasource
:
ds_master
:
driver-class-name
:
com.mysql.jdbc.Driver
password
:
'
'
type
:
org.apache.commons.dbcp.BasicDataSource
url
:
jdbc:mysql://localhost:3306/demo_ds_master
username
:
root
ds_slave_0
:
driver-class-name
:
com.mysql.jdbc.Driver
password
:
'
'
type
:
org.apache.commons.dbcp.BasicDataSource
url
:
jdbc:mysql://localhost:3306/demo_ds_slave_0
username
:
root
ds_slave_1
:
driver-class-name
:
com.mysql.jdbc.Driver
password
:
'
'
type
:
org.apache.commons.dbcp.BasicDataSource
url
:
jdbc:mysql://localhost:3306/demo_ds_slave_1
username
:
root
names
:
ds_master,ds_slave_0,ds_slave_1
shardingsphere
:
masterslave
:
load-balance-algorithm-type
:
round_robin
master-data-source-name
:
ds_master
name
:
ds_ms
slave-data-source-names
:
ds_slave_0,ds_slave_1
datasource
:
ds_master
:
driver-class-name
:
com.mysql.cj.jdbc.Driver
password
:
'
'
type
:
org.apache.commons.dbcp.BasicDataSource
url
:
jdbc:mysql://localhost:3306/demo_ds_master
username
:
root
ds_slave_0
:
driver-class-name
:
com.mysql.cj.jdbc.Driver
password
:
'
'
type
:
org.apache.commons.dbcp.BasicDataSource
url
:
jdbc:mysql://localhost:3306/demo_ds_slave_0
username
:
root
ds_slave_1
:
driver-class-name
:
com.mysql.cj.jdbc.Driver
password
:
'
'
type
:
org.apache.commons.dbcp.BasicDataSource
url
:
jdbc:mysql://localhost:3306/demo_ds_slave_1
username
:
root
names
:
ds_master,ds_slave_0,ds_slave_1
---
spring
:
profiles
:
sharding-masterslave
sharding
:
jdbc
:
config
:
sharding
:
default-database-strategy
:
inline
:
algorithm-expression
:
ds_${user_id % 2}
sharding-column
:
user_id
master-slave-rules
:
ds_0
:
master-data-source-name
:
ds_master_0
slave-data-source-names
:
ds_master_0_slave_0, ds_master_0_slave_1
ds_1
:
master-data-source-name
:
ds_master_1
slave-data-source-names
:
ds_master_1_slave_0, ds_master_1_slave_1
tables
:
t_order
:
actual-data-nodes
:
ds_${0..1}.t_order_${0..1}
key-generator-column-name
:
order_id
table-strategy
:
inline
:
algorithm-expression
:
t_order_${order_id % 2}
sharding-column
:
order_id
t_order_item
:
actual-data-nodes
:
ds_${0..1}.t_order_item_${0..1}
key-generator-column-name
:
order_item_id
table-strategy
:
inline
:
algorithm-expression
:
t_order_item_${order_id % 2}
sharding-column
:
order_id
datasource
:
ds_master_0
:
driver-class-name
:
com.mysql.jdbc.Driver
password
:
'
'
type
:
org.apache.commons.dbcp.BasicDataSource
url
:
jdbc:mysql://localhost:3306/demo_ds_master_0
username
:
root
ds_master_0_slave_0
:
driver-class-name
:
com.mysql.jdbc.Driver
password
:
'
'
type
:
org.apache.commons.dbcp.BasicDataSource
url
:
jdbc:mysql://localhost:3306/demo_ds_master_0_slave_0
username
:
root
ds_master_0_slave_1
:
driver-class-name
:
com.mysql.jdbc.Driver
password
:
'
'
type
:
org.apache.commons.dbcp.BasicDataSource
url
:
jdbc:mysql://localhost:3306/demo_ds_master_0_slave_1
username
:
root
ds_master_1
:
driver-class-name
:
com.mysql.jdbc.Driver
password
:
'
'
type
:
org.apache.commons.dbcp.BasicDataSource
url
:
jdbc:mysql://localhost:3306/demo_ds_master_1
username
:
root
ds_master_1_slave_0
:
driver-class-name
:
com.mysql.jdbc.Driver
password
:
'
'
type
:
org.apache.commons.dbcp.BasicDataSource
url
:
jdbc:mysql://localhost:3306/demo_ds_master_1_slave_0
username
:
root
ds_master_1_slave_1
:
driver-class-name
:
com.mysql.jdbc.Driver
password
:
'
'
type
:
org.apache.commons.dbcp.BasicDataSource
url
:
jdbc:mysql://localhost:3306/demo_ds_master_1_slave_1
username
:
root
names
:
ds_master_0,ds_master_1,ds_master_0_slave_0,ds_master_0_slave_1,ds_master_1_slave_0,ds_master_1_slave_1
\ No newline at end of file
shardingsphere
:
sharding
:
default-database-strategy
:
inline
:
algorithm-expression
:
ds_${user_id % 2}
sharding-column
:
user_id
master-slave-rules
:
ds_0
:
master-data-source-name
:
ds_master_0
slave-data-source-names
:
ds_master_0_slave_0, ds_master_0_slave_1
ds_1
:
master-data-source-name
:
ds_master_1
slave-data-source-names
:
ds_master_1_slave_0, ds_master_1_slave_1
tables
:
t_order
:
actual-data-nodes
:
ds_${0..1}.t_order_${0..1}
key-generator-column-name
:
order_id
table-strategy
:
inline
:
algorithm-expression
:
t_order_${order_id % 2}
sharding-column
:
order_id
t_order_item
:
actual-data-nodes
:
ds_${0..1}.t_order_item_${0..1}
key-generator-column-name
:
order_item_id
table-strategy
:
inline
:
algorithm-expression
:
t_order_item_${order_id % 2}
sharding-column
:
order_id
datasource
:
ds_master_0
:
driver-class-name
:
com.mysql.cj.jdbc.Driver
password
:
'
'
type
:
org.apache.commons.dbcp.BasicDataSource
url
:
jdbc:mysql://localhost:3306/demo_ds_master_0
username
:
root
ds_master_0_slave_0
:
driver-class-name
:
com.mysql.cj.jdbc.Driver
password
:
'
'
type
:
org.apache.commons.dbcp.BasicDataSource
url
:
jdbc:mysql://localhost:3306/demo_ds_master_0_slave_0
username
:
root
ds_master_0_slave_1
:
driver-class-name
:
com.mysql.cj.jdbc.Driver
password
:
'
'
type
:
org.apache.commons.dbcp.BasicDataSource
url
:
jdbc:mysql://localhost:3306/demo_ds_master_0_slave_1
username
:
root
ds_master_1
:
driver-class-name
:
com.mysql.cj.jdbc.Driver
password
:
'
'
type
:
org.apache.commons.dbcp.BasicDataSource
url
:
jdbc:mysql://localhost:3306/demo_ds_master_1
username
:
root
ds_master_1_slave_0
:
driver-class-name
:
com.mysql.cj.jdbc.Driver
password
:
'
'
type
:
org.apache.commons.dbcp.BasicDataSource
url
:
jdbc:mysql://localhost:3306/demo_ds_master_1_slave_0
username
:
root
ds_master_1_slave_1
:
driver-class-name
:
com.mysql.cj.jdbc.Driver
password
:
'
'
type
:
org.apache.commons.dbcp.BasicDataSource
url
:
jdbc:mysql://localhost:3306/demo_ds_master_1_slave_1
username
:
root
names
:
ds_master_0,ds_master_1,ds_master_0_slave_0,ds_master_0_slave_1,ds_master_1_slave_0,ds_master_1_slave_1
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录