2015年11月25日 星期三

nfs server step

Server 端

Using NFS to Share Files

NFS (Network File System) is another way of sharing files across a network. It is used primarily in Linux and UNIX systems, although there are NFS clients for Windows.

Installing NFS

1. Use the following command to install NFS:
   rpm -qa nfs-utils nfs-utils-lib 檢查有無安裝 NFS Package
 
   or

   yum -y install nfs-utils nfs-utils-lib

Configuring NFS

Configuration of NFS is pretty simple. You add the directories you wish to export to the file /etc/exports.

2. Create a directory called /public with the following command:

   mkdir -p /u01/app/oracle/oradata/arch

3. Next, edit the file /etc/exports:

   vi /etc/exports

4. Add the following line to /etc/exports:
   
   ex: /public    *(ro,sync)

   /u01/app/oracle/oradata/arch 10.1.1.59(rw,no_root_squash,no_all_squash,sync)

5. Mount
   [root@standby ~]# exportfs -r 重新掛載 /etc/exports 裡面的設定
   [root@standby ~]# exportfs -v
   /u01/app/oracle/oradata/arch 10.1.1.59(rw,wdelay,no_root_squash,no_subtree_check,anonuid=65534,anongid=65534)
   [root@standby ~]# showmount -e localhost
   Export list for localhost:
   /u01/app/oracle/oradata/arch 10.1.1.59

Then, start the nfs server:

        /etc/rc.d/init.d/nfs start

Client 端

確認是否有 server 端是否有提供 NFS 掛載
[root@primary ~]$ showmount -e 10.1.1.60
Export list for 10.1.1.60:
/u01/app/oracle/oradata/arch 10.1.1.59

--add parameter
vim /etc/fstab
10.1.1.60:/u01/app/oracle/oradata/arch    /u01/app/oracle/oradata/arch               nfs     rw              0 0

手動 mount
# mount -t nfs 10.1.1.60:/u01/app/oracle/oradata/arch /u01/app/oracle/oradata/arch

若 alert log file 出現下面錯誤訊息
ORA-27086: unable to lock file - already in use
Linux-x86_64 Error: 37: No locks available
Additional information: 10

解决方法:掛載時使用 nolock 參數
# umount /u02/arch/
# mount -o nolock -t nfs 10.1.1.60:/backup/arch /u02/arch/

沒有留言: