IP改变引起的Ceph monitor异常及OSD盘崩溃的总结

运维 系统运维 Linux
公司搬家,所有服务器的ip改变。对ceph服务器配置好ip后启动,发现monitor进程启动失败,monitor进程总是试图绑定到以前的ip地址,那当然不可能成功了。

公司搬家,所有服务器的ip改变。对ceph服务器配置好ip后启动,发现monitor进程启动失败,monitor进程总是试图绑定到以前的ip地址,那当然不可能成功了。开始以为服务器的ip设置有问题,在改变hostname、ceph.conf等方法无果后,逐步分析发现,是monmap中的ip地址还是以前的ip,ceph通过读取monmap来启动monitor进程,所以需要修改monmap。方法如下:

  1. #Add the new monitor locations  
  2. # monmaptool --create --add mon0 192.168.32.2:6789 --add osd1 192.168.32.3:6789 \  
  3.   --add osd2 192.168.32.4:6789 --fsid 61a520db-317b-41f1-9752-30cedc5ffb9a \  
  4.   --clobber monmap  
  5.    
  6. #Retrieve the monitor map  
  7. # ceph mon getmap -o monmap.bin  
  8.    
  9. #Check new contents  
  10. # monmaptool --print monmap.bin  
  11.    
  12. #Inject the monmap  
  13. # ceph-mon -i mon0 --inject-monmap monmap.bin  
  14. # ceph-mon -i osd1 --inject-monmap monmap.bin  
  15. # ceph-mon -i osd2 --inject-monmap monmap.bin 

再启动monitor,一切正常。

但出现了上一篇文章中描述的一块osd盘挂掉的情况。查了一圈,只搜到ceph的官网上说是ceph的一个bug。无力修复,于是删掉这块osd,再重装:

  1. # service ceph stop osd.4  
  2. #不必执行ceph osd crush remove osd.4  
  3. # ceph auth del osd.4  
  4. # ceph osd rm 4  
  5.    
  6. # umount /cephmp1  
  7. # mkfs.xfs -f /dev/sdc  
  8. # mount /dev/sdc /cephmp1  
  9. #此处执行create无法正常安装osd  
  10. # ceph-deploy osd prepare osd2:/cephmp1:/dev/sdf1  
  11. # ceph-deploy osd activate osd2:/cephmp1:/dev/sdf1 

完成后重启该osd,成功运行。ceph会自动平衡数据,***的状态是:

  1. [root@osd2 ~]# ceph -s  
  2.     cluster 61a520db-317b-41f1-9752-30cedc5ffb9a 
  3.      health HEALTH_WARN 9 pgs incomplete; 9 pgs stuck inactive; 9 pgs stuck unclean; 3 requests are blocked > 32 sec  
  4.      monmap e3: 3 mons at {mon0=192.168.32.2:6789/0,osd1=192.168.32.3:6789/0,osd2=192.168.32.4:6789/0}, election epoch 76, quorum 0,1,2 mon0,osd1,osd2  
  5.      osdmap e689: 6 osds: 6 up, 6 in 
  6.       pgmap v189608: 704 pgs, 5 pools, 34983 MB data, 8966 objects  
  7.             69349 MB used, 11104 GB / 11172 GB avail  
  8.                  695 active+clean  
  9.                    9 incomplete 

出现了9个pg的incomplete状态。

  1. [root@osd2 ~]# ceph health detail  
  2. HEALTH_WARN 9 pgs incomplete; 9 pgs stuck inactive; 9 pgs stuck unclean; 3 requests are blocked > 32 sec; 1 osds have slow requests  
  3. pg 5.95 is stuck inactive for 838842.634721, current state incomplete, last acting [1,4]  
  4. pg 5.66 is stuck inactive since forever, current state incomplete, last acting [4,0]  
  5. pg 5.de is stuck inactive for 808270.105968, current state incomplete, last acting [0,4]  
  6. pg 5.f5 is stuck inactive for 496137.708887, current state incomplete, last acting [0,4]  
  7. pg 5.11 is stuck inactive since forever, current state incomplete, last acting [4,1]  
  8. pg 5.30 is stuck inactive for 507062.828403, current state incomplete, last acting [0,4]  
  9. pg 5.bc is stuck inactive since forever, current state incomplete, last acting [4,1]  
  10. pg 5.a7 is stuck inactive for 499713.993372, current state incomplete, last acting [1,4]  
  11. pg 5.22 is stuck inactive for 496125.831204, current state incomplete, last acting [0,4]  
  12. pg 5.95 is stuck unclean for 838842.634796, current state incomplete, last acting [1,4]  
  13. pg 5.66 is stuck unclean since forever, current state incomplete, last acting [4,0]  
  14. pg 5.de is stuck unclean for 808270.106039, current state incomplete, last acting [0,4]  
  15. pg 5.f5 is stuck unclean for 496137.708958, current state incomplete, last acting [0,4]  
  16. pg 5.11 is stuck unclean since forever, current state incomplete, last acting [4,1]  
  17. pg 5.30 is stuck unclean for 507062.828475, current state incomplete, last acting [0,4]  
  18. pg 5.bc is stuck unclean since forever, current state incomplete, last acting [4,1]  
  19. pg 5.a7 is stuck unclean for 499713.993443, current state incomplete, last acting [1,4]  
  20. pg 5.22 is stuck unclean for 496125.831274, current state incomplete, last acting [0,4]  
  21. pg 5.de is incomplete, acting [0,4]  
  22. pg 5.bc is incomplete, acting [4,1]  
  23. pg 5.a7 is incomplete, acting [1,4]  
  24. pg 5.95 is incomplete, acting [1,4]  
  25. pg 5.66 is incomplete, acting [4,0]  
  26. pg 5.30 is incomplete, acting [0,4]  
  27. pg 5.22 is incomplete, acting [0,4]  
  28. pg 5.11 is incomplete, acting [4,1]  
  29. pg 5.f5 is incomplete, acting [0,4]  
  30. 2 ops are blocked > 8388.61 sec  
  31. 1 ops are blocked > 4194.3 sec  
  32. 2 ops are blocked > 8388.61 sec on osd.0 
  33. 1 ops are blocked > 4194.3 sec on osd.0 
  34. 1 osds have slow requests 

