wangkang09 commented on issue #10105:
URL:
https://github.com/apache/shardingsphere/issues/10105#issuecomment-826065971
> Hi 5.0.0-alpha has been released for a long time. Maybe you have no
interests on Scaling etc. But this issue was fixed from 5.x release.
i use 5.0.0-alpha. it has this problem too.
```yaml
spring:
shardingsphere:
datasource:
names: db0,db1,db0-slave,db1-slave
common:
type: com.alibaba.druid.pool.DruidDataSource
username: sa
password: ""
initialSize: 5
minIdle: 5
maxActive: 500
maxWait: 60000
timeBetweenEvictionRunsMillis: 20000
minEvictableIdleTimeMillis: 200000
maxEvictableIdleTimeMillis: 200000
db0:
url: jdbc:h2:mem:db0;DB_CLOSE_ON_EXIT=FALSE;database_to_upper=false
db0-slave:
url:
jdbc:h2:mem:db0-slave;DB_CLOSE_ON_EXIT=FALSE;database_to_upper=false
db1:
url: jdbc:h2:mem:db1;DB_CLOSE_ON_EXIT=FALSE;database_to_upper=false
db1-slave:
url:
jdbc:h2:mem:db1-slave;DB_CLOSE_ON_EXIT=FALSE;database_to_upper=false
rules:
sharding:
tables:
rs_order:
actual-data-nodes:
db0.rs_order_0,db0.rs_order_2,db1.rs_order_1,db1.rs_order_3
rs_order_hint:
actual-data-nodes:
db0.rs_order_0,db0.rs_order_2,db1.rs_order_1,db1.rs_order_3
table-strategy:
complex:
sharding-columns: member_id,billno
sharding-algorithm-name: table-hint
database-strategy:
complex:
sharding-columns: member_id,billno
sharding-algorithm-name: db-hint
default-database-strategy:
complex:
sharding-columns: member_id,billno
sharding-algorithm-name: db-complex
default-table-strategy:
complex:
sharding-columns: member_id,billno
sharding-algorithm-name: table-complex
default-key-generate-strategy:
column: id
key-generator-name: rs-order-generator
#sharding 中的 key generator 配置
key-generators:
# rs-order-generator 为 generator 的名字。供上面的 key-generator-name 使用
rs-order-generator:
type: DbSnowflakeKeyGenerator
props:
key.snow.type: rs_order # 传入 DbSnowflakeKeyGenerator 对应的
generator 实例
sharding-algorithms:
table-complex:
type: tableComplex
props:
xx: xx # https://github.com/apache/shardingsphere/pull/8331
db-complex:
type: dbComplex
props:
xx: xx
table-hint:
type: tableHint
props:
xx: xx
db-hint:
type: dbHint
props:
xx: xx
replica-query:
data-sources:
db0:
primary-data-source-name: db0
replica-data-source-names: db0-slave
load-balancer-name: round-robin
db1:
primary-data-source-name: db1
replica-data-source-names: db1-slave
load-balancer-name: round-robin
load-balancers:
round-robin:
type: ROUND_ROBIN
props:
xx: xx # https://github.com/apache/shardingsphere/pull/8331
encrypt:
tables:
rs_order:
columns:
email:
plain-column: email_plain
cipher-column: email
assisted-query-column: email_hash
encryptor-name: my-aes
encryptors:
my-aes:
type: my-AssistQuery
props:
business-key: 'privateDWK'
my-aes1:
type: my-AssistQuery
props:
business-key: 'privateDWK'
# shadow:
# column: shadow
# source-data-source-names: db0,db1
# shadow-data-source-names: db0-shadow,db1-shadow
props:
sql-show: true
query-with-cipher-column: true # 是否使用密文查询
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]