forked from APIJSON/APIJSON-Demo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapplication-sharding-databases.properties
More file actions
55 lines (43 loc) · 3.07 KB
/
application-sharding-databases.properties
File metadata and controls
55 lines (43 loc) · 3.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#
# 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.shardingsphere.datasource.names=ds-0,ds-1
spring.shardingsphere.datasource.ds-0.jdbc-url=jdbc:mysql://localhost:3306/sys?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
spring.shardingsphere.datasource.ds-0.type=com.zaxxer.hikari.HikariDataSource
spring.shardingsphere.datasource.ds-0.driver-class-name=com.mysql.jdbc.Driver
spring.shardingsphere.datasource.ds-0.username=root
spring.shardingsphere.datasource.ds-0.password=apijson
spring.shardingsphere.datasource.ds-1.jdbc-url=jdbc:mysql://localhost:3306/sys?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
spring.shardingsphere.datasource.ds-1.type=com.zaxxer.hikari.HikariDataSource
spring.shardingsphere.datasource.ds-1.driver-class-name=com.mysql.jdbc.Driver
spring.shardingsphere.datasource.ds-1.username=root
spring.shardingsphere.datasource.ds-1.password=apijson
spring.shardingsphere.rules.sharding.default-database-strategy.standard.sharding-column=id
spring.shardingsphere.rules.sharding.default-database-strategy.standard.sharding-algorithm-name=database-inline
spring.shardingsphere.rules.sharding.binding-tables[0]=Moment,Comment
spring.shardingsphere.rules.sharding.broadcast-tables=apijson_user
spring.shardingsphere.rules.sharding.tables.Moment.actual-data-nodes=ds-$->{0..1}.Moment
spring.shardingsphere.rules.sharding.tables.Moment.key-generate-strategy.column=id
spring.shardingsphere.rules.sharding.tables.Moment.key-generate-strategy.key-generator-name=snowflake
spring.shardingsphere.rules.sharding.tables.Comment.actual-data-nodes=ds-$->{0..1}.Comment
spring.shardingsphere.rules.sharding.tables.Comment.key-generate-strategy.column=id
spring.shardingsphere.rules.sharding.tables.Comment.key-generate-strategy.key-generator-name=snowflake
spring.shardingsphere.rules.sharding.tables.apijson_user.actual-data-nodes=ds-$->{0..1}.apijson_user
spring.shardingsphere.rules.sharding.tables.apijson_user.key-generate-strategy.column=id
spring.shardingsphere.rules.sharding.tables.apijson_user.key-generate-strategy.key-generator-name=snowflake
spring.shardingsphere.rules.sharding.sharding-algorithms.database-inline.type=INLINE
spring.shardingsphere.rules.sharding.sharding-algorithms.database-inline.props.algorithm-expression=ds-$->{userId % 2}
spring.shardingsphere.rules.sharding.key-generators.snowflake.type=SNOWFLAKE