这篇文章主要介绍Docker中如何安装ceph rbd客户端,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!ceph rbd客户端要求客户端系统内核 2.6.32以上另外,我这个环境中把k9s-master1当做cep
这篇文章主要介绍Docker中如何安装ceph rbd客户端,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!
客户端系统内核 2.6.32以上
另外,我这个环境中把k9s-master1当做ceph客户端,而服务端是k8s-node1。
[root@k8s-master1 ~]# yum search cephLoaded plugins: fastestmirrorLoading mirror speeds from cached hostfile * base: mirrors.aliyun.com * extras: mirrors.tuna.tsinghua.edu.cn * updates: mirrors.aliyun.com========================================================= N/S matched: ceph =========================================================Centos-release-ceph-hammer.noarch : Ceph Hammer packages from the CentOS Storage SIG repositorycentos-release-ceph-jewel.noarch : Ceph Jewel packages from the CentOS Storage SIG repositorycentos-release-ceph-luminous.noarch : Ceph Luminous packages from the CentOS Storage SIG repositoryceph-common.x86_64 : Ceph Common
[root@k8s-master1 ~]# yum -y install centos-release-ceph-luminous.noarch
[root@k8s-master1 ~]# yum -y install ceph
生产中不要拷贝秘钥环,而是创建一个用户,并赋予相应的权限。
我这里拷贝秘钥环是为了方便。
登录ceph服务器集群中的任何一点,将其秘钥环拷贝到ceph的客户端。
[root@k8s-node1 ~]# cd /etc/ceph/[root@k8s-node1 ceph]# scp ceph.conf 172.16.22.197:/etc/ceph/[root@k8s-node1 ceph]# scp ceph.client.admin.keyring 172.16.22.197:/etc/ceph/
[root@k8s-master1 ~]# rbd --image data inforbd image 'data':size 1024 MB in 256 objectsorder 22 (4096 kB objects)block_name_prefix: rbd_data.1149238e1f29fORMat: 2features: layering, exclusive-lock, object-map, fast-diff, deep-flattenflags:
输出如上信息,表明我们可以使用rbd。
映射rbd到客户端并且挂载使用 rbd map rbd/data
[root@k8s-master1 ~]# rbd map rbd/data ##rbd是pool的名字,data是块存储的名字rbd: sysfs write failedRBD image feature set mismatch. Try disabling features unsupported by the kernel with "rbd feature disable".In some cases useful info is found in syslog - try "dmesg | tail".rbd: map failed: (6) No such device or address
看到上面报错了,我们需要执行一下如下命令:
[root@k8s-master1 ~]# rbd feature disable rbd/data exclusive-lock object-map fast-diff deep-flatten
[root@k8s-master1 ~]# rbd map rbd/data /dev/rbd0
[root@k8s-master1 ~]# fdisk -lDisk /dev/rbd0: 1073 MB, 1073741824 bytes, 2097152 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 4194304 bytes / 4194304 bytes
看到,我们把ceph的rdb块设备挂载到了k9s-master1机器上了。
这时候,/dev/rdb0还是一个裸设备,下面我们格式化一下它,给它创建一个文件系统。
[root@k8s-master1 ~]# mkfs.ext4 /dev/rbd0
挂载到/mnt下面:
[root@k8s-master1 ~]# mount /dev/rbd0 /mnt/
这样,我们就可以使用rbd块设备了。
以上是“docker中如何安装ceph rbd客户端”这篇文章的所有内容,感谢各位的阅读!希望分享的内容对大家有帮助,更多相关知识,欢迎关注编程网精选频道!
--结束END--
本文标题: docker中如何安装ceph rbd客户端
本文链接: https://www.lsjlt.com/news/238200.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-05-16
2024-05-16
2024-05-16
2024-05-16
2024-05-16
2024-05-16
2024-05-16
2024-05-16
2024-05-16
2024-05-16
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0