Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
Shardingsphere
提交
49be93fe
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,发现更多精彩内容 >>
提交
49be93fe
编写于
3月 13, 2019
作者:
C
cherrylzhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add sharding config file for spring-boot XA.
上级
8f916a45
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
133 addition
and
0 deletion
+133
-0
sharding-jdbc-example/transaction-example/transaction-2pc-xa-example/transaction-xa-spring-boot-example/src/main/resources/application-sharding-databases-tables.properties
...esources/application-sharding-databases-tables.properties
+29
-0
sharding-jdbc-example/transaction-example/transaction-2pc-xa-example/transaction-xa-spring-boot-example/src/main/resources/application-sharding-master-slave.properties
...in/resources/application-sharding-master-slave.properties
+62
-0
sharding-jdbc-example/transaction-example/transaction-2pc-xa-example/transaction-xa-spring-boot-example/src/main/resources/application.properties
...ng-boot-example/src/main/resources/application.properties
+23
-0
sharding-jdbc-example/transaction-example/transaction-2pc-xa-example/transaction-xa-spring-boot-example/src/main/resources/logback.xml
...ion-xa-spring-boot-example/src/main/resources/logback.xml
+19
-0
未找到文件。
sharding-jdbc-example/transaction-example/transaction-2pc-xa-example/transaction-xa-spring-boot-example/src/main/resources/application-sharding-databases-tables.properties
0 → 100644
浏览文件 @
49be93fe
sharding.jdbc.datasource.names
=
ds_0,ds_1
sharding.jdbc.datasource.ds_0.type
=
com.zaxxer.hikari.HikariDataSource
sharding.jdbc.datasource.ds_0.driver-class-name
=
com.mysql.jdbc.Driver
sharding.jdbc.datasource.ds_0.jdbc-url
=
jdbc:mysql://localhost:3306/demo_ds_0?serverTimezone=UTC&useSSL=false
sharding.jdbc.datasource.ds_0.username
=
root
sharding.jdbc.datasource.ds_0.password
=
sharding.jdbc.datasource.ds_0.max-active
=
16
sharding.jdbc.datasource.ds_1.type
=
com.zaxxer.hikari.HikariDataSource
sharding.jdbc.datasource.ds_1.driver-class-name
=
com.mysql.jdbc.Driver
sharding.jdbc.datasource.ds_1.jdbc-url
=
jdbc:mysql://localhost:3306/demo_ds_1?serverTimezone=UTC&useSSL=false
sharding.jdbc.datasource.ds_1.username
=
root
sharding.jdbc.datasource.ds_1.password
=
sharding.jdbc.datasource.ds_1.max-active
=
16
sharding.jdbc.config.sharding.default-database-strategy.inline.sharding-column
=
user_id
sharding.jdbc.config.sharding.default-database-strategy.inline.algorithm-expression
=
ds_$->{user_id % 2}
sharding.jdbc.config.sharding.tables.t_order.actual-data-nodes
=
ds_$->{0..1}.t_order_$->{0..1}
sharding.jdbc.config.sharding.tables.t_order.table-strategy.inline.sharding-column
=
order_id
sharding.jdbc.config.sharding.tables.t_order.table-strategy.inline.algorithm-expression
=
t_order_$->{order_id % 2}
sharding.jdbc.config.sharding.tables.t_order.key-generator.column
=
order_id
sharding.jdbc.config.sharding.tables.t_order.key-generator.type
=
SNOWFLAKE
sharding.jdbc.config.sharding.tables.t_order_item.actual-data-nodes
=
ds_$->{0..1}.t_order_item_$->{0..1}
sharding.jdbc.config.sharding.tables.t_order_item.table-strategy.inline.sharding-column
=
order_id
sharding.jdbc.config.sharding.tables.t_order_item.table-strategy.inline.algorithm-expression
=
t_order_item_$->{order_id % 2}
sharding.jdbc.config.sharding.tables.t_order_item.key-generator.column
=
order_item_id
sharding.jdbc.config.sharding.tables.t_order_item.key-generator.type
=
SNOWFLAKE
sharding-jdbc-example/transaction-example/transaction-2pc-xa-example/transaction-xa-spring-boot-example/src/main/resources/application-sharding-master-slave.properties
0 → 100644
浏览文件 @
49be93fe
sharding.jdbc.datasource.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
sharding.jdbc.datasource.ds_master_0.type
=
com.zaxxer.hikari.HikariDataSource
sharding.jdbc.datasource.ds_master_0.driver-class-name
=
com.mysql.jdbc.Driver
sharding.jdbc.datasource.ds_master_0.jdbc-url
=
jdbc:mysql://localhost:3306/demo_ds_master_0?serverTimezone=UTC&useSSL=false
sharding.jdbc.datasource.ds_master_0.username
=
root
sharding.jdbc.datasource.ds_master_0.password
=
sharding.jdbc.datasource.ds_master_0.max-active
=
16
sharding.jdbc.datasource.ds_master_0_slave_0.type
=
com.zaxxer.hikari.HikariDataSource
sharding.jdbc.datasource.ds_master_0_slave_0.driver-class-name
=
com.mysql.jdbc.Driver
sharding.jdbc.datasource.ds_master_0_slave_0.jdbc-url
=
jdbc:mysql://localhost:3306/demo_ds_master_0_slave_0?serverTimezone=UTC&useSSL=false
sharding.jdbc.datasource.ds_master_0_slave_0.username
=
root
sharding.jdbc.datasource.ds_master_0_slave_0.password
=
sharding.jdbc.datasource.ds_master_0_slave_0.max-active
=
16
sharding.jdbc.datasource.ds_master_0_slave_1.type
=
com.zaxxer.hikari.HikariDataSource
sharding.jdbc.datasource.ds_master_0_slave_1.driver-class-name
=
com.mysql.jdbc.Driver
sharding.jdbc.datasource.ds_master_0_slave_1.jdbc-url
=
jdbc:mysql://localhost:3306/demo_ds_master_0_slave_1?serverTimezone=UTC&useSSL=false
sharding.jdbc.datasource.ds_master_0_slave_1.username
=
root
sharding.jdbc.datasource.ds_master_0_slave_1.password
=
sharding.jdbc.datasource.ds_master_0_slave_1.max-active
=
16
sharding.jdbc.datasource.ds_master_1.type
=
com.zaxxer.hikari.HikariDataSource
sharding.jdbc.datasource.ds_master_1.driver-class-name
=
com.mysql.jdbc.Driver
sharding.jdbc.datasource.ds_master_1.jdbc-url
=
jdbc:mysql://localhost:3306/demo_ds_master_1?serverTimezone=UTC&useSSL=false
sharding.jdbc.datasource.ds_master_1.username
=
root
sharding.jdbc.datasource.ds_master_1.password
=
sharding.jdbc.datasource.ds_master_1.max-active
=
16
sharding.jdbc.datasource.ds_master_1_slave_0.type
=
com.zaxxer.hikari.HikariDataSource
sharding.jdbc.datasource.ds_master_1_slave_0.driver-class-name
=
com.mysql.jdbc.Driver
sharding.jdbc.datasource.ds_master_1_slave_0.jdbc-url
=
jdbc:mysql://localhost:3306/demo_ds_master_1_slave_0?serverTimezone=UTC&useSSL=false
sharding.jdbc.datasource.ds_master_1_slave_0.username
=
root
sharding.jdbc.datasource.ds_master_1_slave_0.password
=
sharding.jdbc.datasource.ds_master_1_slave_0.max-active
=
16
sharding.jdbc.datasource.ds_master_1_slave_1.type
=
com.zaxxer.hikari.HikariDataSource
sharding.jdbc.datasource.ds_master_1_slave_1.driver-class-name
=
com.mysql.jdbc.Driver
sharding.jdbc.datasource.ds_master_1_slave_1.jdbc-url
=
jdbc:mysql://localhost:3306/demo_ds_master_1_slave_1?serverTimezone=UTC&useSSL=false
sharding.jdbc.datasource.ds_master_1_slave_1.username
=
root
sharding.jdbc.datasource.ds_master_1_slave_1.password
=
sharding.jdbc.datasource.ds_master_1_slave_1.max-active
=
16
sharding.jdbc.config.sharding.default-database-strategy.inline.sharding-column
=
user_id
sharding.jdbc.config.sharding.default-database-strategy.inline.algorithm-expression
=
ds_$->{user_id % 2}
sharding.jdbc.config.sharding.tables.t_order.actual-data-nodes
=
ds_$->{0..1}.t_order_$->{0..1}
sharding.jdbc.config.sharding.tables.t_order.table-strategy.inline.sharding-column
=
order_id
sharding.jdbc.config.sharding.tables.t_order.table-strategy.inline.algorithm-expression
=
t_order_$->{order_id % 2}
sharding.jdbc.config.sharding.tables.t_order.key-generator.column
=
order_id
sharding.jdbc.config.sharding.tables.t_order.key-generator.type
=
SNOWFLAKE
sharding.jdbc.config.sharding.tables.t_order_item.actual-data-nodes
=
ds_$->{0..1}.t_order_item_$->{0..1}
sharding.jdbc.config.sharding.tables.t_order_item.table-strategy.inline.sharding-column
=
order_id
sharding.jdbc.config.sharding.tables.t_order_item.table-strategy.inline.algorithm-expression
=
t_order_item_$->{order_id % 2}
sharding.jdbc.config.sharding.tables.t_order_item.key-generator.column
=
order_item_id
sharding.jdbc.config.sharding.tables.t_order_item.key-generator.type
=
SNOWFLAKE
sharding.jdbc.config.sharding.master-slave-rules.ds_0.master-data-source-name
=
ds_master_0
sharding.jdbc.config.sharding.master-slave-rules.ds_0.slave-data-source-names
=
ds_master_0_slave_0, ds_master_0_slave_1
sharding.jdbc.config.sharding.master-slave-rules.ds_1.master-data-source-name
=
ds_master_1
sharding.jdbc.config.sharding.master-slave-rules.ds_1.slave-data-source-names
=
ds_master_1_slave_0, ds_master_1_slave_1
sharding-jdbc-example/transaction-example/transaction-2pc-xa-example/transaction-xa-spring-boot-example/src/main/resources/application.properties
0 → 100644
浏览文件 @
49be93fe
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
spring.jpa.properties.hibernate.hbm2ddl.auto
=
create-drop
spring.jpa.properties.hibernate.dialect
=
org.hibernate.dialect.MySQL5Dialect
spring.jpa.properties.hibernate.show_sql
=
false
spring.profiles.active
=
sharding-databases-tables
#spring.profiles.active=master-slave
sharding-jdbc-example/transaction-example/transaction-2pc-xa-example/transaction-xa-spring-boot-example/src/main/resources/logback.xml
0 → 100644
浏览文件 @
49be93fe
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<property
name=
"log.context.name"
value=
"spring-boot-nodep-jpa-example"
/>
<property
name=
"log.charset"
value=
"UTF-8"
/>
<property
name=
"log.pattern"
value=
"[%-5level] %date --%thread-- [%logger] %msg %n"
/>
<contextName>
${log.context.name}
</contextName>
<appender
name=
"STDOUT"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<encoder
charset=
"${log.charset}"
>
<pattern>
${log.pattern}
</pattern>
</encoder>
</appender>
<logger
name=
"org.springframework"
level=
"WARN"
/>
<logger
name=
"com.zaxxer.hikari"
level=
"WARN"
/>
<root>
<level
value=
"INFO"
/>
<appender-ref
ref=
"STDOUT"
/>
</root>
</configuration>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录