您好,登錄后才能下訂單哦!
這篇文章主要介紹docker中如何安裝ceph rbd客戶端,文中介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們一定要看完!
客戶端系統(tǒng)內(nèi)核 2.6.32以上
另外,我這個(gè)環(huán)境中把k9s-master1當(dāng)做ceph客戶端,而服務(wù)端是k8s-node1。
[root@k8s-master1 ~]# yum search ceph Loaded plugins: fastestmirror Loading 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 repository centos-release-ceph-jewel.noarch : Ceph Jewel packages from the CentOS Storage SIG repository centos-release-ceph-luminous.noarch : Ceph Luminous packages from the CentOS Storage SIG repository ceph-common.x86_64 : Ceph Common
[root@k8s-master1 ~]# yum -y install centos-release-ceph-luminous.noarch
[root@k8s-master1 ~]# yum -y install ceph
生產(chǎn)中不要拷貝秘鑰環(huán),而是創(chuàng)建一個(gè)用戶,并賦予相應(yīng)的權(quán)限。
我這里拷貝秘鑰環(huán)是為了方便。
登錄ceph服務(wù)器集群中的任何一點(diǎn),將其秘鑰環(huán)拷貝到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 info rbd image 'data': size 1024 MB in 256 objects order 22 (4096 kB objects) block_name_prefix: rbd_data.1149238e1f29 format: 2 features: layering, exclusive-lock, object-map, fast-diff, deep-flatten flags:
輸出如上信息,表明我們可以使用rbd。
映射rbd到客戶端并且掛載使用 rbd map rbd/data
[root@k8s-master1 ~]# rbd map rbd/data ##rbd是pool的名字,data是塊存儲(chǔ)的名字 rbd: sysfs write failed RBD 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
看到上面報(bào)錯(cuò)了,我們需要執(zhí)行一下如下命令:
[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 -l Disk /dev/rbd0: 1073 MB, 1073741824 bytes, 2097152 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 4194304 bytes / 4194304 bytes
看到,我們把ceph的rdb塊設(shè)備掛載到了k9s-master1機(jī)器上了。
這時(shí)候,/dev/rdb0還是一個(gè)裸設(shè)備,下面我們格式化一下它,給它創(chuàng)建一個(gè)文件系統(tǒng)。
[root@k8s-master1 ~]# mkfs.ext4 /dev/rbd0
掛載到/mnt下面:
[root@k8s-master1 ~]# mount /dev/rbd0 /mnt/
這樣,我們就可以使用rbd塊設(shè)備了。
以上是“docker中如何安裝ceph rbd客戶端”這篇文章的所有內(nèi)容,感謝各位的閱讀!希望分享的內(nèi)容對(duì)大家有幫助,更多相關(guān)知識(shí),歡迎關(guān)注億速云行業(yè)資訊頻道!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。