docker中如何安裝cephrbd客戶端-創(chuàng)新互聯(lián)

這篇文章主要介紹docker中如何安裝ceph rbd客戶端,文中介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們一定要看完!

創(chuàng)新互聯(lián)建站2013年至今,是專業(yè)互聯(lián)網(wǎng)技術(shù)服務(wù)公司,擁有項(xiàng)目成都網(wǎng)站建設(shè)、網(wǎng)站制作網(wǎng)站策劃,項(xiàng)目實(shí)施與項(xiàng)目整合能力。我們以讓每一個(gè)夢想脫穎而出為使命,1280元新泰做網(wǎng)站,已為上家服務(wù),為新泰各地企業(yè)和個(gè)人服務(wù),聯(lián)系電話:028-86922220

ceph rbd客戶端要求

客戶端系統(tǒng)內(nèi)核 2.6.32以上

另外,我這個(gè)環(huán)境中把k9s-master1當(dāng)做ceph客戶端,而服務(wù)端是k8s-node1。

安裝ceph rbd客戶端

[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

將ceph服務(wù)端的秘鑰環(huán)拷貝到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/

在ceph客戶端查看rbd

[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到客戶端并且掛載使用 rbd map  rbd/data 

[root@k8s-master1 ~]# rbd map rbd/data  ##rbd是pool的名字,data是塊存儲的名字
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)容對大家有幫助,更多相關(guān)知識,歡迎關(guān)注創(chuàng)新互聯(lián)-成都網(wǎng)站建設(shè)公司行業(yè)資訊頻道!

分享文章:docker中如何安裝cephrbd客戶端-創(chuàng)新互聯(lián)
分享路徑:http://bm7419.com/article18/hsgdp.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供微信小程序、搜索引擎優(yōu)化、軟件開發(fā)、虛擬主機(jī)、網(wǎng)站內(nèi)鏈動態(tài)網(wǎng)站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

外貿(mào)網(wǎng)站建設(shè)