The Basics
NFS vs iscsi
- NFS can handle simultaniously writing from several clients.
- NFS is a filesystem , iscsi is a block storage.
- iscsi performance are same with NFS.
- iscsi will appear as disk to the OS, not the case for NFS.
Concurrent access to a block device like iSCSI is not possible with standard file systems. You’ll need a shared disk filesystem (like GFS or OCSFS) to allow this, but in most cases the easiest solution would be to just use a network share (via SMB/CIFS or NFS) if this is sufficient for your application.
Server side
- Install
1sudo yum install nfs-utils
2sudo systemctl enable --now nfs-server rpcbind
3
4sudo firewall-cmd --add-service={nfs,mountd,rpc-bind} --permanent
5sudo firewall-cmd --reload
6
7sudo setsebool -P nfs_export_all_rw 1
- Configure
1vi /etc/exports
2/backup 172.16.119.150(rw,async,root_squash)
3/backup 172.16.119.151(rw,async,root_squash)
- Start
1/bin/systemctl start nfs-server.service
2exportfs -rav
- Checks
1# Show exports from server side
2showmount -e
3
4# Show client which are currently mounting
5showmount -a
Client Side
- First check if you can access the export
1showmount --exports 172.16.239.10
2Export list for 172.16.239.10:
3/volume2/exportdb-dev-nfs 172.16.239.1,172.16.239.2,172.16.239.102,172.16.239.101
4/volume1/exportdb 172.16.233.0/24
- Open firewalld
1firewall-cmd --zone=backup --add-service=nfs --permanent
2firewall-cmd --reload
- Mount
1mount -t nfs 172.16.239.10:/volume2/exportdb-dev-nfs /backup_tmp
2
3chown -R oracle:oinstall /backup_tmp/
4chmod -R 644 /backup_tmp/
- Checks
1# show all NFS mounts
2nfsstat -m
- Add to fstab
1# Below an example for RMAN backup
2172.16.239.10:/volume2/exportdb-dev-nfs /backup nfs hard,rw,noac,rsize=32768,wsize=32768,proto=tcp,vers=4 0 1
Comments