[global] workgroup = WORKGROUP netbios name = long server string = Linux Samba test security = user [samba] path = /smb/samba writeable = yes browseable = yes guest ok = yes
// 检查配置文件正确性 $ testparm
Load smb config files from /etc/samba/smb.conf rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384) Processing section "[samba]" Loaded services file OK. Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions
# Global parameters [global] netbios name = LONG security = USER server string = Linux Samba test idmap config * : backend = tdb
[samba] guest ok = Yes path = /smb/samba read only = No
Enter WORKGROUP\cluster's password: Anonymous login successful
Sharename Type Comment --------- ---- ------- samba Disk IPC$ IPC IPC Service (Linux Samba test) Reconnecting with SMB1 for workgroup listing. Anonymous login successful
Server Comment --------- -------
Workgroup Master --------- -------
$ smbclient //192.168.90.233/samba
Enter WORKGROUP\cluster's password: Anonymous login successful Try "help" to get a list of possible commands. smb: \> ls . D 0 Mon Aug 5 17:57:17 2019 .. DR 0 Mon Aug 5 17:47:05 2019 test D 0 Mon Aug 5 17:50:02 2019 public D 0 Mon Aug 5 17:57:25 2019
2030415872 blocks of size 1024. 2029215744 blocks available smb: \>
ok,smb服务配置成功。
使用windows访问CephFS
通过上面的步骤,显而易见,只要将CephFS挂载到smb服务所共享的目录下即可:
1
$ sudo mount -t ceph 192.168.90.233:6789:/ /smb/samba -o name=admin,secret=AQCSvDZdqDJ+LRAAwl2YpecB2kvb7Rmp4nGJXQ==
挂载之后,就相当于将CephFS共享了出来。
这里可以创建一个用户来访问共享:
1 2
$ sudo adduser smbuser $ sudo smbpasswd -a smbuser