ceph问题汇总
1. 删除镜像报错
- 问题:
[root@node192 ~]# rbd rm root-cloud-disk-pool/bca27ff128a84259916934c62c325ff8 2021-08-13T14:35:25.440+0800 7f510ffff700 -1 librbd::image::PreRemoveRequest: 0x55d38c13fc10 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.
- 解决方法:
# 查询镜像状态 [root@node192 ~]# rbd status root-cloud-disk-pool/bca27ff128a84259916934c62c325ff8 Watchers: watcher=192.168.20.82:0/67575850 client.6327506 cookie=94443994869248 # 将该残留的watch信息添加到osd的黑名单 [root@node192 ~]# ceph osd blacklist add 192.168.20.82:0/67575850 blacklisting 192.168.20.82:0/67575850 until 2021-08-13T15:37:09.447761+0800 (3600 sec) # 再查看watch是否存在 [root@node192 ~]# rbd status root-cloud-disk-pool/bca27ff128a84259916934c62c325ff8 Watchers: none # 删除镜像 [root@node192 ~]# rbd rm root-cloud-disk-pool/bca27ff128a84259916934c62c325ff8
2. 删除存储池报错
-
问题:
$ ceph osd pool delete cephrbd cephrbd --yes-i-really-really-mean-it Error EPERM: pool deletion is disabled; you must first set the mon_allow_pool_delete config\n option to true before you can destroy a pool
-
解决方法
# 1、修改各 mon 节点配置文件 vim /etc/ceph/ceph.conf # 2、在global下添加(全局使用) mon allow pool delete = true # 3、重启各节点服务 systemctl restart ceph-mon.target
3. Ceph 双副本如何保证宕机数据的安全性
- 问题:
- 解决方法:
# 链接: https://blog.csdn.net/li4528503/article/details/106256638?utm_medium=distribute.pc_aggpage_search_result.none-task-blog-2~aggregatepage~first_rank_ecpm_v1~rank_aggregation-3-106256638.pc_agg_rank_aggregation&utm_term=ceph%E4%B8%89%E5%89%AF%E6%9C%AC&spm=1000.2123.3001.4430
4. Ceph创建文件系统
-
问题1:Ceph中无法创建多个文件系统
# 无法创建多个文件系统 [root@ceph190 ~]# ceph fs new kyz kyz_metadata kyz_data Error EINVAL: Creation of multiple filesystems is disabled. To enable this experimental feature, use 'ceph fs flag set enable_multiple true'
-
解决方法:
# 执行命令 [root@ceph190 ~]# ceph fs flag set enable_multiple true Warning! This feature is experimental.It may cause problems up to and including data loss.Consult the documentation at ceph.com, and if unsure, do not proceed.Add --yes-i-really-mean-it if you are certain. # 此处会有对应提示,需要确认 [root@ceph190 ~]# ceph fs flag set enable_multiple true --yes-i-really-mean-it # 至此,可以创建多个文件系统 [root@ceph190 ~]# ceph fs new kyz kyz_metadata kyz_data new fs with metadata pool 10 and data pool 9
-
问题2:Ceph中多个文件系统相关
# 此处出现了其中一个文件系统可以使用,而另外一个始终为不可用状态 [root@node197 ~]# ceph mds stat cephfs-1/1/1 up kyz-0/0/1 up {[cephfs:0]=node197=up:active}
-
解决方法:
# 检查MDS服务个数,ceph中要求一个MDS服务,对应一个文件系统,即使ceph集群中创建了n个文件系统,但是若是只有一个MDS服务,则文件系统中依然只有一个可以使用,其余均不可弄
5. 使用ceph命令提示handle_connect_reply connect got BADAUTHORIZER
-
问题:
[root@node210 ~]# rbd ls mirror-cache-pool 2024-07-09 01:49:15.834 7f7a94746700 0 -- 192.168.20.210:0/4278141364 >> 192.168.20.211:6800/1532 conn(0x55941bb81520 :-1 s=STATE_CONNECTING_WAIT_CONNECT_REPLY_AUTH pgs=0 cs=0 l=1).handle_connect_reply connect got BADAUTHORIZER 2024-07-09 01:49:16.035 7f7a94746700 0 -- 192.168.20.210:0/4278141364 >> 192.168.20.211:6800/1532 conn(0x55941bb81520 :-1 s=STATE_CONNECTING_WAIT_CONNECT_REPLY_AUTH pgs=0 cs=0 l=1).handle_connect_reply connect got BADAUTHORIZER
-
解决方法
# 出现这种提示会导致无法执行ceph命令,解决办法就是重启所有的ceph节点即可: [root@node210 ~]# systemctl status ceph.target [root@node210 ~]# systemctl start ceph.target [root@node210 ~]# systemctl status ceph.target ● ceph.target - ceph target allowing to start/stop all ceph*@.service instances at once Loaded: loaded (/usr/lib/systemd/system/ceph.target; enabled; vendor preset: enabled) Active: active since Tue 2024-07-09 01:51:00 EDT; 7s ago