forked from canonical/microceph
-
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.
Added support to perform cluster promotion/demotion
Signed-off-by: Utkarsh Bhatt <[email protected]>
- Loading branch information
1 parent
38f0840
commit 94ae9b5
Showing
18 changed files
with
648 additions
and
32 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,71 @@ | ||
============================================= | ||
Perform failover for replicated RBD resources | ||
============================================= | ||
|
||
In case of a disaster, all replicated RBD pools can be failed over to a non-primary remote. | ||
|
||
An operator can perform promotion on a non-primary cluster, this will inturn promote all replicated rbd | ||
images in all rbd pools and make them primary. This enables them to be consumed by vms and other workloads. | ||
|
||
Prerequisites | ||
-------------- | ||
1. A primary and a secondary MicroCeph cluster, for example named "primary_cluster" and "secondary_cluster" | ||
2. primary_cluster has imported configurations from secondary_cluster and vice versa. refer to :doc:`import remote <./import-remote-cluster>` | ||
3. RBD remote replication is configured for atleast 1 rbd image. refer to :doc:`configure rbd replication <./configure-rbd-mirroring>` | ||
|
||
Failover to a non-primary remote cluster | ||
----------------------------------------- | ||
List all the resources on 'secondary_cluster' to check primary status. | ||
|
||
.. code-block:: none | ||
sudo microceph remote replication rbd list | ||
+-----------+------------+------------+---------------------+ | ||
| POOL NAME | IMAGE NAME | IS PRIMARY | LAST LOCAL UPDATE | | ||
+-----------+------------+------------+---------------------+ | ||
| pool_one | image_one | false | 2024-10-14 09:03:17 | | ||
| pool_one | image_two | false | 2024-10-14 09:03:17 | | ||
+-----------+------------+------------+---------------------+ | ||
An operator can perform cluster wide promotion as follows: | ||
|
||
.. code-block:: none | ||
sudo microceph remote replication rbd promote --remote primary_cluster --force | ||
Here, <remote> paramter helps microceph filter the resources to promote. | ||
|
||
Verify RBD remote replication primary status | ||
--------------------------------------------- | ||
|
||
List all the resources on 'secondary_cluster' again to check primary status. | ||
|
||
.. code-block:: none | ||
sudo microceph remote replication rbd status pool_one | ||
+-----------+------------+------------+---------------------+ | ||
| POOL NAME | IMAGE NAME | IS PRIMARY | LAST LOCAL UPDATE | | ||
+-----------+------------+------------+---------------------+ | ||
| pool_one | image_one | true | 2024-10-14 09:06:12 | | ||
| pool_one | image_two | true | 2024-10-14 09:06:12 | | ||
+-----------+------------+------------+---------------------+ | ||
The status shows that there are 2 replicated images and both of them are now primary. | ||
|
||
Failback to old primary | ||
------------------------ | ||
|
||
Once the disaster struck cluster (primary_cluster) is back online the RBD resources | ||
can be failed back to it, but, by this time the RBD images at the current primary (secondary_cluster) | ||
would have diverged from primary_cluster. Thus, to have a clean sync, the operator must decide | ||
which cluster would be demoted to the non-primary status. This cluster will then receive the | ||
RBD mirror updates from the standing primary. | ||
|
||
Note: Demotion can cause data loss and hence can only be performed with the 'force' flag. | ||
|
||
At primary_cluster (was primary before disaster), perform demotion. | ||
.. code-block:: none | ||
sudo microceph remote replication rbd demote | ||
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
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
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
Oops, something went wrong.