查了一圈无果。一个有同样遭遇的人的一段话:

  1. I already tried "ceph pg repair 4.77", stop/start OSDs, "ceph osd lost""ceph pg force_create_pg 4.77".  
  2. Most scary thing is "force_create_pg" does not work. At least it should be a way to wipe out a incomplete PG  
  3. without destroying a whole pool. 

以上方法尝试了一下,都不行。暂时无法解决,感觉有点坑。

PS:常用pg操作

  1. [root@osd2 ~]# ceph pg map 5.de  
  2. osdmap e689 pg 5.de (5.de) -> up [0,4] acting [0,4]  
  3. [root@osd2 ~]# ceph pg 5.de query  
  4. [root@osd2 ~]# ceph pg scrub 5.de  
  5. instructing pg 5.de on osd.0 to scrub  
  6. [root@osd2 ~]# ceph pg 5.de mark_unfound_lost revert  
  7. pg has no unfound objects  
  8. #ceph pg dump_stuck stale  
  9. #ceph pg dump_stuck inactive  
  10. #ceph pg dump_stuck unclean  
  11. [root@osd2 ~]# ceph osd lost 1  
  12. Error EPERM: are you SURE?  this might mean real, permanent data loss.  pass --yes-i-really-mean-it if you really do.  
  13. [root@osd2 ~] 
  14. [root@osd2 ~]# ceph osd lost 4 --yes-i-really-mean-it  
  15. osd.4 is not down or doesn't exist  
  16. [root@osd2 ~]# service ceph stop osd.4  
  17. === osd.4 ===   
  18. Stopping Ceph osd.4 on osd2...kill 22287...kill 22287...done  
  19. [root@osd2 ~]# ceph osd lost 4 --yes-i-really-mean-it  
  20. marked osd lost in epoch 690 
  21. [root@osd1 mnt]# ceph pg repair 5.de  
  22. instructing pg 5.de on osd.0 to repair  
  23. [root@osd1 mnt]# ceph pg repair 5.de  
  24. instructing pg 5.de on osd.0 to repair 

本文出自:http://my.oschina.net/renguijiayi/blog/360274

责任编辑:林师授 来源: 壬癸甲乙的博客
相关推荐

2022-08-05 11:55:13

FlutteriOS

2023-02-02 08:04:15

Ceph数据CPU

2021-06-09 15:55:34

Oracle账号锁定

2023-03-21 08:01:44

Crimson硬件CPU

2022-06-15 16:04:13

Java编程语言

2011-11-30 13:59:17

JavaJVM

2019-04-30 09:17:31

Ceph存储OSD

2021-08-02 14:17:19

AndroidOOM崩溃性能优化

2011-05-30 09:43:30

2022-09-28 08:31:13

crush虚拟机设备

2023-11-23 13:43:00

业务异常数据库

2023-12-14 08:00:39

OctopusPacificOSD

2017-04-01 10:44:26

Ceph Pool操作pool语法

2011-05-20 11:45:12

2009-07-10 14:32:06

JVM崩溃

2010-03-05 15:33:57

Linux shell

2010-12-24 15:38:53

C#单例模式

2013-02-16 13:26:00

360急救盘数据安全360安全中心

2023-10-28 08:47:58

Ceph文件系统

2020-07-02 22:42:18

Java异常编程
点赞
收藏

51CTO技术栈公众号