使用ALTER RANGE
之后,貌似location_labels
并没有生效,各节点数据量趋于平均,F区节点加起来是4T,而其他两个区加起来是2.9T。
创建的
Placement Policy
是:
mysql> SHOW CREATE PLACEMENT POLICY `evict_sata_dw`;
+---------------+--------------------------------------------------------------------------------------+
| Policy | Create Policy |
+---------------+--------------------------------------------------------------------------------------+
| evict_sata_dw | CREATE PLACEMENT POLICY `evict_sata_dw` CONSTRAINTS="[-disk=sata-new, -disk=dw-ssd]" |
+---------------+--------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> SHOW PLACEMENT where Target like '%GLOBAL%';
+-------------------+----------------------------------------------+------------------+
| Target | Placement | Scheduling_State |
+-------------------+----------------------------------------------+------------------+
| RANGE TiDB_GLOBAL | CONSTRAINTS="[-disk=sata-new, -disk=dw-ssd]" | SCHEDULED |
+-------------------+----------------------------------------------+------------------+
1 row in set (23.21 sec)
mysql>
PD对应的Placement rule
是:
root@prod-dw-tipd6-f001:~# tiup ctl:v7.5.1 pd config placement-rules rule-bundle get pd
Starting component ctl: /root/.tiup/components/ctl/v7.5.1/ctl pd config placement-rules rule-bundle get pd
{
"group_id": "pd",
"group_index": 0,
"group_override": false,
"rules": [
{
"group_id": "pd",
"id": "default",
"start_key": "",
"end_key": "",
"role": "voter",
"is_witness": false,
"count": 3,
"location_labels": [
"zone",
"dc",
"host"
],
"version": 1
}
]
}
root@prod-dw-tipd6-f001:~# tiup ctl:v7.5.1 pd config placement-rules rule-bundle get TiDB_GLOBAL
Starting component ctl: /root/.tiup/components/ctl/v7.5.1/ctl pd config placement-rules rule-bundle get TiDB_GLOBAL
{
"group_id": "TiDB_GLOBAL",
"group_index": 20,
"group_override": true,
"rules": [
{
"group_id": "TiDB_GLOBAL",
"id": "evict_sata_dw_rule_0",
"start_key": "",
"end_key": "",
"role": "voter",
"is_witness": false,
"count": 3,
"label_constraints": [
{
"key": "disk",
"op": "notIn",
"values": [
"sata-new"
]
},
{
"key": "disk",
"op": "notIn",
"values": [
"dw-ssd"
]
},
{
"key": "engine",
"op": "notIn",
"values": [
"tiflash"
]
}
],
"create_timestamp": 1710164464
}
]
}