[root@crontrol7 ~]# rbd snap unprotect mysql --snap mysql-snap1
第二步:删除镜像下面的所有快照
用rbd snap purge进行删除所有镜像的快照
[root@crontrol7 ~]# rbd snap purge mysql
Removing all snapshots: 100% complete...done.
尝试再删除镜像
[root@crontrol7 ~]# rbd rm mysql
2022-11-28 11:39:47.365860 7fbe4859fd80 -1 librbd: 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.
提示librbd: image has watchers - not removing,有人正在使用,不能进行删除
第三步:取消访问者挂载连接
查看下谁在挂载访问
[root@crontrol7 ~]# rbd status mysql
Watchers:
watcher=192.168.88.253:0/3603526388 client.4172 cookie=18446462598732840961