作者:尹正杰
版权声明:原创作品,谢绝转载!否则将追究法律责任。
目录
- 一.cephadm访问ceph集群
- 1 方式一: 使用cephadm shell交互式配置【会创建临时容器,当shell推出后就会自动删除容器哟~】
- 2 方式二: 使用cephadm非交互式配置【会创建临时容器】
- 3 方式三: 安装ceph通用包,其中包含所有ceph命令,包括ceph、rbd、mount.ceph(用于挂载CephFS文件系统)等【推荐使用】
一.cephadm访问ceph集群
1 方式一: 使用cephadm shell交互式配置【会创建临时容器,当shell推出后就会自动删除容器哟~】
[root@ceph141 ~]# cephadm shell
Inferring fsid c044ff3c-5f05-11ef-9d8b-51db832765d6
Inferring config /var/lib/ceph/c044ff3c-5f05-11ef-9d8b-51db832765d6/mon.ceph141/config
Using ceph image with id '2bc0b0f4375d' and tag 'v18' created on 2024-07-24 06:19:35 +0800 CST
quay.io/ceph/ceph@sha256:6ac7f923aa1d23b43248ce0ddec7e1388855ee3d00813b52c3172b0b23b37906
root@ceph141:/#
root@ceph141:/# ceph -scluster:id: c044ff3c-5f05-11ef-9d8b-51db832765d6health: HEALTH_WARNOSD count 0 < osd_pool_default_size 3services:mon: 1 daemons, quorum ceph141 (age 14m)mgr: ceph141.gqogmi(active, since 10m)osd: 0 osds: 0 up, 0 indata:pools: 0 pools, 0 pgsobjects: 0 objects, 0 Busage: 0 B used, 0 B / 0 B availpgs: root@ceph141:/#
root@ceph141:/# exit
exit
[root@ceph141 ~]#
2 方式二: 使用cephadm非交互式配置【会创建临时容器】
[root@ceph141 ~]# cephadm shell -- ceph -s
Inferring fsid c044ff3c-5f05-11ef-9d8b-51db832765d6
Inferring config /var/lib/ceph/c044ff3c-5f05-11ef-9d8b-51db832765d6/mon.ceph141/config
Using ceph image with id '2bc0b0f4375d' and tag 'v18' created on 2024-07-24 06:19:35 +0800 CST
quay.io/ceph/ceph@sha256:6ac7f923aa1d23b43248ce0ddec7e1388855ee3d00813b52c3172b0b23b37906cluster:id: c044ff3c-5f05-11ef-9d8b-51db832765d6health: HEALTH_WARNOSD count 0 < osd_pool_default_size 3services:mon: 1 daemons, quorum ceph141 (age 12m)mgr: ceph141.gqogmi(active, since 8m)osd: 0 osds: 0 up, 0 indata:pools: 0 pools, 0 pgsobjects: 0 objects, 0 Busage: 0 B used, 0 B / 0 B availpgs: [root@ceph141 ~]#
3 方式三: 安装ceph通用包,其中包含所有ceph命令,包括ceph、rbd、mount.ceph(用于挂载CephFS文件系统)等【推荐使用】
[root@ceph141 ~]# cephadm add-repo --release reef
[root@ceph141 ~]# cephadm install ceph-common
...
Installing repo GPG key from https://download.ceph.com/keys/release.gpg...
Installing repo file at /etc/apt/sources.list.d/ceph.list... # 会在宿主机创建源文件并安装,速度较慢,请耐性等待!
Updating package list...
Completed adding repo.
Installing packages ['ceph-common']
[root@ceph141 ~]#
[root@ceph141 ~]# ceph -v # Duang~宿主机可以正常访问啦!
ceph version 18.2.4 (e7ad5345525c7aa95470c26863873b581076945d) reef (stable)
[root@ceph141 ~]#
[root@ceph141 ~]# ceph -s # 直接在宿主机访问即可cluster:id: c044ff3c-5f05-11ef-9d8b-51db832765d6health: HEALTH_WARNOSD count 0 < osd_pool_default_size 3services:mon: 1 daemons, quorum ceph141 (age 22m)mgr: ceph141.gqogmi(active, since 18m)osd: 0 osds: 0 up, 0 indata:pools: 0 pools, 0 pgsobjects: 0 objects, 0 Busage: 0 B used, 0 B / 0 B availpgs: [root@ceph141 ~]#