方便更快捷的说明问题,可以按需填写(可删除)
使用环境:
sharding-proxy 5.1.1
场景、问题:
设置多个DB_DISCOVERY 只有1个生效
rules:
- !DB_DISCOVERY
dataSources:
ds_0:
dataSourceNames:
- ds_01
- ds_02
discoveryHeartbeatName: replication_delay_heartbeat_0
discoveryTypeName: replication_delay_0
discoveryHeartbeats:
replication_delay_heartbeat_0:
props:
keep-alive-cron: '0/1 * * * * ?'
discoveryTypes:
replication_delay_0:
type: SHOW_SLAVE_STATUS
props:
delay-milliseconds-threshold: 10000
- !DB_DISCOVERY
dataSources:
ds_1:
dataSourceNames:
- ds_11
- ds_12
discoveryHeartbeatName: replication_delay_heartbeat_1
discoveryTypeName: replication_delay_1
discoveryHeartbeats:
replication_delay_heartbeat_1:
props:
keep-alive-cron: '0/1 * * * * ?'
discoveryTypes:
replication_delay_1:
type: SHOW_SLAVE_STATUS
props:
delay-milliseconds-threshold: 10000
启动后查看只有1个生效:
mysql> SHOW DB_DISCOVERY RULES\G
*************************** 1. row ***************************
group_name: ds_0
data_source_names: ds_01,ds_02
primary_data_source_name: ds_01
discovery_type: {name=replication_delay_0, type=SHOW_SLAVE_STATUS, props={delay-milliseconds-threshold=10000.0}}
discovery_heartbeat: {name=replication_delay_heartbeat_0, props={keep-alive-cron=0/1 * * * * ?}}
1 row in set (0.01 sec)
请问多个db discovery该如何配置呢?