ceph 运维过程碰到的问题

1   启动ceph遇到如下错误Error ENOENT: osd.2 does not exist. create it before updating the crush map
解决方法 :  /usr/local/bin/ceph osd create

2. Unable to find /var/lib/ceph/bootstrap-osd/ceph.keyring on node-20   
解决方法:  cd /etc/ceph; ceph-create-keys --id node-20

3. 磁盘 error:    Structure needs cleaning    
解决办法:  xfs_repair -L /dev/sdb1

4. 逻辑卷做OSD的问题 
解决办法:首先mkfs -t xfs /dev/mapper/home 然后mount /devmapper/home /opt/ceph, 最后 ceph-deploy osd prepare  node-1:/opt/ceph

5  qem-kvm 不支持rbd
解决办法:qemu-img -h|grep rbd 检查, 然后升级包(qemu-img qemu-kvm)
    
6.  health HEALTH_WARN 576 pgs degraded  :问题是osd < default pool size
解决方法:  $ ceph osd pool set size 

       $ ceph osd pool set min_size

默认池的副本是3.但是我的OSD物理节点只有2个。所以需要设置

ceph osd pool set data size 2
ceph osd pool set metadata size 2
ceph osd pool set rbd size 2
ceph osd pool set images size 2
ceph osd pool set volumes size 2
ceph osd pool set compute size 2

 7.clock skew detected on mon.node-2: 
解决方法:  安装ntp 同步时间

8.health HEALTH_WARN 576 pgs stuck unclean  
解决办法:  重启各个osd


9.  ceph error:   25 pgs inconsistent; 25 scrub errors
解决方法: 执行下列脚本 

!/bin/sh

CEPH='/usr/local/bin/ceph'

for pgid in `$CEPH health detail | grep inconsistent | grep ^pg | awk {'print $2'}`
do
$CEPH pg deep-scrub $pgid
sleep 1s
$CEPH pg repair $pgid
if [ $? = 0 ]; then
    echo "pg repair $pgid, succ"
else
    echo "pg repair $pgid, failed"
fi
done


你可能感兴趣的:(存储)