Showing posts with label nfs. Show all posts
Showing posts with label nfs. Show all posts

Friday, May 27, 2016

mount to NFS server failed: RPC Error: Program not registered.

Mounting to an NFS location was failing with following error. This was an existing NFS mount location which worked fine earlier.
mount -t nfs -o rw,hard,rsize=32768,wsize=32768,vers=3,nointr,timeo=600,tcp,nolock,actimeo=0 nfs-server:/home/oracle/backup/ /home/oracle/dbbackup
mount: mount to NFS server 'nfs-server' failed: RPC Error: Program not registered.
Showmount to the nfs-server also fails with
showmount -e nfs-server
mount clntudp_create: RPC: Program not registered
To fix this restart the nfs related services in the following order on the nfs server. First rpcbind service
[root@nfs-server ~]# service rpcbind start
Starting rpcbind:                                          [  OK  ]
Second the nfs service
[root@nfs-server ~]# service nfs start
Starting NFS services:                                     [  OK  ]
Starting NFS quotas:                                       [  OK  ]
Starting NFS mountd:                                       [  OK  ]
Starting NFS daemon:                                       [  OK  ]
Starting RPC idmapd:                                       [  OK  ]
Finally the portmap service
[root@nfs-server ~]# service portmap start
Starting portmap:                                          [  OK  ]


Afterwards NFS mount works without issue
# mount -t nfs -o rw,hard,rsize=32768,wsize=32768,vers=3,nointr,timeo=600,tcp,nolock,actimeo=0 10.10.0.102:/home/oracle/backup/ /home/oracle/dbbackup
# df -h
Filesystem            Size  Used Avail Use% Mounted on

xx.xx.x.xxx:/home/oracle/backup/
                      526G  407G   93G  82% /home/oracle/dbbackup
Related Posts
RMAN Backups on NFS
Direct NFS Setup

Tuesday, December 8, 2015

Direct NFS Setup

This post shows steps for setting up directNFS for 11.2 and 12.1 (steps are identical). For 11.1 please refer here.
Direct NFS requires a working NFS setup to already exists. Create a NFS setup and mount the NFS on the local server with oracle recommended nfs mount options (refer 359515.1) For this test case (tested with 11.2 and 12.1 both SE, SE2 and EE) nfs mount is as follows
# mount
...
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
nfsd on /proc/fs/nfsd type nfsd (rw)
192.168.0.104:/opt/backup on /usr/local/ochm/nfsdir type nfs (rw,hard,rsize=32768,wsize=32768,nfsvers=3,nointr,timeo=600,tcp,nolock,actimeo=0,addr=192.168.0.104)
Add an entry to fstab as well
# cat /etc/fstab
...
192.168.0.104:/opt/backup /usr/local/ochm/nfsdir        nfs     rw,hard,rsize=32768,wsize=32768,nfsvers=3,nointr,timeo=600,tcp,nolock,actimeo=0,addr=192.168.0.104 0 0
Test to see if the oracle user has write permission on the nfs mount point by creating dummy files. When the nfs is working without any issues configure the oracle to use direct nfs.
Enable direct nfs by executing the rdbms make with dnfs on.
cd $ORACLE_HOME/rdbms/lib
make -f ins_rdbms.mk dnfs_on
rm -f /opt/app/oracle/product/12.1.0/std2/rdbms/lib/odm/libnfsodm12.so; \
    cp /opt/app/oracle/product/12.1.0/std2/lib/libnfsodm12.so /opt/app/oracle/product/12.1.0/std2/rdbms/lib/odm/libnfsodm12.so
To disable direct NFS use
make -f ins_rdbms.mk dnfs_off
rm -f  /opt/app/oracle/product/12.1.0/std2/rdbms/lib/odm/libnfsodm12.so
Verify if the oradism is owned by root and has setuid.
# ls -l $ORACLE_HOME/bin/oradism
-rwsr-x--- 1 root oinstall 71758 Sep 17  2011 /opt/app/oracle/product/12.1.0/std2/bin/oradism
If oradism has wrong permission or ownership correct it as follows
# chown root:oinstall $ORACLE_HOME/bin/oradism
# chmod 4755 $ORACLE_HOME/bin/oradism
Direct NFS searches for mount entries in following files in the given order
1.$ORACLE_HOME/dbs/oranfstab
2. /etc/oranfstab
3. /etc/mtab
In this case an oranfstab file is created as follows
cat oranfstab
server: hpc1nfsmount
local: 192.168.0.66
path:   192.168.0.104
export: /opt/backup mount: /usr/local/ochm/nfsdir
local: 192.168.0.66 is the IP of the local server where the database is running. path: 192.168.0.104 is the IP of the server which provides the NFS storage (i.e. NFS server). export: /opt/backup is the export location on the NFS server. mount: /usr/local/ochm/nfsdir is the mount point local server.

