Changing failure domain
Hi, I have a cephfs in production based on 2 pools (data+metadata). Data is in erasure coding with the profile : crush-failure-domain=host crush-root=default jerasure-per-chunk-alignment=false k=3 m=2 plugin=jerasure technique=reed_sol_van w=8 Metadata is in replicated mode with k=3 The crush rules are as follow : [ { "rule_id": 0, "rule_name": "replicated_rule", "ruleset": 0, "type": 1, "min_size": 1, "max_size": 10, "steps": [ { "op": "take", "item": -1, "item_name": "default" }, { "op": "chooseleaf_firstn", "num": 0, "type": "host" }, { "op": "emit" } ] }, { "rule_id": 1, "rule_name": "ec_data", "ruleset": 1, "type": 3, "min_size": 3, "max_size": 5, "steps": [ { "op": "set_chooseleaf_tries", "num": 5 }, { "op": "set_choose_tries", "num": 100 }, { "op": "take", "item": -1, "item_name": "default" }, { "op": "chooseleaf_indep", "num": 0, "type": "host" }, { "op": "emit" } ] } ] When we installed it, everything was in the same room, but know we splitted our cluster (6 servers but soon 8) in 2 rooms. Thus we updated the crushmap by adding a room layer (with ceph osd crush add-bucket room1 room etc) and move all our servers in the tree to the correct place (ceph osd crush move server1 room=room1 etc...). Now, we would like to change the rules to set a failure domain to room instead of host (to be sure that in case of disaster in one of the rooms we will still have a copy in the other). What is the best strategy to do this ? F.
Use a crush rule likes this for replica: 1) root default class XXX 2) choose 2 rooms 3) choose 2 disks That'll get you 4 OSDs in two rooms and the first 3 of these get data, the fourth will be ignored. That guarantees that losing a room will lose you at most 2 out of 3 copies. This is for disaster recovery only, it'll guarantee durability if you lose a room but not availability. 3+2 erasure coding cannot be split across two rooms in this way because, well, you need 3 out of 5 shards to survive, so you cannot lose half of them. Paul -- Paul Emmerich Looking for help with your Ceph cluster? Contact us at https://croit.io croit GmbH Freseniusstr. 31h 81247 München www.croit.io Tel: +49 89 1896585 90 On Thu, Nov 28, 2019 at 5:40 PM Francois Legrand <fleg@lpnhe.in2p3.fr> wrote:
Hi, I have a cephfs in production based on 2 pools (data+metadata).
Data is in erasure coding with the profile : crush-failure-domain=host crush-root=default jerasure-per-chunk-alignment=false k=3 m=2 plugin=jerasure technique=reed_sol_van w=8
Metadata is in replicated mode with k=3
The crush rules are as follow : [ { "rule_id": 0, "rule_name": "replicated_rule", "ruleset": 0, "type": 1, "min_size": 1, "max_size": 10, "steps": [ { "op": "take", "item": -1, "item_name": "default" }, { "op": "chooseleaf_firstn", "num": 0, "type": "host" }, { "op": "emit" } ] }, { "rule_id": 1, "rule_name": "ec_data", "ruleset": 1, "type": 3, "min_size": 3, "max_size": 5, "steps": [ { "op": "set_chooseleaf_tries", "num": 5 }, { "op": "set_choose_tries", "num": 100 }, { "op": "take", "item": -1, "item_name": "default" }, { "op": "chooseleaf_indep", "num": 0, "type": "host" }, { "op": "emit" } ] } ]
When we installed it, everything was in the same room, but know we splitted our cluster (6 servers but soon 8) in 2 rooms. Thus we updated the crushmap by adding a room layer (with ceph osd crush add-bucket room1 room etc) and move all our servers in the tree to the correct place (ceph osd crush move server1 room=room1 etc...).
Now, we would like to change the rules to set a failure domain to room instead of host (to be sure that in case of disaster in one of the rooms we will still have a copy in the other).
What is the best strategy to do this ?
F.
_______________________________________________ ceph-users mailing list -- ceph-users@ceph.io To unsubscribe send an email to ceph-users-leave@ceph.io
Thanks. For replica, what is the best way to change crush profile ? Is it to create a new replica profile, and set this profile as crush rulest for the pool (something like ceph osd pool set {pool-name} crush_ruleset my_new_rule) ? For erasure coding, I would thus have to change the profile at least to k=3, m=3 (for now I only have 6 osd servers). But if I am correct, this cannot be changed for an existing pool and I will have to create a new pool and migrate all data from the current one to the new one. Is that correct ? F. Le 28/11/2019 à 17:51, Paul Emmerich a écrit :
Use a crush rule likes this for replica:
1) root default class XXX 2) choose 2 rooms 3) choose 2 disks
That'll get you 4 OSDs in two rooms and the first 3 of these get data, the fourth will be ignored. That guarantees that losing a room will lose you at most 2 out of 3 copies. This is for disaster recovery only, it'll guarantee durability if you lose a room but not availability.
3+2 erasure coding cannot be split across two rooms in this way because, well, you need 3 out of 5 shards to survive, so you cannot lose half of them.
Paul
On 12/2/19 5:56 PM, Francois Legrand wrote:
For replica, what is the best way to change crush profile ? Is it to create a new replica profile, and set this profile as crush rulest for the pool (something like ceph osd pool set {pool-name} crush_ruleset my_new_rule) ?
Indeed. Then you can delete/do what you want with old crush rule. k
Thanks for you advices. I thus created a new replica profile : { "rule_id": 2, "rule_name": "replicated3over2rooms", "ruleset": 2, "type": 1, "min_size": 3, "max_size": 4, "steps": [ { "op": "take", "item": -1, "item_name": "default" }, { "op": "choose_firstn", "num": 0, "type": "room" }, { "op": "chooseleaf_firstn", "num": 2, "type": "host" }, # et c'est fini { "op": "emit" } ] } It works well. Now I am concerned by the pool in erasure coding. The point is that it's the data pool for cephfs (the metadata is in replica 3 and now replicated over our two rooms). For now, the data pool for cephfs is in *erasure coding k=3, m=2* (at the creation of the cluster we had only 5 osd servers). As noticed befors by Paul Emmerich, this cannot be redundantly splitted over 2 rooms (as 3 chunks are required to reconstruct the datas). Now, we have 6 OSD servers, and soon it will be 7, thus I was thinking to create a new pool (eg. k=4, m=2 or k=3, m=3) and a rule to split the chunks over our 2 rooms and to use this new pool as cache tier to migrate softly all the datas from the old pool to the new one. But according to https://documentation.suse.com/ses/6/html/ses-all/ceph-pools.html#pool-migra... "You can use the cache tier method to migrate from a replicated pool to either an erasure coded or another replicated pool. Migrating from an erasure coded pool is not supported." Warning: You Cannot Migrate RBD Images and CephFS Exports to an EC Pool You cannot migrate RBD images and CephFS exports from a replicated pool to an EC pool. EC pools can store data but not metadata. The header object of the RBD will fail to be flushed. The same applies for CephFS. Thus my question is *how can I migrate a data pool in EC of a cephfs to another EC pool ?* Thanks for your advices. F. Le 03/12/2019 à 04:07, Konstantin Shalygin a écrit :
On 12/2/19 5:56 PM, Francois Legrand wrote:
For replica, what is the best way to change crush profile ? Is it to create a new replica profile, and set this profile as crush rulest for the pool (something like ceph osd pool set {pool-name} crush_ruleset my_new_rule) ?
Indeed. Then you can delete/do what you want with old crush rule.
k
On 12/19/19 10:22 PM, Francois Legrand wrote:
Thus my question is *how can I migrate a data pool in EC of a cephfs to another EC pool ?*
I suggest this: # create you new ec pool # `ceph osd pool application enable ec_new cephfs` # `ceph fs add_data_pool cephfs ec_new` # `setfattr -n ceph.dir.layout -v pool=ec_new /cephfs/ec_migration` And then copy your content via userland tools. k
Thanks again for your answer. I still have few questions before going on. It seems that some metadata should remains on the original data pool, preventing it's deletion (http://ceph.com/geen-categorie/ceph-pool-migration/ and https://www.spinics.net/lists/ceph-users/msg41374.html). Thus does doing a cp and then a rm of the original files (instead of mv) allows to get rid of the remaining metadata in the original data pool ? Is it then possible to remove the original pool after migration (and how, because I guess that I have to define before the default location for data to the new pool) ? How snapshots are affected (do I have to remove all of them before the operation) ? Happy new year. F. Le 24/12/2019 à 03:53, Konstantin Shalygin a écrit :
On 12/19/19 10:22 PM, Francois Legrand wrote:
Thus my question is *how can I migrate a data pool in EC of a cephfs to another EC pool ?*
I suggest this:
# create you new ec pool
# `ceph osd pool application enable ec_new cephfs`
# `ceph fs add_data_pool cephfs ec_new`
# `setfattr -n ceph.dir.layout -v pool=ec_new /cephfs/ec_migration`
And then copy your content via userland tools.
k
On 1/6/20 5:50 PM, Francois Legrand wrote:
I still have few questions before going on. It seems that some metadata should remains on the original data pool, preventing it's deletion (http://ceph.com/geen-categorie/ceph-pool-migration/ and https://www.spinics.net/lists/ceph-users/msg41374.html). Thus does doing a cp and then a rm of the original files (instead of mv) allows to get rid of the remaining metadata in the original data pool ? Is it then possible to remove the original pool after migration (and how, because I guess that I have to define before the default location for data to the new pool) ? How snapshots are affected (do I have to remove all of them before the operation) ?
Why you need to remove cephfs_meta pool? k
I don't want to remove cephfs_meta pool but cephfs_datapool. To be clear : I have now cephfs consisting of a cephfs_metapool and a cephfs_datapool. I want to add a new data pool cephfs_datapool2, migrate all data from cephfs_datapool to cephfs_datapool2 and then remove the original cephfs_datapool. My goal is to end with a cephfs with cephfs_meta and cephfs_datapool2 (i.e replace the original cephfs_datapool by cephfs_datapool2). But from what I've seen, there should be also some "metadata" in the cephfs_datapool (it sounds weird to me) which should remains after moving objects and prevent its deletion. F. Le 14/01/2020 à 07:54, Konstantin Shalygin a écrit :
On 1/6/20 5:50 PM, Francois Legrand wrote:
I still have few questions before going on. It seems that some metadata should remains on the original data pool, preventing it's deletion (http://ceph.com/geen-categorie/ceph-pool-migration/ and https://www.spinics.net/lists/ceph-users/msg41374.html). Thus does doing a cp and then a rm of the original files (instead of mv) allows to get rid of the remaining metadata in the original data pool ? Is it then possible to remove the original pool after migration (and how, because I guess that I have to define before the default location for data to the new pool) ? How snapshots are affected (do I have to remove all of them before the operation) ?
Why you need to remove cephfs_meta pool?
k
On 1/14/20 5:42 PM, Francois Legrand wrote:
I don't want to remove cephfs_meta pool but cephfs_datapool. To be clear : I have now cephfs consisting of a cephfs_metapool and a cephfs_datapool. I want to add a new data pool cephfs_datapool2, migrate all data from cephfs_datapool to cephfs_datapool2 and then remove the original cephfs_datapool. My goal is to end with a cephfs with cephfs_meta and cephfs_datapool2 (i.e replace the original cephfs_datapool by cephfs_datapool2).
Correct.
But from what I've seen, there should be also some "metadata" in the cephfs_datapool (it sounds weird to me) which should remains after moving objects and prevent its deletion.
cephfs is metadata_pool + one or many data pools. After you move your data to another layout (cephfs_datapool2), your cephfs_datapool will be empty, but you can't delete this, doc says: """ This command removes the specified pool from the list of data pools for the file system. If any files have layouts for the removed data pool, the file data will become unavailable. The default data pool (when creating the file system) cannot be removed. """ May be this outdated, in this case `ceph fs rm_data_pool <fsname> cephfs_datapool` will do. k
Hi Francois, I'm afraid that you need more rooms to have such availability. For data pool, you will need 5 rooms due to your 3+2 erasure profile and for metadata you will need 3 rooms due to your 3 replication rule. If you have only 2 rooms, there is possibility of corrupted data whenever you lost 1 of 2 rooms, erasure is distributing the chunk, not the copy. For metadata, the worst scenario is inactive PG if the room with 2 replicas is lost. Best regards,
participants (4)
-
Francois Legrand
-
Konstantin Shalygin
-
mrxlazuardin@gmail.com
-
Paul Emmerich