小编给大家分享一下如何利用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进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。