Ceph运维笔记
一、基本操作
ceph osd tree //查看所有osd情况
ceph -s //查看整体ceph情况 health_ok才是正常的
ceph osd out osd.1 //将osd.1踢出集群
ceph osd in osd.1 //将out的集群重新加入集群
二、问题解决
1.执行ceph-deploy mon create-initial出错
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
解决方法
2.osd down(先尝试重启)
ceph osd tree //先查看down掉的osd编号 假设down掉的是osd.1
ceph osd out osd.1 //在部署节点执行 先将osd.1移出集群
systemctl stop ceph-osd@1.service
ceph-osd -i 1 //在osd所在节点执行
3.Resource temporarily unavailable和is another process using it?
[ceph1][WARNIN] E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)
[ceph1][WARNIN] E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
sudo rm /var/lib/dpkg/lock //直接把锁删了
4.重启osd无效 直接删除osd 重新创建
ceph osd out 1 //将osd.1踢出集群
执行ceph auth del osd.4 和 ceph osd rm 4, 此时删除成功但是原来的数据和日志目录还在,也就是数据还在
执行umount /dev/sdb,然后执行ceph-disk zap /dev/sdb将数据也删除了
之后再创建新osd时,必须是在一个空磁盘上创建
5.application not enabled on 1 pool(s)
root@ceph0:~/ceph-deploy# ceph -s
cluster:
id: e34e62c3-d8a7-484e-8d46-4707b03b8f71
health: HEALTH_WARN
application not enabled on 1 pool(s)
clock skew detected on mon.ceph2
services:
mon: 3 daemons, quorum ceph0,ceph1,ceph2
mgr: ceph2(active), standbys: ceph1, ceph0
osd: 3 osds: 3 up, 3 in
rgw: 1 daemon active
data:
pools: 5 pools, 160 pgs
objects: 188 objects, 1.2 KiB
usage: 3.0 GiB used, 27 GiB / 30 GiB avail
pgs: 160 active+clean
root@ceph0:~/ceph-deploy# ceph health detail
HEALTH_WARN application not enabled on 1 pool(s)
POOL_APP_NOT_ENABLED application not enabled on 1 pool(s)
application not enabled on pool 'testPool'
use 'ceph osd pool application enable <pool-name> <app-name>', where <app-name> is 'cephfs', 'rbd', 'rgw', or freeform for custom applications.
ceph health detail //命令发现是新加入的存储池testPool没有被应用程序标记,因为之前添加的是RGW实例,所以此处依提示将testPool被rgw标记即可:
root@ceph0:~/ceph-deploy# ceph osd pool application enable testPool rgw
enabled application 'rgw' on pool 'testPool'