文档章节

ip改变引起的ceph monitor异常及osd盘崩溃的总结

加油2018
 加油2018
发布于 2014/12/25 10:19
字数 1076
阅读 3958
收藏 34

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

#Add the new monitor locations
# monmaptool --create --add mon0 192.168.32.2:6789 --add osd1 192.168.32.3:6789 \
  --add osd2 192.168.32.4:6789 --fsid 61a520db-317b-41f1-9752-30cedc5ffb9a \
  --clobber monmap

#Retrieve the monitor map
# ceph mon getmap -o monmap.bin

#Check new contents
# monmaptool --print monmap.bin

#Inject the monmap
# ceph-mon -i mon0 --inject-monmap monmap.bin
# ceph-mon -i osd1 --inject-monmap monmap.bin
# ceph-mon -i osd2 --inject-monmap monmap.bin

再启动monitor,一切正常。

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

# service ceph stop osd.4
#不必执行ceph osd crush remove osd.4
# ceph auth del osd.4
# ceph osd rm 4

# umount /cephmp1
# mkfs.xfs -f /dev/sdc
# mount /dev/sdc /cephmp1
#此处执行create无法正常安装osd
# ceph-deploy osd prepare osd2:/cephmp1:/dev/sdf1
# ceph-deploy osd activate osd2:/cephmp1:/dev/sdf1
完成后重启该osd,成功运行。ceph会自动平衡数据,最后的状态是:
[root@osd2 ~]# ceph -s
    cluster 61a520db-317b-41f1-9752-30cedc5ffb9a
     health HEALTH_WARN 9 pgs incomplete; 9 pgs stuck inactive; 9 pgs stuck unclean; 3 requests are blocked > 32 sec
     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
     osdmap e689: 6 osds: 6 up, 6 in
      pgmap v189608: 704 pgs, 5 pools, 34983 MB data, 8966 objects
            69349 MB used, 11104 GB / 11172 GB avail
                 695 active+clean
                   9 incomplete

出现了9个pg的incomplete状态。

[root@osd2 ~]# ceph health detail
HEALTH_WARN 9 pgs incomplete; 9 pgs stuck inactive; 9 pgs stuck unclean; 3 requests are blocked > 32 sec; 1 osds have slow requests
pg 5.95 is stuck inactive for 838842.634721, current state incomplete, last acting [1,4]
pg 5.66 is stuck inactive since forever, current state incomplete, last acting [4,0]
pg 5.de is stuck inactive for 808270.105968, current state incomplete, last acting [0,4]
pg 5.f5 is stuck inactive for 496137.708887, current state incomplete, last acting [0,4]
pg 5.11 is stuck inactive since forever, current state incomplete, last acting [4,1]
pg 5.30 is stuck inactive for 507062.828403, current state incomplete, last acting [0,4]
pg 5.bc is stuck inactive since forever, current state incomplete, last acting [4,1]
pg 5.a7 is stuck inactive for 499713.993372, current state incomplete, last acting [1,4]
pg 5.22 is stuck inactive for 496125.831204, current state incomplete, last acting [0,4]
pg 5.95 is stuck unclean for 838842.634796, current state incomplete, last acting [1,4]
pg 5.66 is stuck unclean since forever, current state incomplete, last acting [4,0]
pg 5.de is stuck unclean for 808270.106039, current state incomplete, last acting [0,4]
pg 5.f5 is stuck unclean for 496137.708958, current state incomplete, last acting [0,4]
pg 5.11 is stuck unclean since forever, current state incomplete, last acting [4,1]
pg 5.30 is stuck unclean for 507062.828475, current state incomplete, last acting [0,4]
pg 5.bc is stuck unclean since forever, current state incomplete, last acting [4,1]
pg 5.a7 is stuck unclean for 499713.993443, current state incomplete, last acting [1,4]
pg 5.22 is stuck unclean for 496125.831274, current state incomplete, last acting [0,4]
pg 5.de is incomplete, acting [0,4]
pg 5.bc is incomplete, acting [4,1]
pg 5.a7 is incomplete, acting [1,4]
pg 5.95 is incomplete, acting [1,4]
pg 5.66 is incomplete, acting [4,0]
pg 5.30 is incomplete, acting [0,4]
pg 5.22 is incomplete, acting [0,4]
pg 5.11 is incomplete, acting [4,1]
pg 5.f5 is incomplete, acting [0,4]
2 ops are blocked > 8388.61 sec
1 ops are blocked > 4194.3 sec
2 ops are blocked > 8388.61 sec on osd.0
1 ops are blocked > 4194.3 sec on osd.0
1 osds have slow requests

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

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

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

PS:常用pg操作

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


© 著作权归作者所有

共有 人打赏支持
上一篇: 逼仓
加油2018
粉丝 150
博文 276
码字总数 243077
作品 0
海淀
架构师
私信 提问
加载中

