Skip to content

Commit

Permalink
Scale: Inform about CrateDB 5.9.0's cluster-wide allocation rules
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
hammerhead authored and amotl committed Nov 28, 2024
1 parent 4e6f5a4 commit 8f9a86c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions docs/admin/clustering/scale/demand.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,18 @@ INSERT INTO test (ts) VALUES ('2022-12-19'), ('2022-12-20');

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

In CrateDB 5.1.2 or higher we can achieve this with:

In CrateDB 5.1.2 or higher, you can achieve this with:
```sql
ALTER TABLE test SET ("routing.allocation.exclude.storage" = 'temporarynodes');
ALTER TABLE test RESET ("routing.allocation.total_shards_per_node");
```
In CrateDB 5.9.0 or higher, you don't need to change allocation for every single
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`.
The data movement takes place one replica at a time and there is no impact on querying of the event’s data while it is being moved, new data also continues to flow to the baseline nodes and its ingestion and querying are also not impacted.

Expand All @@ -185,4 +191,5 @@ Once this is done, the machines can safely be shutdown.
If desired, new nodes can be deployed reusing the same names that were used for the temporary nodes before.


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

0 comments on commit 8f9a86c

Please sign in to comment.