Skip to content

Commit f6a202b

Browse files
authored
Refactor cluster-mode-example with ShardingSphereDriver (#22542)
* Refactor with ShardingSphereDriver * Format * Add TODO * Fix * Remove password * Add blank line * Fix file name
1 parent dc57a59 commit f6a202b

File tree

36 files changed

+839
-405
lines changed

36 files changed

+839
-405
lines changed

examples/shardingsphere-jdbc-example/single-feature-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
</dependency>
3737
<dependency>
3838
<groupId>org.apache.shardingsphere</groupId>
39-
<artifactId>shardingsphere-jdbc-core-spring-boot-starter</artifactId>
39+
<artifactId>shardingsphere-jdbc-core</artifactId>
4040
</dependency>
4141
<dependency>
4242
<groupId>org.apache.shardingsphere</groupId>

examples/shardingsphere-jdbc-example/single-feature-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/src/main/resources/application-cloud-zookeeper-encrypt.properties

+2-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,5 @@
1515
# limitations under the License.
1616
#
1717

18-
spring.shardingsphere.mode.type=Cluster
19-
spring.shardingsphere.mode.repository.type=ZooKeeper
20-
spring.shardingsphere.mode.repository.props.namespace=demo_spring_boot_ds_encrypt
21-
spring.shardingsphere.mode.repository.props.server-lists=localhost:2181
18+
spring.datasource.driver-class-name=org.apache.shardingsphere.driver.ShardingSphereDriver
19+
spring.datasource.url=jdbc:shardingsphere:classpath:cloud-zookeeper-encrypt.yaml

examples/shardingsphere-jdbc-example/single-feature-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/src/main/resources/application-cloud-zookeeper-readwrite-splitting.properties

+2-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,5 @@
1515
# limitations under the License.
1616
#
1717

18-
spring.shardingsphere.mode.type=Cluster
19-
spring.shardingsphere.mode.repository.type=ZooKeeper
20-
spring.shardingsphere.mode.repository.props.namespace=demo_spring_boot_readwrite_ds
21-
spring.shardingsphere.mode.repository.props.server-lists=localhost:2181
18+
spring.datasource.driver-class-name=org.apache.shardingsphere.driver.ShardingSphereDriver
19+
spring.datasource.url=jdbc:shardingsphere:classpath:cloud-zookeeper-readwrite-splitting.yaml

examples/shardingsphere-jdbc-example/single-feature-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/src/main/resources/application-cloud-zookeeper-shadow.properties

+2-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,5 @@
1515
# limitations under the License.
1616
#
1717

18-
spring.shardingsphere.mode.type=Cluster
19-
spring.shardingsphere.mode.repository.type=ZooKeeper
20-
spring.shardingsphere.mode.repository.props.namespace=demo_spring_boot_ds_shadow
21-
spring.shardingsphere.mode.repository.props.server-lists=localhost:2181
18+
spring.datasource.driver-class-name=org.apache.shardingsphere.driver.ShardingSphereDriver
19+
spring.datasource.url=jdbc:shardingsphere:classpath:cloud-zookeeper-shadow.yaml

examples/shardingsphere-jdbc-example/single-feature-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/src/main/resources/application-cloud-zookeeper-sharding-databases-tables.properties

+2-6
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,5 @@
1515
# limitations under the License.
1616
#
1717

18-
spring.shardingsphere.database.name=sharding-databases-tables
19-
20-
spring.shardingsphere.mode.type=Cluster
21-
spring.shardingsphere.mode.repository.type=ZooKeeper
22-
spring.shardingsphere.mode.repository.props.namespace=demo_spring_boot_ds_sharding
23-
spring.shardingsphere.mode.repository.props.server-lists=localhost:2181
18+
spring.datasource.driver-class-name=org.apache.shardingsphere.driver.ShardingSphereDriver
19+
spring.datasource.url=jdbc:shardingsphere:classpath:cloud-zookeeper-sharding-databases-tables.yaml

examples/shardingsphere-jdbc-example/single-feature-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/src/main/resources/application-local-zookeeper-encrypt.properties

+2-20
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,5 @@
1515
# limitations under the License.
1616
#
1717

18-
spring.shardingsphere.mode.type=Cluster
19-
spring.shardingsphere.mode.repository.type=ZooKeeper
20-
spring.shardingsphere.mode.repository.props.namespace=demo_spring_boot_ds_encrypt
21-
spring.shardingsphere.mode.repository.props.server-lists=localhost:2181
22-
23-
spring.shardingsphere.datasource.name=ds-encrypt
24-
25-
spring.shardingsphere.datasource.ds-encrypt.type=com.zaxxer.hikari.HikariDataSource
26-
spring.shardingsphere.datasource.ds-encrypt.driver-class-name=com.mysql.jdbc.Driver
27-
spring.shardingsphere.datasource.ds-encrypt.jdbc-url=jdbc:mysql://localhost:3306/demo_ds?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
28-
spring.shardingsphere.datasource.ds-encrypt.username=root
29-
spring.shardingsphere.datasource.ds-encrypt.password=
30-
31-
spring.shardingsphere.rules.encrypt.encryptors.status-encryptor.type=AES
32-
spring.shardingsphere.rules.encrypt.encryptors.status-encryptor.props.aes-key-value=123456
33-
spring.shardingsphere.rules.encrypt.tables.t_order.columns.status.cipher-column=status
34-
spring.shardingsphere.rules.encrypt.tables.t_order.columns.status.encryptor-name=status-encryptor
35-
36-
spring.shardingsphere.props.query.with.cipher.comlum=true
37-
spring.shardingsphere.props.sql-show=true
18+
spring.datasource.driver-class-name=org.apache.shardingsphere.driver.ShardingSphereDriver
19+
spring.datasource.url=jdbc:shardingsphere:classpath:local-zookeeper-encrypt.yaml

examples/shardingsphere-jdbc-example/single-feature-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/src/main/resources/application-local-zookeeper-readwrite-splitting.properties

+2-29
Original file line numberDiff line numberDiff line change
@@ -15,32 +15,5 @@
1515
# limitations under the License.
1616
#
1717

18-
spring.shardingsphere.mode.type=Cluster
19-
spring.shardingsphere.mode.repository.type=ZooKeeper
20-
spring.shardingsphere.mode.repository.props.namespace=demo_spring_boot_readwrite_ds
21-
spring.shardingsphere.mode.repository.props.server-lists=localhost:2181
22-
23-
spring.shardingsphere.datasource.names=write-ds,read-ds-0,read-ds-1
24-
25-
spring.shardingsphere.datasource.write-ds.jdbc-url=jdbc:mysql://localhost:3306/demo_write_ds?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
26-
spring.shardingsphere.datasource.write-ds.type=com.zaxxer.hikari.HikariDataSource
27-
spring.shardingsphere.datasource.write-ds.driver-class-name=com.mysql.jdbc.Driver
28-
spring.shardingsphere.datasource.write-ds.username=root
29-
spring.shardingsphere.datasource.write-ds.password=
30-
31-
spring.shardingsphere.datasource.read-ds-0.jdbc-url=jdbc:mysql://localhost:3306/demo_read_ds_0?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
32-
spring.shardingsphere.datasource.read-ds-0.type=com.zaxxer.hikari.HikariDataSource
33-
spring.shardingsphere.datasource.read-ds-0.driver-class-name=com.mysql.jdbc.Driver
34-
spring.shardingsphere.datasource.read-ds-0.username=root
35-
spring.shardingsphere.datasource.read-ds-0.password=
36-
37-
spring.shardingsphere.datasource.read-ds-1.jdbc-url=jdbc:mysql://localhost:3306/demo_read_ds_1?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
38-
spring.shardingsphere.datasource.read-ds-1.type=com.zaxxer.hikari.HikariDataSource
39-
spring.shardingsphere.datasource.read-ds-1.driver-class-name=com.mysql.jdbc.Driver
40-
spring.shardingsphere.datasource.read-ds-1.username=root
41-
spring.shardingsphere.datasource.read-ds-1.password=
42-
43-
spring.shardingsphere.rules.readwrite-splitting.data-sources.readwrite_ds.static-strategy.write-data-source-name=write-ds
44-
spring.shardingsphere.rules.readwrite-splitting.data-sources.readwrite_ds.static-strategy.read-data-source-names=read-ds-0,read-ds-1
45-
spring.shardingsphere.rules.readwrite-splitting.data-sources.readwrite_ds.load-balancer-name=round_robin
46-
spring.shardingsphere.rules.readwrite-splitting.load-balancers.round_robin.type=ROUND_ROBIN
18+
spring.datasource.driver-class-name=org.apache.shardingsphere.driver.ShardingSphereDriver
19+
spring.datasource.url=jdbc:shardingsphere:classpath:local-zookeeper-readwrite-splitting.yaml

examples/shardingsphere-jdbc-example/single-feature-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/src/main/resources/application-local-zookeeper-shadow.properties

+2-45
Original file line numberDiff line numberDiff line change
@@ -15,48 +15,5 @@
1515
# limitations under the License.
1616
#
1717

18-
spring.shardingsphere.mode.type=Cluster
19-
spring.shardingsphere.mode.repository.type=ZooKeeper
20-
spring.shardingsphere.mode.repository.props.namespace=demo_spring_boot_ds_shadow
21-
spring.shardingsphere.mode.repository.props.server-lists=localhost:2181
22-
23-
spring.shardingsphere.datasource.name=ds,shadow-ds
24-
25-
spring.shardingsphere.datasource.shadow-ds.jdbc-url=jdbc:mysql://localhost:3306/shadow_demo_ds?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
26-
spring.shardingsphere.datasource.shadow-ds.type=com.zaxxer.hikari.HikariDataSource
27-
spring.shardingsphere.datasource.shadow-ds.driver-class-name=com.mysql.jdbc.Driver
28-
spring.shardingsphere.datasource.shadow-ds.username=root
29-
spring.shardingsphere.datasource.shadow-ds.password=
30-
31-
spring.shardingsphere.datasource.ds.jdbc-url=jdbc:mysql://localhost:3306/demo_ds?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
32-
spring.shardingsphere.datasource.ds.type=com.zaxxer.hikari.HikariDataSource
33-
spring.shardingsphere.datasource.ds.driver-class-name=com.mysql.jdbc.Driver
34-
spring.shardingsphere.datasource.ds.username=root
35-
spring.shardingsphere.datasource.ds.password=
36-
37-
spring.shardingsphere.rules.shadow.data-sources.shadow-data-source.source-data-source-name=ds
38-
spring.shardingsphere.rules.shadow.data-sources.shadow-data-source.shadow-data-source-name=shadow-ds
39-
40-
spring.shardingsphere.rules.shadow.tables.t_user.data-source-names=shadow-data-source
41-
spring.shardingsphere.rules.shadow.tables.t_user.shadow-algorithm-names=user-id-insert-match-algorithm,user-id-delete-match-algorithm,user-id-select-match-algorithm,simple-hint-algorithm
42-
43-
spring.shardingsphere.rules.shadow.shadow-algorithms.user-id-insert-match-algorithm.type=VALUE_MATCH
44-
spring.shardingsphere.rules.shadow.shadow-algorithms.user-id-insert-match-algorithm.props.operation=insert
45-
spring.shardingsphere.rules.shadow.shadow-algorithms.user-id-insert-match-algorithm.props.column=user_type
46-
spring.shardingsphere.rules.shadow.shadow-algorithms.user-id-insert-match-algorithm.props.value=1
47-
48-
spring.shardingsphere.rules.shadow.shadow-algorithms.user-id-delete-match-algorithm.type=VALUE_MATCH
49-
spring.shardingsphere.rules.shadow.shadow-algorithms.user-id-delete-match-algorithm.props.operation=delete
50-
spring.shardingsphere.rules.shadow.shadow-algorithms.user-id-delete-match-algorithm.props.column=user_type
51-
spring.shardingsphere.rules.shadow.shadow-algorithms.user-id-delete-match-algorithm.props.value=1
52-
53-
spring.shardingsphere.rules.shadow.shadow-algorithms.user-id-select-match-algorithm.type=VALUE_MATCH
54-
spring.shardingsphere.rules.shadow.shadow-algorithms.user-id-select-match-algorithm.props.operation=select
55-
spring.shardingsphere.rules.shadow.shadow-algorithms.user-id-select-match-algorithm.props.column=user_type
56-
spring.shardingsphere.rules.shadow.shadow-algorithms.user-id-select-match-algorithm.props.value=1
57-
58-
spring.shardingsphere.rules.shadow.shadow-algorithms.simple-hint-algorithm.type=SIMPLE_HINT
59-
spring.shardingsphere.rules.shadow.shadow-algorithms.simple-hint-algorithm.props.shadow=true
60-
spring.shardingsphere.rules.shadow.shadow-algorithms.simple-hint-algorithm.props.foo=bar
61-
62-
spring.shardingsphere.props.sql-show=true
18+
spring.datasource.driver-class-name=org.apache.shardingsphere.driver.ShardingSphereDriver
19+
spring.datasource.url=jdbc:shardingsphere:classpath:local-zookeeper-shadow.yaml

examples/shardingsphere-jdbc-example/single-feature-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/src/main/resources/application-local-zookeeper-sharding-databases-tables.properties

+2-56
Original file line numberDiff line numberDiff line change
@@ -15,59 +15,5 @@
1515
# limitations under the License.
1616
#
1717

18-
spring.shardingsphere.database.name=sharding-databases-tables
19-
20-
spring.shardingsphere.mode.type=Cluster
21-
spring.shardingsphere.mode.repository.type=ZooKeeper
22-
spring.shardingsphere.mode.repository.props.namespace=demo_spring_boot_ds_sharding
23-
spring.shardingsphere.mode.repository.props.server-lists=localhost:2181
24-
25-
spring.shardingsphere.datasource.names=ds-0,ds-1
26-
27-
spring.shardingsphere.datasource.ds-0.type=com.zaxxer.hikari.HikariDataSource
28-
spring.shardingsphere.datasource.ds-0.driver-class-name=com.mysql.jdbc.Driver
29-
spring.shardingsphere.datasource.ds-0.jdbc-url=jdbc:mysql://localhost:3306/demo_ds_0?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
30-
spring.shardingsphere.datasource.ds-0.username=root
31-
spring.shardingsphere.datasource.ds-0.password=
32-
spring.shardingsphere.datasource.ds-0.max-active=16
33-
34-
spring.shardingsphere.datasource.ds-1.type=com.zaxxer.hikari.HikariDataSource
35-
spring.shardingsphere.datasource.ds-1.driver-class-name=com.mysql.jdbc.Driver
36-
spring.shardingsphere.datasource.ds-1.jdbc-url=jdbc:mysql://localhost:3306/demo_ds_1?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
37-
spring.shardingsphere.datasource.ds-1.username=root
38-
spring.shardingsphere.datasource.ds-1.password=
39-
spring.shardingsphere.datasource.ds-1.max-active=16
40-
41-
spring.shardingsphere.rules.sharding.default-database-strategy.standard.sharding-column=user_id
42-
spring.shardingsphere.rules.sharding.default-database-strategy.standard.sharding-algorithm-name=database-inline
43-
44-
spring.shardingsphere.rules.sharding.binding-tables[0]=t_order,t_order_item
45-
spring.shardingsphere.rules.sharding.broadcast-tables=t_address
46-
47-
spring.shardingsphere.rules.sharding.tables.t_order.actual-data-nodes=ds-$->{0..1}.t_order_$->{0..1}
48-
spring.shardingsphere.rules.sharding.tables.t_order.table-strategy.standard.sharding-column=order_id
49-
spring.shardingsphere.rules.sharding.tables.t_order.table-strategy.standard.sharding-algorithm-name=t-order-inline
50-
51-
spring.shardingsphere.rules.sharding.tables.t_order.key-generate-strategy.column=order_id
52-
spring.shardingsphere.rules.sharding.tables.t_order.key-generate-strategy.key-generator-name=snowflake
53-
54-
spring.shardingsphere.rules.sharding.tables.t_order_item.actual-data-nodes=ds-$->{0..1}.t_order_item_$->{0..1}
55-
spring.shardingsphere.rules.sharding.tables.t_order_item.table-strategy.standard.sharding-column=order_id
56-
spring.shardingsphere.rules.sharding.tables.t_order_item.table-strategy.standard.sharding-algorithm-name=t-order-item-inline
57-
58-
spring.shardingsphere.rules.sharding.tables.t_order_item.key-generate-strategy.column=order_item_id
59-
spring.shardingsphere.rules.sharding.tables.t_order_item.key-generate-strategy.key-generator-name=snowflake
60-
61-
spring.shardingsphere.rules.sharding.sharding-algorithms.database-inline.type=INLINE
62-
spring.shardingsphere.rules.sharding.sharding-algorithms.database-inline.props.algorithm-expression=ds-$->{user_id % 2}
63-
spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-inline.type=INLINE
64-
spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-inline.props.algorithm-expression=t_order_$->{order_id % 2}
65-
spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-item-inline.type=INLINE
66-
spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-item-inline.props.algorithm-expression=t_order_item_$->{order_id % 2}
67-
68-
spring.shardingsphere.rules.sharding.key-generators.snowflake.type=SNOWFLAKE
69-
70-
spring.shardingsphere.rules.encrypt.encryptors.status-encryptor.type=AES
71-
spring.shardingsphere.rules.encrypt.encryptors.status-encryptor.props.aes-key-value=123456
72-
spring.shardingsphere.rules.encrypt.tables.t_order.columns.status.cipher-column=status
73-
spring.shardingsphere.rules.encrypt.tables.t_order.columns.status.encryptor-name=status-encryptor
18+
spring.datasource.driver-class-name=org.apache.shardingsphere.driver.ShardingSphereDriver
19+
spring.datasource.url=jdbc:shardingsphere:classpath:local-zookeeper-sharding-databases-tables.yaml

examples/shardingsphere-jdbc-example/single-feature-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/src/main/resources/application.properties

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
#
1717

1818
mybatis.config-location=classpath:META-INF/mybatis-config.xml
19+
# TODO Fix ShardingSphereDrive cluster mode start
20+
#spring.profiles.active=local-zookeeper-sharding-databases-tables
21+
spring.profiles.active=cloud-zookeeper-sharding-databases-tables
1922

20-
spring.profiles.active=local-zookeeper-sharding-databases-tables
2123
#spring.profiles.active=local-zookeeper-readwrite-splitting
22-
23-
#spring.profiles.active=cloud-zookeeper-sharding-databases-tables
2424
#spring.profiles.active=cloud-zookeeper-readwrite-splitting
2525

2626
#spring.profiles.active=local-zookeeper-encrypt
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to You under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
mode:
19+
type: Cluster
20+
repository:
21+
type: ZooKeeper
22+
props:
23+
namespace: demo_spring_boot_ds_encrypt
24+
server-lists: localhost:2181
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to You under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
mode:
19+
type: Cluster
20+
repository:
21+
type: ZooKeeper
22+
props:
23+
namespace: demo_spring_boot_readwrite_ds
24+
server-lists: localhost:2181
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to You under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
mode:
19+
type: Cluster
20+
repository:
21+
type: ZooKeeper
22+
props:
23+
namespace: demo_spring_boot_ds_shadow
24+
server-lists: localhost:2181
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to You under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
mode:
19+
type: Cluster
20+
repository:
21+
type: ZooKeeper
22+
props:
23+
namespace: demo_spring_boot_ds_sharding
24+
server-lists: localhost:2181
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to You under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
mode:
19+
type: Cluster
20+
repository:
21+
type: ZooKeeper
22+
props:
23+
namespace: demo_spring_boot_ds_encrypt
24+
server-lists: localhost:2181
25+
26+
dataSources:
27+
ds_encrypt:
28+
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
29+
driverClassName: com.mysql.jdbc.Driver
30+
jdbcUrl: jdbc:mysql://localhost:3306/demo_ds?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
31+
username: root
32+
password:
33+
34+
rules:
35+
- !ENCRYPT
36+
tables:
37+
t_order:
38+
columns:
39+
status:
40+
cipherColumn: status
41+
encryptorName: status_encryptor
42+
encryptors:
43+
status_encryptor:
44+
type: AES
45+
props:
46+
aes-key-value: 123456
47+
48+
props:
49+
queryWithCipherColumn: true
50+
sql-show: true

0 commit comments

Comments
 (0)