1、背景
在客户端挂载Ceph FS时,客户端操作系统版本较低,可能导致内核挂载和ceph-fuse挂载失败。解决办法除了升级内核版本外,还可以将ceph fs导出为nfs,这样客户端就可以通过nfs挂载。
2、配置导出
2.1、创建需要导出的目录
ceph fs默认挂载空间为/,因此需要确保待导出的目录存在,如果不存在则需要先创建。
在任一Ceph FS客户端,挂载Ceph FS根目录,并创建要导出的目录。
]$ mount -t ceph mds1.stbchina.cn,mds2.stbchina.cn:/ /ceph_fs/ -o name=admin,secretfile=/etc/ceph/secretkey]$ cd /ceph_fs]$ mkdir test_fs
2.2、安装配置genesha
配置yum源
]$ vim /etc/yum.repos.d/ceph.repo # 添加以下内容 [nfs-ganesha] name=nfs-ganesha baseurl=http://us-west.ceph.com/nfs-ganesha/rpm-V2.8-stable/nautilus/x86_64/ enabled=1安装genesha
]$ yum install -y nfs-utils nfs-ganesha nfs-ganesha-ceph配置 ```bash ]$ vi /etc/ganesha/ganesha.conf EXPORT {
Export_id=26666; Path = /test_fs; Pseudo = /test_fs; Access_Type = RW; Protocols = 3,4; Transports = TCP; SecType = sys,krb5,krb5i,krb5p; #Squash = Root_Squash; Squash = no_root_squash; Attr_Expiration_Time = 0; FSAL { Name = CEPH; User_Id = "admin"; }}
LOG { Facility { name = FILE; destination = “/var/log/ganesha.log”; enable = active; }
}
- 启动服务
```bash
]$ systemctl start nfs-ganesha
2.3、查看mount信息
]$ showmount -e
Export list for ceph-mon2.stbchina.cn:
/test_fs (everyone)
3、客户端挂载
mkdir /test_fs
mount -t nfs 10.10.3.182:/test_fs /test_fs/
