提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档
文章目录
- 前言
- 一、操作步骤
- 1. 挂载路径初始状态
- 2. 配置ganesha.conf
- 3. 启动ganesha服务后,在其他节点挂载测试
前言
针对于nfsd,通常可以在配置文件中做配置如下:
复制代码
1
2
3
4
5$ cat/etc/exports /mnt/待暴露卷1 *(rw,async,no_root_squash,no_subtree_check,fsid=唯一的一个id号) /mnt/待暴露卷2 *(rw,async,no_root_squash,no_subtree_check,fsid=唯一的一个id号) ...
就可以通过启动一个nfsd server,对外export多个挂载卷。那么,nfs-ganesha是如何做的呢?在ganesha配置文件中,添加EXPORT条目就可以。
一、操作步骤
1. 挂载路径初始状态
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14$ df -h Filesystem Size Used Avail Use% Mounted on ... ceph-fuse 8.5G 0 8.5G 0% /mnt/mycephfs $ tree /mnt/mycephfs/ /mnt/mycephfs/ ├── dir1 │ └── file1 └── dir2 └── file2 2 directories, 2 files
2. 配置ganesha.conf
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36EXPORT { Export_ID=100; Protocols = 4; Transports = TCP; Path = /dir1; pseudo = /cephfs1; Access_Type = RW; Squash = No_root_squash; FSAL { Name = CEPH; Filesystem = "cephfs"; User_Id = "admin"; Secret_Access_Key = "/etc/ceph/ceph.client.admin.keyring中key值"; } } EXPORT { Export_ID=200; Protocols = 4; Transports = TCP; Path = /dir2; pseudo = /cephfs2; Access_Type = RW; Squash = No_root_squash; FSAL { Name = CEPH; Filesystem = "cephfs"; User_Id = "admin"; Secret_Access_Key = "/etc/ceph/ceph.client.admin.keyring中key值"; } }
3. 启动ganesha服务后,在其他节点挂载测试
选择另外一台节点,挂载export出来的目录。
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28$ mount -t nfs -o nfsvers=4.1,proto=tcp ganesha-IP:/cephfs2 /nfs-ganesha-cephfs2 $ mount -t nfs -o nfsvers=4.1,proto=tcp ganesha-IP:/cephfs1 /nfs-ganesha-cephfs1 $ df -h ganesha-IP:/cephfs2 8.5G 0 8.5G 0% /nfs-ganesha-cephfs2 ganesha-IP:/cephfs1 8.5G 0 8.5G 0% /nfs-ganesha-cephfs1 $ ls /nfs-ganesha-cephfs1/ file1 $ ls /nfs-ganesha-cephfs2/ file2 $ dd if=/dev/zero of=/nfs-ganesha-cephfs1/dd1 bs=4K count=1024 1024+0 records in 1024+0 records out 4194304 bytes (4.2 MB) copied, 0.0288327 s, 145 MB/s $ dd if=/dev/zero of=/nfs-ganesha-cephfs2/dd2 bs=4K count=1024 1024+0 records in 1024+0 records out 4194304 bytes (4.2 MB) copied, 0.0322968 s, 130 MB/s $ tree /mnt/mycephfs/ /mnt/mycephfs/ ├── dir1 │ ├── dd1 │ └── file1 └── dir2 ├── dd2 └── file2 2 directories, 4 files
最后
以上就是洁净雨最近收集整理的关于nfs-ganesha 导出多个目录前言一、操作步骤的全部内容,更多相关nfs-ganesha内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复