Cephfs+Samba builds file sharing service based on Ceph
1 introduction
Ceph distributed storage uses Samba service to export CephFS file storage to Samba protocol. Support for Windows and Linux MacOS to access file sharing
2 Environment
3 install Samba
Download the samba rpm installation package:
Yum-y install smaba samba-client samba-common
4 create a samba user
Groupadd samba
Useradd samba-d / home/samba-g smb-s / sbin/nologin
Smbpasswd-a samba
5. Source code compiling vfs_ceph module
Download tar-zxvf samba-4.8.3.tar.gz
Yum-y install lmdb python36 python36-devel lmdb-devel gnutls-devel gpgme-devel python-gpgme jansson-devel libarchive-devel libacl-devel pam-devel
. / configure
Make
Cd bin/default/source3/modules/
Cp-a libvfs_module_ceph.so / usr/lib64/samba/vfs/
6 configure Ceph
Create a CephFs samba.gw account
Ceph auth get-or-create client.samba.gw mon 'allow r'\
Osd 'allow' mds' allow'- o ceph.client.samba.gw.keyring
Copy the key to / etc/ceph
Cp ceph.client.samba.gw.keyring / etc/ceph/
7 configure Samba
8 start the service
Systemctl start smb.service
Systemctl enable smb.service
Systemctl start nmb.service
Systemctl enable nmb.service
9 Linux mount
Linux client installs yum-y install cifs-utils
Mount.cifs / / IP/share / mnt/share-o username=xxx,password=xxx
10 Windows mount
11 failure scenario:
11.1 access to a shared directory under Windows does not have permission to delete and create directory files
It means that CephFS is mounted locally in kernel mode on IP.
Mount-t ceph IP:/ / mnt/cephfs/
Chmod 777-R / mnt/cephfs/
Umount / mnt/cephfs