DB Discovery
Resource Operation
ADD RESOURCE ds_0 (
HOST=127.0.0.1,
PORT=3306,
DB=ds_0,
USER=root,
PASSWORD=root
),RESOURCE ds_1 (
HOST=127.0.0.1,
PORT=3306,
DB=ds_1,
USER=root,
PASSWORD=root
),RESOURCE ds_2 (
HOST=127.0.0.1,
PORT=3306,
DB=ds_2,
USER=root,
PASSWORD=root
);
Rule Operation
- Create DB discovery rule
CREATE DB_DISCOVERY RULE ha_group_0 (
RESOURCES(ds_0, ds_1),
TYPE(NAME=mgr,PROPERTIES('group-name'='92504d5b-6dec')),
HEARTBEAT(PROPERTIES('keep-alive-cron'='0/5 * * * * ?'))
);
- Alter DB discovery rule
ALTER DB_DISCOVERY RULE ha_group_0 (
RESOURCES(ds_0, ds_1, ds_2),
TYPE(NAME=mgr,PROPERTIES('group-name'='92504d5b-6dec')),
HEARTBEAT(PROPERTIES('keep-alive-cron'='0/5 * * * * ?'))
);
- Drop db_discovery rule
DROP DB_DISCOVERY RULE ha_group_0;
- Drop db_discovery type
DROP DB_DISCOVERY TYPE ha_group_0_mgr;
- Drop db_discovery heartbeat
DROP DB_DISCOVERY HEARTBEAT ha_group_0_heartbeat;
- Drop resource
DROP RESOURCE ds_0,ds_1,ds_2;
- Drop distributed database
DROP DATABASE discovery_db;
当前内容版权归 ShardingSphere 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 ShardingSphere .