Oracle Technologies Blog

By ASKM

11gR2 – RAC Shared Storage Preparation(NFS) – Part3

Posted by Srikrishna Murthy Annam on March 24, 2010

RAC Shared Storage Preparation(NFS):

The Network File System (NFS) was developed to allow machines to mount a disk partition on a remote machine as if it were on a local hard drive. This allows for fast, seamless sharing of files across a network. The advantage of NFS today is that it is mature, standard, well understood, and supported robustly across a variety of platforms.

Check if the system supports NFS File system:

$ cat /proc/filesystems

Verifying that NFS is running:
To do this, query the portmapper with the command rpcinfo -p to find out what services it is providing. You should get something like this:

program vers proto port
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
100011 1 udp 749 rquotad
100011 2 udp 749 rquotad
100005 1 udp 759 mountd
100005 1 tcp 761 mountd
100005 2 udp 764 mountd
100005 2 tcp 766 mountd
100005 3 udp 769 mountd
100005 3 tcp 771 mountd
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
300019 1 tcp 830 amd
300019 1 udp 831 amd
100024 1 udp 944 status
100024 1 tcp 946 status
100021 1 udp 1042 nlockmgr
100021 3 udp 1042 nlockmgr
100021 4 udp 1042 nlockmgr
100021 1 tcp 1629 nlockmgr
100021 3 tcp 1629 nlockmgr
100021 4 tcp 1629 nlockmgr

This says that we have NFS versions 2 and 3, rpc.statd version 1, network lock manager (the service name for rpc.lockd) versions 1, 3, and 4. There are also different service listings depending on whether NFS is travelling over TCP or UDP. Linux systems use UDP by default unless TCP is explicitly requested; however other OSes such as Solaris default to TCP.

If you do not at least see a line that says “portmapper”, a line that says “nfs”, and a line that says “mountd” then you will need to backtrack and try again to start up the daemons

Setting up the Configuration files:
There are three main configuration files you will need to edit to set up an NFS server: /etc/exports, /etc/hosts.allow, and /etc/hosts.deny. Strictly speaking, you only need to edit /etc/exports to get NFS to work, but you would be left with an extremely insecure setup.

An entry in /etc/exports will typically look like this:

directory machine1(option11,option12) machine2(option21,option22)

First we need to set up some NFS shares. In this case we will do this on the RAC1 node, but you can do the on a NAS or a third server if you have one available. On the RAC1 node create the following directories.

mkdir /home/nfs/config
mkdir /home/nfs/grid
mkdir /home/nfs/oracle_home
mkdir /home/nfs/data

Add the following lines to the /etc/exports file

/home/nfs/config               *(rw,sync,no_wdelay,insecure_locks,no_root_squash)
/home/nfs/grid                 *(rw,sync,no_wdelay,insecure_locks,no_root_squash)
/home/nfs/oracle_home          *(rw,sync,no_wdelay,insecure_locks,no_root_squash)
/home/nfs/data                 *(rw,sync,no_wdelay,insecure_locks,no_root_squash)

Then restart the nfs services

# /etc/init.d/nfs restart

On both RAC1 and RAC2 create the local directories in which the Oracle software will be installed.

mkdir -p /u01/app/11.2.0/grid
mkdir -p /u01/app/oracle/product/11.2.0/db_1
mkdir -p /u01/oradata
mkdir -p /u01/config
chown -R oracle:oinstall /u01/app /u01/app/oracle /u01/oradata /u01/config
chmod -R 775 /u01/app /u01/app/oracle /u01/oradata /u01/config

Mount the nfs shares on to local directories :

# mount -t nfs <RAC1 IP>:/home/nfs/config /u01/config
# mount -t nfs <RAC1 IP>:/home/nfs/grid /u01/app/11.2.0/grid
# mount -t nfs <RAC1 IP>:/home/nfs/oracle_home /u01/app/oracle/product/11.2.0/db_1
# mount -t nfs <RAC1 IP>:/home/nfs/data /u01/oradata
# mount -t nfs <RAC2 IP>:/home/nfs/config /u01/config
# mount -t nfs <RAC2 IP>:/home/nfs/grid /u01/app/11.2.0/grid
# mount -t nfs <RAC2 IP>:/home/nfs/oracle_home /u01/app/oracle/product/11.2.0/db_1
# mount -t nfs <RAC2 IP>:/home/nfs/data /u01/oradata

Configure automount
To make this completely transparent to end users, you can automount the NFS file system every time a user boots a PC, or you can also use PAM modules to mount once a user logs in with a proper username and password. In this situation just edit /etc/fstab to mount system automatically during a system boot.

#echo “<RAC1 IP>:/home/nfs/config /u01/config  nfs  defaults 0 0” >> /etc/fstab
#echo “<RAC1 IP>:/home/nfs/grid   /u01/app/11.2.0/grid  nfs  defaults 0 0” >> /etc/fstab
#echo “<RAC1 IP>:/home/nfs/oracle_home   /u01/app/oracle/product/11.2.0/db_1  nfs  defaults 0 0” >> /etc/fstab
#echo “<RAC1 IP>:/home/nfs/data   /u01/oradata  nfs  defaults 0 0” >> /etc/fstab
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: