Using NFS with ASM

来源:互联网 发布:广州移动宽带 知乎 编辑:程序博客网 时间:2024/06/11 05:31

Using NFS with ASM

Both ASM and NFS individually provide shared storage for use with RAC installations, but the two technologies can be combined allowing ASM to access files shared over NFS. Why would you want to do this? In most cases you probably wouldn’t. If you are using NFS already, adding in the ASM layer is an unnecessary complication, but there are some situations where it might be useful:

You want to take advantage of the rebalancing functionality of ASM even though you are using NFS as your shared storage.
You have multiple storage tiers (DAS/SAN and NAS) and would like them all to be managed by ASM.
Some desktop virtualization tools (VirtualBox (fixed in 3.2.8) and VMware Fusion) do not allow shared disks, so the only way to install RAC on them is to use NFS for the shared storage. If you want to demonstrate ASM and RAC in these environments then you will need to consider combining NFS and ASM.
I’m not at all convinced by the first two options, but the last one is of great interest to me.

This article shows you the steps necessary to combine NFS and ASM for your shared storage layer. I’m specifically thinking about 11gR2, where ASM is part of the Grid Infrastructure installation, but the method will work for previous releases also.

FYI, on 12c and 18.1, AFD cannot manage devices that are confgiured on NAS anymore.

NFS Share Setup

On the NFS server create a directory to hold the shared files.

# mkdir -p /u01/VM/nfs_shares/asm_test

Add the following line into the “/etc/exports” file. The export options are important, so don’t alter them unless you understand why you are doing it.

/u01/VM/nfs_shares/asm_test *(rw,sync,no_wdelay,insecure_locks,no_root_squash)

Make sure the NFS daemon is running.

# chkconfig nfs on# service nfs restart

NFS Mount Setup

On each machine that needs access to the NFS file system, perform the following operations.

Create a directory as a mount point for the NFS shares.

# mkdir -p /u01/oradata# chown oracle:oinstall /u01/oradata

Add the following line to the “/etc/fstab” file, where “nas1” should be the name of the NFS server. The mount options are important, so only alter them if you know what you are doing.

nas1:/u01/VM/nfs_shares/asm_test /u01/oradata nfs rw,bg,hard,nointr,tcp,vers=3,timeo=600,rsize=32768,wsize=32768,actimeo=0 0 0

Mount the file system and set the ownership.

mount /u01/oradatachown -R oracle:oinstall /u01/oradata

Create Shared Files

We can use the “dd” command to create some empty files to present to ASM as devices. Since these are shared files this only needs to be done once regardless of whether this is a single instance or a RAC installation. Here I create 5 separate 10 Gig files.

# su - oracle$ dd if=/dev/zero of=/u01/oradata/asm_dsk1 bs=1k count=10000000$ dd if=/dev/zero of=/u01/oradata/asm_dsk2 bs=1k count=10000000$ dd if=/dev/zero of=/u01/oradata/asm_dsk3 bs=1k count=10000000$ dd if=/dev/zero of=/u01/oradata/asm_dsk4 bs=1k count=10000000$ dd if=/dev/zero of=/u01/oradata/asm_dsk5 bs=1k count=10000000

Then we can use these shared files to create ASM DG.

Reference

Find full text on Using NFS with ASM.

原创粉丝点击