晴栀初眸 - Ceph
type: channel
link: https://shackles.cn/index.php/tag/Ceph
items: Ceph磁盘报ERROR,解决办法
items: Ceph Cluster部署和对接K8S V1.23.10

Ceph磁盘报ERROR,解决办法
type: item
date: 2024-07-08T05:39:00+00:00
description: 查询哪个OSD报错：root@ceph01:~# ceph orch ps NAME HOST PORTS STATUS REFRESHED AGE MEM USE MEM LIM VERSION IMAGE ID CONTAINER ID .......................................................................................................................................... osd.0 ceph01 error 94s ago 11w - 4096M <unknown> <unknown> <unknown> ..........................................................................................................................................移除osd.0ceph osd out osd.0 ceph osd crush remove osd.0 ceph auth del osd.0 ceph osd rm osd.0 ceph orch daemon rm osd.0 --force清除osd.0的磁盘格式wipefs -a -f /dev/sdb重启机器进行查验查验 root@ceph01:~# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT .............................................................. sdb 8:16 0 500G 0 disk ..............................................................sdb没有任何格式修改/var/lib/ceph/目录属主，chown -R 167:167 /var/lib/ceph/新增硬盘root@ceph01:~# ceph orch daemon add osd ceph01:/dev/sdb

Ceph Cluster部署和对接K8S V1.23.10
type: item
date: 2024-04-20T03:42:00+00:00
description: 环境准备：三台机器 系统环境：Ubuntu 20.04.3 LTS三台机器 安装基础环境：apt install docker.io -y systemctl start docker && systemctl enable docker三台机器 Python版本Python 3.8.6三台机器 主机名10.2.0.25 ceph-1 10.2.0.26 ceph-2 10.2.0.27 ceph-3三台机器双网卡10.2.0.25 192.168.1.1 ceph-1 10.2.0.26 192.168.1.2 ceph-2 10.2.0.27 192.168.1.3 ceph-3三台机器及各组件位置10.2.0.25 ceph-1 ceph-mon01 ceph-mgr01 cephadm 10.2.0.26 ceph-2 ceph-mon02 ceph-mgr02 10.2.0.27 ceph-3 ceph-mon03 ceph-mgr03三台机器 /etc/hostsroot@ceph-1:~# cat /etc/hosts 10.2.0.25 ceph-1 10.2.0.26 ceph-2 10.2.0.27 ceph-3三台机器时间同步timedatectl set-timezone Asia/Shanghai && apt install ntpdate -y && ntpdate ntp1.aliyun.com部署Ceph Cluster下载cephadmCEPH_RELEASE=18.2.2 # replace this with the active release curl --silent --remote-name --location https://download.ceph.com/rpm-${CEPH_RELEASE}/el9/noarch/cephadm chmod a+x cephadm && mv cephadm /usr/bin/引导 Ceph 集群cephadm bootstrap --mon-ip 10.2.0.25 --cluster-network 192.168.1.0/24部署完成后的集群相关信息Ceph Dashboard is now available at: URL: https://ceph-1:8443/ #Ceph 管理UI登录地址 User: admin #Ceph 管理UI登录地址用户名 Password: njc4a24jel #Ceph 管理UI登录地址密码 Enabling client.admin keyring and conf on hosts with "admin" label Saving cluster configuration to /var/lib/ceph/e48ba8d6-e341-11ee-8b2b-2799cf0b1efd/config directory Enabling autotune for osd_memory_target You can access the Ceph CLI as following in case of multi-cluster or non-default config: sudo /usr/bin/cephadm shell --fsid e48ba8d6-e341-11ee-8b2b-2799cf0b1efd -c /etc/ceph/ceph.conf -k /etc/ceph/ceph.client.admin.keyring Or, if you are only running a single cluster on this host: sudo /usr/bin/cephadm shell Please consider enabling telemetry to help improve Ceph: ceph telemetry on For more information see: https://docs.ceph.com/en/latest/mgr/telemetry/ Bootstrap complete.安装 ceph 管理工具包, 其中包括 ceph, rbd, mount.ceph 等命令cephadm install ceph-common查看集群状态root@ceph-1:/# ceph -s cluster: id: e48ba8d6-e341-11ee-8b2b-2799cf0b1efd health: HEALTH_WARN OSD count 0 < osd_pool_default_size 3 #默认osd最小不低于3个 service…