Home > OS >  How the NAS NFS support secondary or multistage cascade mount?
How the NAS NFS support secondary or multistage cascade mount?

Time:11-14

Requirements: suppose you have server A, B, C, AB, BC, AC impassability (network isolation), NAS space on how to access A server C (NFS) share?
Such as A file system on the server through the NFS Shared with B, through Shared with C, B
I do an experiment: create/fs1 directory on the server A, mount to B/test/fs1 directory; Then B/test directory mounted to C/fs1 directory, then C can't see the inside of the A/fs1 on the content,

CodePudding user response:

Demand
Description
Server A 10.211.55.9 (EM)
Server B 10.211.55.4 (JP)
Server C 10.211.55.7 (DD)

AB, BC, AC impassability
The server on A file system over NFS Shared with B, with B and then Shared with
C

Build simulation environment:
In add A firewall rule, refuse the request of C
Firewall -cmd, permanent, aC - rich - rule="family rule=" ipv4 "source aCress=" 10.211.55.7 "reject"
Firewall - CMD - reload
Add firewall rules in C, refuse A request
Firewall -cmd, permanent, aC - rich - rule="family rule=" ipv4 "source aCress=" 10.211.55.9 "reject"
Firewall - CMD - reload

Server AC mutual links,


Server AB communication


BC exchange server



NFS cascade scheme (test temporarily infeasible)
Server A 10.211.55.9 (EM)
Server B 10.211.55.4 (JP)
Server C 10.211.55.7 (DD)
A Shared directory server/publica
A Shared directory server
? Only reading and writing way of sharing in the mesh/publica can be 10.211.55.0/24 system access
Yum install - y NFS - utils
The mkdir/publica
Touch/publica/test. The text
The mkdir -p/publica/test

Vim/etc/exports
/publica 10.211.55.0/24 (rw, sync, no_root_squash, insecure)

Vim/etc/sysconfig/NFS
RPCNFSDARGS="4.2 - V
"
Firewall - CMD - permanent - add - service=NFS
Firewall - CMD - permanent - add - service=mountd
Firewall - CMD - permanent - add - service=RPC - bind
Firewall - CMD - reload

Systemctl enable NFS - server
Systemctl restart the NFS server -

Exportfs - ra
Showmount -e
Server/publica B mount server directory to/MNT/publica
?/publica hung on in the following directory/MNT/publica
? When powered up for the file system in automatically mount
Showmount -e 10.211.55.9

The mkdir -p/MNT/publica

Vim/etc/fstab
10.211.55.9:/publica/MNT/publica NFS defaults, _netdev 0 0

The mount - a
The ls/MNT/publica
The mount | grep/MNT/publica
Shared directory server B/MNT/publica
Yum install - y NFS - utils

Vim/etc/exports
24 (/MNT/publica 10.211.55.0/rw, sync, no_subtree_check and fsid=0, no_root_squash, insecure)

Vim/etc/sysconfig/NFS
RPCNFSDARGS="4.2 - V
"
Firewall - CMD - permanent - add - service=NFS
Firewall - CMD - permanent - add - service=mountd
Firewall - CMD - permanent - add - service=RPC - bind
Firewall - CMD - reload

Systemctl enable NFS - server
Systemctl restart the NFS server -

Exportfs - ra
# exportfs/MNT/publica does not support NFS export
Showmount -e # error above showmount can still see the directory
Exportfs - au


To export the NFS mount point, this is not possible,
Reference: https://superuser.com/questions/1146383/exportfs-does-not-support-nfs-export

Server C mount the directory server B/MNT/publica to/MNT/2 nd/publica
?/MNT/publica hung on in the directory/MNT/2 nd/publica
? When powered up for the file system in automatically mount
Showmount -e 10.211.55.4

The mkdir -p/MNT/2 nd/publica

Vim/etc/fstab
10.211.55.4:/MNT/publica/MNT/2 nd/publica NFS defaults, _netdev 0 0

The mount - a
. # # the mount NFS access denied by server while mounting 10.211.55.4:/MNT/publica
# # #
The ls/MNT/2 nd/publica
Wrong reference: https://www.thegeekdiary.com/mount-nfs-access-denied-by-server-while-mounting-how-to-resolve/

Samba cascade mount (success)

Server A 10.211.55.9 (EM)
Server B 10.211.55.4 (JP)
Server C 10.211.55.7 (DD)
A Shared directory server/commona
? Your SMB service must be a member of the STAFF working group when
? Shared directory is Shared name commona
? Only 10.211.55.0/24 domain customers can access Shared commona
? Can read and write when commona must
? Root user must be able to take share content, if you need to verify password is redhat

Yum install samba - y
The mkdir -p/commona
Touch/commona/test. TXT
The mkdir -p/commona/test
Setsebool - P=on # # to cancel samba_export_all_rw selinux limits
The semanage fcontext - a - t samba_share_t '/commona (/. *)? '
Restorecon - R/commona/# recovery selinux file attributes, file security context)
Setfacl - m u: root: RWX/commona
Pdbedit - a root # # enable Shared account and set up the redhat
Vim/etc/samba/SMB. Conf
The [global]
Workgroup=STAFF
[commona]
Path=/commona
Write a list=root
Valid users=root
Hosts allow=10.211.55.0/24


Systemctl restart SMB NMB
Systemctl enable SMB NMB
Firewall - CMD - permanent - add - service=samba
Firewall - CMD - reload

Server/commona B mount server directory to/MNT/commona
?/commona hung on in the following directory/MNT/commona
? When powered up for the file system in automatically mount
Yum install samba - client cifs - utils - y & gt;/dev/null
The mkdir -p/MNT/commona

Vim/etc/fstab
//10.211.55.9 commona/MNT/commona cifs username=root, password=redhat, multiuser, the SEC=NTLMSSP, _netdev 0 0

The mount - a
Df/MNT/commona
Touch/MNT/commona testb # success
Shared directory server B/MNT/commona
? Your SMB service must be a member of the STAFF working group when
? Shared directory is Shared name commona
? Only 10.211.55.0/24 domain customers can access Shared commona
? Can read and write when commona must
? Root user must be able to take share content, if you need to verify password is redhat
Yum install samba - y
Setsebool - P=on # # to cancel samba_export_all_rw selinux limits
The semanage fcontext - a - t samba_share_t '/MNT/commona (/. *)? '
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related