使用环境:
sharding-proxy 5.1.1
场景、问题:
mysql> use database_discovery_db
Database changed
mysql> show DB_DISCOVERY TYPEs;
+---------------------+-------------------+--------------------------------------+
| name | type | props |
+---------------------+-------------------+--------------------------------------+
| replication_delay_0 | SHOW_SLAVE_STATUS | {delay-milliseconds-threshold=10000} |
| replication_delay_1 | SHOW_SLAVE_STATUS | {delay-milliseconds-threshold=10000} |
+---------------------+-------------------+--------------------------------------+
2 rows in set (0.01 sec)
mysql> show DB_DISCOVERY HEARTBEATs;
+-------------------------------+---------------------------------+
| name | props |
+-------------------------------+---------------------------------+
| replication_delay_heartbeat_0 | {keep-alive-cron=0/1 * * * * ?} |
| replication_delay_heartbeat_1 | {keep-alive-cron=0/1 * * * * ?} |
+-------------------------------+---------------------------------+
2 rows in set (0.00 sec)
mysql> CREATE DB_DISCOVERY RULE ds_1 (
-> RESOURCES(ds_11,ds_12),
-> TYPE=replication_delay_1,
-> HEARTBEAT=replication_delay_heartbeat_1
-> );
ERROR 1115 (C1115): Sharding algorithms `[replication_delay_1, replication_delay_heartbeat_1]` do not exist in schema `database discovery`.
报错很奇怪:
- 未设置sharding算法及规则(当前只做db discovery及读写分离测试),但是报错提示 Sharding algorithms 错误
- schema
database discovery
,我实际的schema是 database_discovery_db