Skip to content

Commit 7aac0f4

Browse files
hammerheadamotl
authored andcommitted
Scale: Inform about CrateDB 5.9.0's cluster-wide allocation rules
In CrateDB 5.9.0 or higher, you don't need to change shard allocations for each individual table any longer. Instead, default allocation rules can be set on the cluster level: > [CrateDB 5.9.0] added support to override `routing.allocation.*` cluster > settings with a `routing.allocation.*` table setting. This can be used to > define the default routing behavior for all tables with a cluster setting > and reroute individual tables by assigning the table setting using `ALTER > TABLE SET`.
1 parent f3298e4 commit 7aac0f4

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

docs/admin/clustering/scale/demand.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,22 @@ We want to make sure that the addition of the temporary nodes does not result on
4848

4949
We will be able to identify the new nodes by using a custom attribute (`node.attr.storage=temporarynodes`) (see further down for details on how to configure this), so the first step is to configure the existing partitions so that they do not consider the new nodes as suitable targets for shard allocation.
5050

51-
In CrateDB 5.1.2 or higher we can achieve this with:
52-
51+
In CrateDB 5.1.2 or higher, you can achieve this with:
5352
```sql
5453
/* this applies the setting to all existing partitions and new partitions */
5554
ALTER TABLE test SET ("routing.allocation.exclude.storage" = 'temporarynodes');
5655

5756
/* then we run this other command so that the setting does not apply to new partitions */
5857
ALTER TABLE ONLY test RESET ("routing.allocation.exclude.storage");
5958
```
59+
In CrateDB 5.9.0 or higher, you don't need to change shard allocations for each
60+
individual table any longer. Instead, default allocation rules can be set on
61+
the cluster level:
62+
> [CrateDB 5.9.0] added support to override `routing.allocation.*` cluster
63+
> settings with a `routing.allocation.*` table setting. This can be used to
64+
> define the default routing behavior for all tables with a cluster setting
65+
> and reroute individual tables by assigning the table setting using `ALTER
66+
> TABLE SET`.
6067
6168
No data gets reallocated when running this, and there is no impact on querying or ingestion.
6269

@@ -161,8 +168,7 @@ INSERT INTO test (ts) VALUES ('2022-12-19'), ('2022-12-20');
161168

162169
When we are ready to decommission the temporary nodes, we need to move the data collected during the days of the event.
163170

164-
In CrateDB 5.1.2 or higher we can achieve this with:
165-
171+
In CrateDB 5.1.2 or higher, you can achieve this with:
166172
```sql
167173
ALTER TABLE test SET ("routing.allocation.exclude.storage" = 'temporarynodes');
168174
ALTER TABLE test RESET ("routing.allocation.total_shards_per_node");
@@ -185,4 +191,5 @@ Once this is done, the machines can safely be shutdown.
185191
If desired, new nodes can be deployed reusing the same names that were used for the temporary nodes before.
186192

187193

194+
[CrateDB 5.9.0]: https://cratedb.com/docs/crate/reference/en/latest/appendices/release-notes/5.9.0.html
188195
[shard allocation filtering]: inv:crate-reference#ddl_shard_allocation

0 commit comments

Comments
 (0)