Once the dnfs is enabled start the database. If the dnfs is in use the alert log will have the following line
Oracle instance running with ODM: Oracle Direct NFS ODM Library Version 3.0




However there won't be any dnfs related info available on the views
SQL> select * from v$dnfs_servers;

no rows selected

SQL> select * from v$dnfs_files;

no rows selected
Create a tablespace using the nfs location.
SQL> create tablespace nfstbs datafile '/usr/local/ochm/nfsdir/nfs.dbf'  size 10m;
When the tablespace is being created the alert log will show the dnfs being used
Fri Oct 09 11:16:01 2015
create tablespace nfstbs datafile '/usr/local/ochm/nfsdir/nfs.dbf'  size 10m
Fri Oct 09 11:16:02 2015
Direct NFS: channel id [0] path [192.168.0.104] to filer [192.168.0.104] via local [] is UP
Completed: create tablespace nfstbs datafile '/usr/local/ochm/nfsdir/nfs.dbf'  size 10m
Once the tablespace is created the dnfs views will show the relevant information
SQL> select * from v$dnfs_servers;

        ID SVRNAME              DIRNAME                           MNTPORT    NFSPORT      WTMAX      RTMAX
---------- -------------------- ------------------------------ ---------- ---------- ---------- ----------
         1 192.168.0.104        /opt/backup                         56904       2049    1048576    1048576
   
SQL> select * from v$dnfs_files;

FILENAME                         FILESIZE       PNUM     SVR_ID
------------------------------ ---------- ---------- ----------
/usr/local/ochm/nfsdir/nfs.dbf   10493952         10          1
The same servers and setup was used to test the direct nfs on 11.1 SE as well. The dNFS ODM version is lower than 11.2 and 12.1
Oracle instance running with ODM: Oracle Direct NFS ODM Library Version 2.0
The NFS version was v3
# nfsstat | grep nfs
Server nfs v3:
Client nfs v3:
However this did not succeed creating tablespaces in the 11.1 even after mounting the nfs with a lower version
192.168.0.104:/opt/backup on /usr/local/ochm/nfsdir type nfs (rw,hard,rsize=32768,wsize=32768,nfsvers=2,nointr,timeo=600,tcp,nolock,actimeo=0,addr=192.168.0.104)
Related Post
RMAN Backups on NFS

Friday, December 12, 2014

RMAN Backups on NFS

There are many options for mounting NFS to be used with various oracle files (binaries, datafiles, OCR). This post shows results of three mount options used and backup time for a single tablespace (size 16GB) using RMAN. The database is a single instance 11.2.0.3 database. Both NFS server and client were on the same network segment connected via a single switch.
NFS server export file content
 more /etc/exports
/opt/backup 192.168.0.66(rw,sync,all_squash,insecure,anonuid=500,anongid=500)
anonuid and anongid represent user id and group id of oracle user on NFS client (server running the DB). no_root_squash has not been used.
Options used for mounting the NFS are
1. mount -t nfs -o rw,hard,rsize=32768,wsize=32768,vers=3,nointr,timeo=600,tcp,nolock 192.168.0.76:/opt/backup /opt/backup (backup time : 06:45)

2. mount -t nfs 192.168.0.76:/opt/backup /opt/backup (backup time : 07:05)

3. mount -t nfs -o rw,hard,rsize=32768,wsize=32768,vers=3,nointr,timeo=600,tcp,nolock,actimeo=0 192.168.0.76:/opt/backup /opt/backup (backup time : 06:35)

In test 1 the mount is without actimeo. Test 2 doesn't specify any mount options and rely on default options. In test 3 the options are similar to test 1 with the exception of actimeo being included.
There's some confusion as to when to use actimeo option. Some documents state it explicitly not to use noac option with RMAN yet says nothing explicitly about actimeo option. At the same time it is stated that it could be used with single instance databases (359515.1) while others explicitly state not to use actimeo with single instance and only required for RAC (1164673.1,762374.1). Neverthless the option 3 was able to complete the backup in roughly same time as option 1. However use of noac increased the backup time unacceptably long (into hours. Not included in the post).




Below is the IO rate and throughput observed from the emconsole during each test.


Useful metalink note
Howto Optimize NFS Performance with NFS options. [ID 397194.1]
How To Setup DNFS (Direct NFS) On Oracle Release 11.2 [ID 1452614.1]
Step by Step - Configure Direct NFS Client (DNFS) on Linux (11g) [ID 762374.1]
Mount Options for Oracle files when used with NFS on NAS devices [ID 359515.1]
NFS Performance Decline Introduced by Mount Option "actimeo=0" [ID 1164673.1]