NAS (Network Area Storage) -preformatted folder/file system is exported eg. Samba/cifs, NFS.
======================================================================
Common Confusion
Block Level vs File Level Storage.
Block level eg. SAN In its most basic form, think of block level storage as a hard drive in a
server except the hard drive happens to be installed in a remote
chassis and is accessible using Fibre Channel or iSCSI.
File level storage devices are often used to share files with users. By creating a block-based volume and then installing an operating system and attaching to that volume, you can share files out using that native operating system. Remember, when you use a block-based volume, you're basically using a blank hard drive with which you can do anything.
File level use cases are generally:
Block Level Storage uses : -======================================================================
Common Confusion
Block Level vs File Level Storage.
Block level eg. SAN In its most basic form, think of block level storage as a hard drive in a
server except the hard drive happens to be installed in a remote
chassis and is accessible using Fibre Channel or iSCSI.File level storage devices are often used to share files with users. By creating a block-based volume and then installing an operating system and attaching to that volume, you can share files out using that native operating system. Remember, when you use a block-based volume, you're basically using a blank hard drive with which you can do anything.
File level use cases are generally:
- Mass file storage. When your users simply need a place to store files, file-level devices can make a lot of sense.
- VMware (think NFS). VMware hosts can connect to storage presented via NFS in addition to using block level storage.
- Databases. This is especially true when you want to cluster databases, since clustered databases need shared storage.
- Exchange. Although Microsoft has made massive improvements to Exchange, the company still does not support file level or network-based (as in, CIFS or NFS) storage. Only block level storage is supported.
- VMware. Although VMware can use file level storage via Network File System (NFS), it's very common to deploy VMware servers that use shared VMFS volumes on block level storage.
- Server boot. With the right kind of storage device, servers can be configured to boot from block level storage.
------------------------------------------------------------------------------------------------------------------------
Network File System (NFS) is a distributed file system protocol originally developed by Sun Microsystems allowing a user on a client computer to access files over a network in a manner similar to how local storage is accessed.
it relies on RPC port mapper service which dynamically allocate ports. rpc convert normal operation like rw,change permission etc to remote action.
feautures:-
- transparent access to remote file system ~ clients are unaware that files are distributed and can access them in the same way as local files are accessed.
- supports version 2,3,4
- support tcp and udp
- finete number of connections between client/server
- dynamic ports allocation may not always work due to firewalls.
IP address of this LAB NFS Server is 192.168.0.11
#yum install nfs-utils //includes both clientserver pkgs
#chkconfig rpcbind on
#service rpcbind start
#service nfs start && chkconfig nfs on
to configure specific ports for rpc and nfs to listen to =>
#vim /etc/sysconfig/nfs
search for word "PORT" and uncomment them
[root@server5 ~]#service nfs restart
[root@server5 ~]#service nfslock restart //to unlock locked ports if held by clients
to look rpc and nfs services and ports program id
[root@server5 ~]#rpcinfo -p localhost // -p = probe,display list of all registered RPC programmes
if you want to make query from client
[root@Client ~]#/etc/init.d/rpcbind start
[root@Client ~]#rpcinfo -p <nfsserver ip> //to check ports if opened
-----------------------------------------------------------------------------------------------------
now allow ports through iptables
#mkdir /nfs_share
#vim /etc/exports //we share nfs directory in this file
/projectx *(rw) // rw export to all clients having our ip access (careful!)
/projecty 192.168..0.100(rw) 192.168.0.101(ro) //rw=readwrite ro=readonly
/shared 192.168.0.103(ro,root_squash) //root_squash= root client cant write and is by default
/nfs_share 192.168.0.100(rw)
----------------------------------------------------------------------------------------------------
[root@server5 ~]#exportfs -r //refresh exports
[root@server5 ~]#exportfs -v //dumps current exports
-----------------------------------------------------------
AT NFS client
[root@Client ~] showmount -e 192.168.0.11 //nfs server ip addr
exportlist for 192.168.0.11
nfs_share *
[root@Client ~]mount -t nfs 192.168.0.11:/nfs_share /shared_data
permanent mount
#vim /etc/fstab
192.168.0.11:/nfs_share /shared_data1 nfs defaults 0 0
192.168.0.11:/nfs_share2 /shared_data2 nfs defaults,soft,time=10,retry=2 0 0
if soft,time=10,retry=2 means any prog trying to access share wont get hang, timeout is 10 sec and retry is 2
check the mounted dir using df -h or mount
------------------------------------------------------------------
#chkconfig rpcbind on
#service rpcbind start
#service nfs start && chkconfig nfs on
to configure specific ports for rpc and nfs to listen to =>
#vim /etc/sysconfig/nfs
search for word "PORT" and uncomment them
[root@server5 ~]#service nfs restart
[root@server5 ~]#service nfslock restart //to unlock locked ports if held by clients
to look rpc and nfs services and ports program id
[root@server5 ~]#rpcinfo -p localhost // -p = probe,display list of all registered RPC programmes
if you want to make query from client
[root@Client ~]#/etc/init.d/rpcbind start
[root@Client ~]#rpcinfo -p <nfsserver ip> //to check ports if opened
-----------------------------------------------------------------------------------------------------
now allow ports through iptables
[root@server5 ~]#iptables -I INPUT -m state --state NEW -p tcp -m multiport --dport 111,892,2049,32803 -s 192.168.0.0/24 -j ACCEPT
[root@server5 ~]#iptables -I INPUT -m state --state NEW -p udp -m multiport --dport 111,892,2049,32769 -s 192.168.0.0/24 -j ACCEPT
OR--------------------------------------
[root@server5 ~]#iptables -N NFS
[root@server5 ~]# iptables -I NFS -m state --state NEW -p tcp -m multiport --dport 111,892,2049,32803 -s 192.168.0.0/24 -j ACCEPT
[root@server5 ~]# iptables -I NFS -m state --state NEW -p udp -m multiport --dport 111,892,2049,32769 -s 192.168.0.0/24 -j ACCEPT
[root@server5 ~]# service iptables save
iptables: Saving firewall rules to /etc/sysconfig/iptables:[ OK ]
[root@server5 ~]# iptables -I NFS -m state --state NEW -p tcp -m multiport --dport 111,892,2049,32803 -s 192.168.0.0/24 -j ACCEPT
[root@server5 ~]# iptables -I NFS -m state --state NEW -p udp -m multiport --dport 111,892,2049,32769 -s 192.168.0.0/24 -j ACCEPT
[root@server5 ~]# service iptables save
iptables: Saving firewall rules to /etc/sysconfig/iptables:[ OK ]
-------------------------------------------------------------------------------------------------------
#vim /etc/exports //we share nfs directory in this file
/projectx *(rw) // rw export to all clients having our ip access (careful!)
/projecty 192.168..0.100(rw) 192.168.0.101(ro) //rw=readwrite ro=readonly
/shared 192.168.0.103(ro,root_squash) //root_squash= root client cant write and is by default
/nfs_share 192.168.0.100(rw)
----------------------------------------------------------------------------------------------------
[root@server5 ~]#exportfs -r //refresh exports
[root@server5 ~]#exportfs -v //dumps current exports
-----------------------------------------------------------
AT NFS client
[root@Client ~] showmount -e 192.168.0.11 //nfs server ip addr
exportlist for 192.168.0.11
nfs_share *
[root@Client ~]mount -t nfs 192.168.0.11:/nfs_share /shared_data
permanent mount
#vim /etc/fstab
192.168.0.11:/nfs_share /shared_data1 nfs defaults 0 0
192.168.0.11:/nfs_share2 /shared_data2 nfs defaults,soft,time=10,retry=2 0 0
if soft,time=10,retry=2 means any prog trying to access share wont get hang, timeout is 10 sec and retry is 2
check the mounted dir using df -h or mount
------------------------------------------------------------------

No comments:
Post a Comment