Minn Fong
05/02/2026, 2:50 AMRocky
05/02/2026, 2:50 AMsql
-- Repeat for each BE in your target group
ALTER SYSTEM MODIFY BACKEND "172.xx.xx.46:9050" SET ("labels.location" = "group:high_perf");
ALTER SYSTEM MODIFY BACKEND "172.xx.xx.47:9050" SET ("labels.location" = "group:high_perf");
ALTER SYSTEM MODIFY BACKEND "172.xx.xx.48:9050" SET ("labels.location" = "group:high_perf");
Step 2: Create or Modify the Primary Key Table
When creating the table, use the labels.location property to tell StarRocks to only place replicas on nodes with that specific label.
At Table Creation:
sql
CREATE TABLE pk_table_restricted (
id BIGINT NOT NULL,
name STRING,
value INT
) PRIMARY KEY (id)
DISTRIBUTED BY HASH(id)
PROPERTIES (
"labels.location" = "group:high_perf",
"replication_num" = "3"
);
For an Existing Table:
If the table already exists, you can alter it. StarRocks will gradually migrate the tablets to the nodes matching the label.
sql
ALTER TABLE pk_table_restricted SET ("labels.location" = "group:high_perf");
Important Considerations:
* Replication Count: Ensure the number of BEs with the specified label is greater than or equal to your replication_num. If there aren't enough nodes in that group, the system may place replicas on other nodes to satisfy the high-availability requirement.
* Version: This feature specifically requires v3.2.8 or later.
* Shared-Data vs Shared-Nothing: This configuration primarily affects where the data replicas/tablets are stored and processed in a Shared-Nothing architecture. In a Shared-Data (Cloud Native) architecture, compute is typically managed via Compute Nodes (CN) and Warehouse isolation, though similar concepts for local cache affinity exist.
If you are using an older version, the primary way to influence placement is through Colocation Groups (which ensures related tables are on the same nodes but doesn't strictly "lock" them to specific nodes) or by using different StarRocks clusters for complete isolation.
References
• administration/management/resource_management/be_label.md
• faq/resource_isolation_faq.md
• administration/management/resource_management/resource_group.md