您好,登錄后才能下訂單哦!
小編給大家分享一下如何利用ceph rbd配置nfs,相信大部分人都還不怎么了解,因此分享這篇文章給大家參考一下,希望大家閱讀完這篇文章后大有收獲,下面讓我們一起去了解一下吧!
一種簡單實用的存儲方法,具體如下:
#安裝nfs rpm [root@osd1 current]# yum install nfs-utils rpcbind Loaded plugins: fastestmirror, priorities, refresh-packagekit, security Loading mirror speeds from cached hostfile epel/metalink | 5.5 kB 00:00 * base: mirrors.cug.edu.cn * epel: mirrors.yun-idc.com * extras: mirrors.btte.net * rpmforge: ftp.riken.jp * updates: mirrors.btte.net Ceph | 951 B 00:00 Ceph-noarch | 951 B 00:00 base | 3.7 kB 00:00 ceph-source | 951 B 00:00 epel | 4.4 kB 00:00 epel/primary_db | 6.3 MB 00:01 extras | 3.4 kB 00:00 rpmforge | 1.9 kB 00:00 updates | 3.4 kB 00:00 updates/primary_db | 188 kB 00:00 69 packages excluded due to repository priority protections Setting up Install Process Package rpcbind-0.2.0-11.el6.x86_64 already installed and latest version Resolving Dependencies --> Running transaction check ---> Package nfs-utils.x86_64 1:1.2.3-39.el6 will be updated ---> Package nfs-utils.x86_64 1:1.2.3-54.el6 will be an update --> Finished Dependency Resolution Dependencies Resolved ====================================================================================================================================== Package Arch Version Repository Size ====================================================================================================================================== Updating: nfs-utils x86_64 1:1.2.3-54.el6 base 326 k Transaction Summary ====================================================================================================================================== Upgrade 1 Package(s) Total download size: 326 k Is this ok [y/N]: y Downloading Packages: nfs-utils-1.2.3-54.el6.x86_64.rpm | 326 kB 00:00 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Updating : 1:nfs-utils-1.2.3-54.el6.x86_64 1/2 Cleanup : 1:nfs-utils-1.2.3-39.el6.x86_64 2/2 Verifying : 1:nfs-utils-1.2.3-54.el6.x86_64 1/2 Verifying : 1:nfs-utils-1.2.3-39.el6.x86_64 2/2 Updated: nfs-utils.x86_64 1:1.2.3-54.el6 #創建一個塊并格式化、掛載 [root@osd1 current]# rbd create myrbd/nfs_image -s 1024000 --image-format=2 [root@osd1 current]# rbd map myrbd/nfs_image /dev/rbd0 [root@osd1 current]# mkdir /mnt/nfs [root@osd1 current]# mkfs.xfs /dev/rbd0 log stripe unit (4194304 bytes) is too large (maximum is 256KiB) log stripe unit adjusted to 32KiB meta-data=/dev/rbd0 isize=256 agcount=33, agsize=8190976 blks = sectsz=512 attr=2, projid32bit=0 data = bsize=4096 blocks=262144000, imaxpct=25 = sunit=1024 swidth=1024 blks naming =version 2 bsize=4096 ascii-ci=0 log =internal log bsize=4096 blocks=128000, version=2 = sectsz=512 sunit=8 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 [root@osd1 current]# mount /dev/rbd0 -o rw,noexec,nodev,noatime,nobarrier /mnt/nfs #改寫exports文件,添加一行 [root@osd1 current]# vim /etc/exports /mnt/nfs 192.168.108.0/24(rw,no_root_squash,no_subtree_check,async) [root@osd1 current]# exportfs -r 這里還需要執行指令service rpcbind start [root@osd1 current]# service nfs start Starting NFS services: [ OK ] Starting NFS quotas: [ OK ] Starting NFS mountd: [ OK ] Starting NFS daemon: [ OK ] Starting RPC idmapd: [ OK ] 此時客戶端就可以掛載了。客戶端運行: showmount -e 192.168.108.2 然后進行掛載: mount -t nfs 192.168.108.2:/mnt/nfs /mnt/nfs
如果無法掛載,運行 service rpcbind start或 service portmap start命令試一下。
以上是“如何利用ceph rbd配置nfs”這篇文章的所有內容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內容對大家有所幫助,如果還想學習更多知識,歡迎關注億速云行業資訊頻道!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。