In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail how to delete the giant rbd image in ceph. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
How to delete a giant rbd image
Deleting a giant rbd image can be time-consuming (long night) if you go directly through the rbd rm. However, after a try on ceph 0.87, this problem no longer exists, and the specific process is as follows:
# create a 1PB-sized block [root@osd2 ceph] # time rbd create myrbd/huge-image-s 1024000000real 0m0.353suser 0m0.016ssys 0m0.009s [root@osd2 ceph] # rbd info myrbd/huge-imagerbd image' huge-image': size 976 TB in 256000000 objects order 22 (4096 kB objects) block_name_prefix: rb.0.1489.6b8b4567 format: 1 [root@osd2 ceph] # time rbd rm myrbd/huge-imageRemoving Image: 2% complete. ^\ Quit (core dumped) real 10m24.406suser 18m58.335ssys 11m39.507s
A 1PB-sized block is created above, which may be too large, but it is still very slow to delete rbd rm directly, so the following method is used:
[root@osd2 ceph] # rados-p myrbd rm huge-image.rbd [root@osd2 ceph] # time rbd rm myrbd/huge-image2014-11-06 09 root@osd2 ceph 42.916826 7fdb4fd5a7e0-1 librbd::ImageCtx: (2) No such file or directoryRemoving image: 100% complete...done.real 0m0.192suser 0m0.012ssys 0m0.013s
Try a block the size of 1TB:
[root@osd2 ceph] # rbd create myrbd/huge-image-s 1024000 [root@osd2 ceph] # rbd info myrbd/huge-imagerbd image' huge-image': size 1000 GB in 256000 objects order 22 (4096 kB objects) block_name_prefix: rb.0.149c.6b8b4567 format: 1 [root@osd2 ceph] # time rbd rm myrbd/huge-imageRemoving image: 100 complete...done.real 0m29.418suser 0m52.467ssys 0m32.372s
So giant blocks should be deleted in the following ways:
Format 1:
[root@osd2 ceph] # rbd create myrbd/huge-image-s 1024000000 [root@osd2 ceph] # rbd info myrbd/huge-imagerbd image' huge-image': size 976 TB in 256000000 objects order 22 (4096 kB objects) block_name_prefix: rb.0.14a5.6b8b4567 format: 1 [root@osd2 ceph] # rados-p myrbd rm huge-image.rbd [root@osd2 ceph] # time rados-p myrbd ls | grep'^ rb.0.14a5.6b8b4567' | | xargs-n 200 rados-p myrbd rm [root@osd2 ceph] # time rbd rm myrbd/huge-image2014-11-06 09Partition 54 time rbd rm myrbd/huge-image2014 12.718211 7ffae55747e0-1 librbd::ImageCtx: error finding header: (2) No such file or directoryRemoving image: 100% complete...done.real 0m0.191suser 0m0.015ssys 0m0.010s |
Format 2:
[root@osd2 ceph] # rbd create myrbd/huge-image-s 1024000000-- image-format=2 [root@osd2 ceph] # rbd info myrbd/huge-imagerbd image' huge-image': size 976 TB in 256000000 objects order 22 (4096 kB objects) block_name_prefix: rbd_data.14986b8b4567 format: 2 features: layering [root@osd2 ceph] # rados-p myrbd rm rbd_id.huge-image [root@osd2 ceph] # rados-p myrbd Rm rbd_ header.14986b8b4567 [root @ osd2 ceph] # rados-p myrbd ls | grep'^ rbd_data.14986b8b4567' | xargs-n 200 rados-p myrbd rm [root@osd2 ceph] # time rbd rm myrbd/huge-image2014-11-06 09 7f6b6923c7e0 59 7f6b6923c7e0-1 librbd::ImageCtx: error finding header: (2) No such file or directoryRemoving image: 100% complete...done.real 0m0.192suser 0m0.016ssys 0m0.010s
Note that if the block is empty, do not want the xargs statement; if it is non-empty, you need it.
Therefore, if it is a block above 100TB, it is best to delete id first, and then delete it by rbd rm.
This is the end of the article on "how to delete giant rbd image in ceph". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.