天天看點

Netapp 存儲檔案共享-Linux 主機應用

Linux /UNIX 通路存儲是通過NFS 協定,進行讀寫資料的!

建立一個Linux卷

fas8020-1>

fas8020-1>

fas8020-1>

fas8020-1> vol create linux aggr0 100m

Creation of volume 'linux' with size 100m on containing aggregate

'aggr0' has completed.

fas8020-1>

fas8020-1>

fas8020-1>

配置linux 卷共享通路

預設linux 卷的權限是放開的,就是所有主機都可以mount

/vol/linux      -sec=sys,rw,nosuid

主機挂載

[[email protected] /]#

[[email protected] /]# mkdir nfs

[[email protected] /]#

[[email protected] /]# mount 100.100.100.39:/vol/linux /nfs

[[email protected] /]#

設定所有的主機都有讀寫權限

fas8020-1>

fas8020-1> exportfs -p rw,anon=0,sec=sys /vol/linux

fas8020-1> rdfile /etc/exports

#Auto-generated by setup Wed Jul  1 07:42:44 GMT 2020

/vol/vol0       -sec=sys,rw,anon=0,nosuid

/vol/vol0/home  -sec=sys,rw,nosuid

/vol/windows    -sec=sys,rw,nosuid

#/vol/linux     -sec=sys,rw,nosuid

/vol/linux      -sec=sys,rw,anon=0

fas8020-1>

主機1讀寫測試

100.100.100.38 Linux主機

[[email protected] nfs]# cat >test_file01.txt

this is test file on 100.100.100.38!

^C

[[email protected] nfs]#

[[email protected] nfs]# ls

test_file01.txt

[[email protected] nfs]# cat test_file01.txt

this is test file on 100.100.100.38!

[[email protected] nfs]#

主機2讀寫測試

100.100.100.4

[[email protected] /]#

[[email protected] /]# mount 1100.100.100.39:/vol/linux /nfs

[[email protected] /]#

[[email protected] /]# df -Th

Filesystem              Type      Size  Used Avail Use% Mounted on

devtmpfs                devtmpfs  7.9G     0  7.9G   0% /dev

tmpfs                   tmpfs     7.9G     0  7.9G   0% /dev/shm

tmpfs                   tmpfs     7.9G   65M  7.8G   1% /run

tmpfs                   tmpfs     7.9G     0  7.9G   0% /sys/fs/cgroup

/dev/mapper/centos-root xfs        49G  3.1G   46G   7% /

/dev/sda1               xfs      1014M  258M  757M  26% /boot

tmpfs                   tmpfs     1.6G     0  1.6G   0% /run/user/0

100.100.100.39:/vol/linux  nfs        80M  256K   80M   1% /nfs

[[email protected] /]#

[[email protected] nfs]#

[[email protected] nfs]# cat >test_file02.txt

this is test file on 1100.100.100.4!!!

^C

[[email protected] nfs]#

[[email protected] nfs]# ls

test_file01.txt  test_file02.txt

[[email protected] nfs]# cat test_file01.txt

this is test file on 100.100.100.38!

[[email protected] nfs]# cat test_file02.txt

this is test file on 1100.100.100.4!!!

[[email protected] nfs]#

設定特定的主機

讀寫權限

fas8020-1>

fas8020-1> exportfs -p rw=100.100.100.38,anon=0,sec=sys /vol/linux

fas8020-1>

隻有100.100.100.38有權限

其他主機則不能讀寫!

[[email protected]~]#

[[email protected] ~]# mount 100.100.100.39:/vol/linux /nfs

mount.nfs: access denied by server while mounting (null)

[[email protected] ~]# mount 100.100.100.39:/vol/linux /tmp

mount.nfs: access denied by server while mounting 10.83.35.39:/vol/linux

[[email protected] ~]#

[[email protected] ~]#

########################################################################

[[email protected] nfs]# ls

test_file01.txt  test_file02.txt

[[email protected] nfs]#

[[email protected] nfs]#

[[email protected] nfs]# cat >test_file03.txt

this is test_file03 on 100.100.100.38!!!

^C

[[email protected] nfs]# ls

test_file01.txt  test_file02.txt  test_file03.txt

[[email protected] nfs]#