【rbd 删除失败】rbd: error: image still has watchers
背景
?執行rbd 刪除操作,發現RBD被占用,但又不知道被誰占用,如何查詢呢?
rbd rm sfs_pool/pgsql+ rbd rm sfs_pool/pgsql
2021-05-06 09:24:57.831 7fb0057fa700 -1 librbd::image::PreRemoveRequest: 0x55733d13d2a0 check_image_watchers: image has watchers - not removing
Removing image: 0% complete...failed.
rbd: error: image still has watchers
This means the image is still open or the client using it crashed. Try again after closing/unmapping it or waiting 30s for the crashed client to timeout.
?解決辦法
(1)查看rbd信息
rbd info sfs_pool/pgsql
# rbd info sfs_pool/pgsql
rbd image 'pgsql':
? ? ? ? size 10 GiB in 2560 objects
? ? ? ? order 22 (4 MiB objects)
? ? ? ? snapshot_count: 0
? ? ? ? id: 42c7dcd2590f1f
? ? ? ? block_name_prefix: rbd_data.42c7dcd2590f1f
? ? ? ? format: 2
? ? ? ? features: layering
? ? ? ? op_features:?
? ? ? ? flags:?
? ? ? ? create_timestamp: Wed Apr 21 10:00:30 2021
? ? ? ? access_timestamp: Wed Apr 21 10:00:30 2021
? ? ? ? modify_timestamp: Wed Apr 21 10:00:30 2021
(2)查看watchers
rados -p sfs_pool listwatchers rbd_header.42c7dcd2590f1f?其中?sfs_pool 是池子名稱,42c7dcd2590f1f是上一步查出的ID
watcher=11.50.135.132:0/2286887345 client.4376119 cookie=18446462598732841092
(3)登錄到11.50.135.132這個節點,把rbd unmap掉
()
?(4)再次查詢
rados -p sfs_pool listwatchers rbd_header.42c7dcd2590f1f此時沒有任何輸出了
(5)再次執行
rbd rm sfs_pool/pgsql+ rbd rm sfs_pool/pgsql
Removing image: 100% complete...done.
結果驗證
執行命令
rbd ls sfs_pool | grep pgsql其中pgsql為image名稱
執行該命令,找不到該rbd,認為刪除成功
總結
以上是生活随笔為你收集整理的【rbd 删除失败】rbd: error: image still has watchers的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Ubuntu20.04上安装部署Elas
- 下一篇: 虚拟机从暂停状态恢复后HEALTH_WA