|NO.Z.00239|——————————|^^ 部署 ^^|——|KuberNetes&存储进阶.V05|——|Ceph.v04|ceph集群|ceph客户端工具|
一、安装ceph客户端工具
### --- 安装ceph客户端
~~~ # 切换到ceph目录下
[root@k8s-master01 ~]# cd /root/rook/cluster/examples/kubernetes/ceph
### --- 安装ceph客户端
[root@k8s-master01 ceph]# kubectl create -f toolbox.yaml -n rook-ceph
deployment.apps/rook-ceph-tools created
### --- 待容器Running后,即可执行相关命令
[root@k8s-master01 ceph]# kubectl get po -n rook-ceph -l app=rook-ceph-tools
NAME READY STATUS RESTARTS AGE
rook-ceph-tools-58bbc55d4c-j6fgl 1/1 Running 0 10s
二、ceph客户端使用示例
### --- 进入rook-ceph-tools容器内部
[root@k8s-master01 ceph]# kubectl -n rook-ceph exec -it deploy/rook-ceph-tools -- bash
~~~ # 查看ceph集群状态
[root@rook-ceph-tools-58bbc55d4c-w4shn /]# ceph status
cluster:
id: 7bb48655-41fa-45b9-bd79-3273cfe157f9
health: HEALTH_ok
services:
mon: 1 daemons, quorum a (age 8m)
mgr: a(active, since 7m)
osd: 3 osds: 3 up (since 2m), 3 in (since 7m)
data:
pools: 1 pools, 1 pgs
objects: 0 objects, 0 B
usage: 3.0 GiB used, 297 GiB / 300 GiB avail
pgs: 1 active+clean
~~~ # 查看ods集群状态
[root@rook-ceph-tools-58bbc55d4c-j6fgl /]# ceph osd status
ID HOST USED AVAIL WR OPS WR DATA RD OPS RD DATA STATE
0 k8s-master01 1027M 98.9G 0 0 0 0 exists,up
1 k8s-node02 1027M 98.9G 0 0 0 0 exists,up
2 k8s-node01 1027M 98.9G 0 0 0 0 exists,up
~~~ # 查看磁盘使用情况
[root@rook-ceph-tools-58bbc55d4c-j6fgl /]# ceph df
--- RAW STORAGE ---
CLASS SIZE AVAIL USED RAW USED %RAW USED
hdd 300 GiB 297 GiB 11 MiB 3.0 GiB 1.00
TOTAL 300 GiB 297 GiB 11 MiB 3.0 GiB 1.00
--- POOLS ---
POOL ID PGS STORED OBJECTS USED %USED MAX AVAIL
device_health_metrics 1 1 0 B 0 0 B 0 94 GiB
Walter Savage Landor:strove with none,for none was worth my strife.Nature I loved and, next to Nature, Art:I warm'd both hands before the fire of life.It sinks, and I am ready to depart
——W.S.Landor
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· DeepSeek 开源周回顾「GitHub 热点速览」
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了