-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Administration: Add section about "scaling clusters up and down"
- Loading branch information
1 parent
672e483
commit 66f95aa
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
(scaling-clusters)= | ||
|
||
# Scaling Clusters Up and Down | ||
|
||
The article about [scaling CrateDB clusters up and down to cope with peaks in | ||
demand] shares knowledge about the [shard allocation filtering] feature of | ||
CrateDB, and demonstrates how it is applied in a real-world data management | ||
scenario. | ||
|
||
Prepare adding extra nodes to the database cluster. | ||
```sql | ||
/* Apply routing setting to all existing partitions and new partitions. */ | ||
ALTER TABLE test SET ("routing.allocation.exclude.storage" = 'temporarynodes'); | ||
|
||
/* Configure the setting to be excluded / not applied to _new_ partitions. */ | ||
ALTER TABLE ONLY test RESET ("routing.allocation.exclude.storage"); | ||
``` | ||
|
||
Before the high-demand event, properly configure table routing accordingly. | ||
```sql | ||
ALTER TABLE ONLY test SET ("routing.allocation.total_shards_per_node" = 2); | ||
``` | ||
|
||
Before decommissioning extra database nodes, you need to move the newly allocated | ||
data back to the main nodes. | ||
```sql | ||
-- Move the collected data off the extra nodes. | ||
ALTER TABLE test SET ("routing.allocation.exclude.storage" = 'temporarynodes'); | ||
ALTER TABLE test RESET ("routing.allocation.total_shards_per_node"); | ||
|
||
-- Invoke the decommissioning. | ||
ALTER CLUSTER DECOMMISSION 'nodename'; | ||
``` | ||
|
||
|
||
[scaling CrateDB clusters up and down to cope with peaks in demand]: https://community.cratedb.com/t/scaling-cratedb-clusters-up-and-down-to-cope-with-peaks-in-demand/1314 | ||
[shard allocation filtering]: inv:crate-reference#ddl_shard_allocation |