评论(6)

v
vatin
ceph monitor进程起不来,怎么执行命令“ceph mon getmap -o monmap.bin”?
风之子668
风之子668

引用来自“红薯”的评论

现在什么状态呢?

引用来自“壬癸甲乙”的评论

不改变crush map的前提下,把那块损坏的osd盘格掉重装,ceph会自动把数据复制到此osd上。如果数据的一致性没有损坏的话,重装后一切正常。
我全新安装的ceph服务,启动后也是health HEALTH_WARN 64 pgs incomplete; 64 pgs stuck inactive; 64 pgs stuck unclean monmap e1: 1 mons at {agent2=172.16.12.2:6789/0}, election epoch 1, quorum 0 agent2 osdmap e9: 2 osds: 2 up, 2 in pgmap v14: 64 pgs, 1 pools, 0 bytes data, 0 objects 10631 MB used, 3470 GB / 3667 GB avail 64 incomplete 这个怎么解决啊
加油2018
加油2018

引用来自“红薯”的评论

现在什么状态呢?
不改变crush map的前提下,把那块损坏的osd盘格掉重装,ceph会自动把数据复制到此osd上。如果数据的一致性没有损坏的话,重装后一切正常。
金拱门
金拱门
官方都无法解决……好坑
C
C.L.TANG
遇到过同样的问题,http://my.oschina.net/u/196769/blog/360998 提供参考
红薯
红薯
现在什么状态呢?
OSChina 技术周刊第十五期——每周技术精粹集锦

每周技术抢先看,总有你想要的! 移动开发 【软件】移动基站数据分析 SnoopSnitch 【博客】android自动连接wifi——WifiManager 【资讯】OSC 安卓客户端全面改版 —— 新界面新体验 【资讯】...

OSC编辑部
2014/12/28
1K
0
Ceph 之 使用ceph-deploy部署ceph集群

上面左边是我的个人微信,如需进一步沟通,请加微信。 右边是我的公众号“Openstack私有云”,如有兴趣,请关注。 环境: 系统centos7.4 ceph版本 ceph version 10.2.10 测试服务器为kvm虚拟...

余伟兵
05/24
0
0
基于centos7.3安装部署jewel版本ceph集群实战演练

一、环境准备 安装centos7.3虚拟机三台 由于官网源与网盘下载速度都非常的慢,所以给大家提供了国内的搜狐镜像源:http://mirrors.sohu.com/centos/7.3.1611/isos/x8664/CentOS-7-x86_64-DV...

盖世英雄iii
06/27
0
0
基于centos7.3安装部署jewel版本ceph集群实战演练

一、环境准备 安装centos7.3虚拟机三台 由于官网源与网盘下载速度都非常的慢,所以给大家提供了国内的搜狐镜像源:http://mirrors.sohu.com/centos/7.3.1611/isos/x8664/CentOS-7-x86_64-DV...

盖世英雄iii
06/27
0
0
Ceph逻辑架构

Ceph是一种存储行业最热门的软件定义存储技术,它为块存储、文件存储、对象存储提供了系统的软件定义解决方案。下面我们来了解Ceph的逻辑架构: Ceph monitor:Ceph monitor 通过保存一份集群...

Zai坚强一点
2017/09/16
0
0

没有更多内容

加载失败,请刷新页面

加载更多

Java 源代码和 C 源代码的运行区别

与其他程序的执行方式和编译方式不同。 Java 源代码需要进行编译成字节码后在 Java 虚拟机上运行,这样 Java 程序能够保持独立性和跨平台功特性。 请参考下图。 https://www.cwiki.us/pages...

honeymose
45分钟前
3
0
Apache限定目录解析PHP,限制user_agent,PHP相关的配置

Apache限定目录解析PHP 配置前访问upload/index.php [root@test-a ~]# curl -x192.168.77.139:80 'www.test.com/upload/index.php'This is upload diretory 配置,/usr/local/apache2.4/......

野雪球
今天
5
0
java.util.Concurrent.Exchanger源码

类图 源码: package java.util.concurrent;import java.util.concurrent.atomic.AtomicInteger;import java.util.concurrent.atomic.AtomicReference;import java.util.concurrent......

狼王黄师傅
今天
6
0
Kubernetes里的secret最基本的用法

Secret解决了密码、token、密钥等敏感数据的配置问题,使用Secret可以避免把这些敏感数据以明文的形式暴露到镜像或者Pod Spec中。 Secret可以以Volume或者环境变量的方式使用。 使用如下命令...

JerryWang_SAP
昨天
5
0
2018-11-20学习笔记

1. python数据类型: 给变量赋值什么样的值,变量就是什么样的类型 给变量赋值整数,变量就是整数类型 给变量赋值字符串,变量就是字符串类型 123 和“123”一样吗? 在python中 单引号 与双...

laoba
昨天
4
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部