Merge pull request #9350 from rook/mergify/bp/release-1.8/pr-9214
pool: Update the desired failure domain when changed (backport #9214)
This commit is contained in:
6 files changed
+186
-53
No files matched your search
@@ -20,7 +20,6 @@ storage cluster.
|
||||
* [OSD CRUSH Settings](#osd-crush-settings)
|
||||
* [OSD Dedicated Network](#osd-dedicated-network)
|
||||
* [Phantom OSD Removal](#phantom-osd-removal)
|
||||
* [Change Failure Domain](#change-failure-domain)
|
||||
* [Auto Expansion of OSDs](#auto-expansion-of-osds)
|
||||
|
||||
## Prerequisites
|
||||
@@ -432,55 +431,6 @@ To recheck that the Phantom OSD was removed, re-run the following command and ch
|
||||
ceph osd tree
|
||||
```
|
||||
|
||||
## Change Failure Domain
|
||||
|
||||
In Rook, it is now possible to indicate how the default CRUSH failure domain rule must be configured in order to ensure that replicas or erasure code shards are separated across hosts, and a single host failure does not affect availability. For instance, this is an example manifest of a block pool named `replicapool` configured with a `failureDomain` set to `osd`:
|
||||
|
||||
```yaml
|
||||
apiVersion: ceph.rook.io/v1
|
||||
kind: CephBlockPool
|
||||
metadata:
|
||||
name: replicapool
|
||||
namespace: rook
|
||||
spec:
|
||||
# The failure domain will spread the replicas of the data across different failure zones
|
||||
failureDomain: osd
|
||||
...
|
||||
```
|
||||
|
||||
However, due to several reasons, we may need to change such failure domain to its other value: `host`. Unfortunately, changing it directly in the YAML manifest is not currently handled by Rook, so we need to perform the change directly using Ceph commands using the Rook tools pod, for instance:
|
||||
|
||||
```console
|
||||
ceph osd pool get replicapool crush_rule
|
||||
```
|
||||
|
||||
>```
|
||||
>crush_rule: replicapool
|
||||
>```
|
||||
|
||||
```console
|
||||
ceph osd crush rule create-replicated replicapool_host_rule default host
|
||||
```
|
||||
|
||||
Notice that the suffix `host_rule` in the name of the rule is just for clearness about the type of rule we are creating here, and can be anything else as long as it is different from the existing one. Once the new rule has been created, we simply apply it to our block pool:
|
||||
|
||||
```console
|
||||
ceph osd pool set replicapool crush_rule replicapool_host_rule
|
||||
```
|
||||
|
||||
And validate that it has been actually applied properly:
|
||||
|
||||
```console
|
||||
ceph osd pool get replicapool crush_rule
|
||||
```
|
||||
>```
|
||||
> crush_rule: replicapool_host_rule
|
||||
>```
|
||||
|
||||
If the cluster's health was `HEALTH_OK` when we performed this change, immediately, the new rule is applied to the cluster transparently without service disruption.
|
||||
|
||||
Exactly the same approach can be used to change from `host` back to `osd`.
|
||||
|
||||
## Auto Expansion of OSDs
|
||||
|
||||
### Prerequisites
|
||||
|
||||
@@ -188,7 +188,7 @@ stretched) then you will have 2 replicas per datacenter where each replica ends
|
||||
* `erasureCoded`: Settings for an erasure-coded pool. If specified, `replicated` settings must not be specified. See below for more details on [erasure coding](#erasure-coding).
|
||||
* `dataChunks`: Number of chunks to divide the original object into
|
||||
* `codingChunks`: Number of coding chunks to generate
|
||||
* `failureDomain`: The failure domain across which the data will be spread. This can be set to a value of either `osd` or `host`, with `host` being the default setting. A failure domain can also be set to a different type (e.g. `rack`), if it is added as a `location` in the [Storage Selection Settings](ceph-cluster-crd.md#storage-selection-settings).
|
||||
* `failureDomain`: The failure domain across which the data will be spread. This can be set to a value of either `osd` or `host`, with `host` being the default setting. A failure domain can also be set to a different type (e.g. `rack`), if the OSDs are created on nodes with the supported [topology labels](ceph-cluster-crd.md#osd-topology). If the `failureDomain` is changed on the pool, the operator will create a new CRUSH rule and update the pool.
|
||||
If a `replicated` pool of size `3` is configured and the `failureDomain` is set to `host`, all three copies of the replicated data will be placed on OSDs located on `3` different Ceph hosts. This case is guaranteed to tolerate a failure of two hosts without a loss of data. Similarly, a failure domain set to `osd`, can tolerate a loss of two OSD devices.
|
||||
|
||||
If erasure coding is used, the data and coding chunks are spread across the configured failure domain.
|
||||
|
||||
Reference in new issue
Block a user