rac的共享存储有很多种搭建方式,nfs是其中一种。生产环境一般不采用nfs,多用于测试。

nfs搭建步骤大致分为如下:

1.划盘

给节点1挂载一块磁盘,并将磁盘分区,并格式化,再挂载

  1. [root@news01 softdb]# fdisk -l
  2.  
  3. Disk /dev/vda: bytes
  4. heads, sectors/track, cylinders
  5. Units = cylinders of * = bytes
  6.  
  7. Device Boot Start End Blocks Id System
  8. /dev/vda1 * Linux
  9. /dev/vda2 + Linux
  10. /dev/vda3 Linux swap / Solaris
  11.  
  12. Disk /dev/vdb: bytes
  13. heads, sectors/track, cylinders
  14. Units = cylinders of * = bytes
  15.  
  16. Device Boot Start End Blocks Id System
  17. /dev/vdb1 + Linux

我们把其中的/dev/vdb1  作为NFS磁,再将/dev/vdb1格式化

  1. [root@news01 softdb]# mkfs.ext3 /dev/vdb1
  2. mke2fs -May-)
  3. Filesystem label=
  4. OS type: Linux
  5. Block size= (log=)
  6. Fragment size= (log=)
  7. inodes, blocks
  8. blocks (5.00%) reserved for the super user
  9. First data block=
  10. Maximum filesystem blocks=
  11. block groups
  12. blocks per group, fragments per group
  13. inodes per group
  14. Superblock backups stored on blocks:
  15. , , , , , , , , ,
  16.  
  17. Writing inode tables: done
  18. Creating journal ( blocks): done
  19. Writing superblocks and filesystem accounting information: done
  20.  
  21. This filesystem will be automatically checked every mounts or
  22. days, whichever comes first. Use tune2fs -c or -i to override.

2.配置服务端

格式化好之后,创建一个目录来挂载磁盘,并编辑exports文件,重启和nfs有关的服务

  1. [root@news01 softdb]# mkdir -p /nfsdatafile
  2. [root@news01 softdb]# vi /etc/exports
  3. [root@news01 softdb]# mount /dev/vdb1 /nfsdatafile/
  4. [root@news01 softdb]# service portmap restart
  5. Stopping portmap: [ OK ]
  6. Starting portmap: [ OK ]
  7. [root@news01 softdb]# service nfs restart
  8. Shutting down NFS mountd: [FAILED]
  9. Shutting down NFS daemon: [FAILED]
  10. Shutting down NFS quotas: [FAILED]
  11. Starting NFS services: [ OK ]
  12. Starting NFS quotas: [ OK ]
  13. Starting NFS daemon: [ OK ]
  14. Starting NFS mountd: [ OK ]
  15. [root@news01 softdb]# showmount -e
  16. Export list for news01:
  17. /nfsdatafile *
  18. [root@news01 softdb]#

3.客户端挂载

在需要挂载这个nfs的节点上面,编辑fstab文件,再进行mount。需要注意的一点是,oracle的rac对nfs的参数有做要求,具体可以参考:

Mount Options for Oracle files when used with NAS devices [ID 359515.1]

节点1:

  1. [root@news01 softdb]# mkdir /nfs
  2. [root@news01 softdb]# vi /etc/fstab
  3. [root@news01 softdb]# cat /etc/fstab
  4. LABEL=/ / ext3 defaults
  5. LABEL=/boot /boot ext3 defaults
  6. tmpfs /dev/shm tmpfs defaults
  7. devpts /dev/pts devpts gid=,mode=
  8. sysfs /sys sysfs defaults
  9. proc /proc proc defaults
  10. LABEL=SWAP-vda3 swap swap defaults
  11. ,wsize=,tcp,vers=,timeo=,actimeo=
  12. [root@news01 softdb]# mount -a
  13. [root@news01 softdb]# mount
  14. /dev/vda2 on / type ext3 (rw)
  15. proc on /proc type proc (rw)
  16. sysfs on /sys type sysfs (rw)
  17. devpts on /dev/pts type devpts (rw,gid=,mode=)
  18. /dev/vda1 on /boot type ext3 (rw)
  19. tmpfs on /dev/shm type tmpfs (rw)
  20. none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
  21. sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
  22. /dev/vdb1 on /nfsdatafile type ext3 (rw)
  23. nfsd on /proc/fs/nfsd type nfsd (rw)
  24. ,wsize=,tcp,nfsvers=,timeo=,actimeo=,addr=192.168.0.188)
  25. [root@news01 softdb]#

节点2:

  1. [root@news02 softdb]# mkdir /nfs
  2. [root@news02 softdb]# vi /etc/fstab
  3. [root@news02 softdb]# mount -a
  4. [root@news02 softdb]# mount
  5. /dev/vda2 on / type ext3 (rw)
  6. proc on /proc type proc (rw)
  7. sysfs on /sys type sysfs (rw)
  8. devpts on /dev/pts type devpts (rw,gid=,mode=)
  9. /dev/vda1 on /boot type ext3 (rw)
  10. tmpfs on /dev/shm type tmpfs (rw)
  11. none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
  12. sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
  13. ,wsize=,tcp,nfsvers=,timeo=,actimeo=,addr=192.168.0.188)
  14. [root@news02 softdb]#

4.测试

以上就把2个节点的nfs配置好了,测试的时候,可以在任意一个节点的nfs目录做rw操作,再在另外一个节点查看能否正常rw。

  1. [root@news02 nfs]# vi abc.txt
  2. [root@news02 nfs]# cat abc.txt
  3.  
  4. [root@news02 nfs]# ll
  5. total
  6. -rw-r--r-- root root Mar abc.txt
  7. drwx------ root root Mar : lost+found
  8. [root@news02 nfs]#
  1. [root@news01 softdb]# cd /nfs
  2. [root@news01 nfs]# ll
  3. total
  4. -rw-r--r-- root root Mar : abc.txt
  5. drwx------ root root Mar : lost+found
  6. [root@news01 nfs]# more abc.txt
  7.  
  8. [root@news01 nfs]#

在linux配置NFS用于RAC的搭建的更多相关文章

  1. linux配置nfs步骤及心得

      这节我们介绍NFS的相关概念,以及怎样配置NFS和在client中查看NFS.   NFS的配置过程非常easy. 在server端中编辑/etc/exports文件,加入例如以下内容:      ...

  2. Linux 配置NFS,文件共享

    配置:   1.设定共享主机服务器    ---(注意防火墙) 编辑ipA端的/etc/exports 文件 [root@dbrac2 ~]# cat /etc/exports /media  192 ...

  3. Linux 配置nfs

    原文:http://www.cnblogs.com/mchina/archive/2013/01/03/2840040.html 一.NFS服务简介 NFS 是Network File System的 ...

  4. Manjaro Linux 配置nfs服务器

    NFS客户端和NFS服务端通讯过程 1.首先服务器端启动RPC服务,并开启111端口 2.服务器端启动NFS服务,并向RPC注册端口信息 3.客户端启动RPC(portmap服务),向服务端的RPC请 ...

  5. linux配置nfs服务

    简单介绍: unix/linux系统一种远程文件文件夹共享的服务,能够把某一个远程的文件文件夹共享到本地,进而像操作本地文件一样,操作这个远程的文件夹. 比如:a主机作为服务端,共享出来test1这个 ...

  6. Linux配置NFS实现共享

    (1)安装相应rpm包 sudo rpm -ivh nfs-utils-1.2.3-70.el6.x86_64.rpm (2)配置共享目录:sudo vim /etc/exports /app/sof ...

  7. 懂得分享 Linux 配置NFS共享服务

    部署YUM仓库及NFS共享服务一.YUM概述    YUM (Yellow dog Updater Modified)二.准备安装源    ① 软件仓库的提供方式    ② RPM软件包的来源    ...

  8. Linux下NFS的搭建与配置

    一.简介 1.NFS 是Network File System的缩写,即网络文件系统.一种使用于分散式文件系统的协定,由Sun公司开发,于1984年向外公布. 2.NFS可实现Linux系统之间的文件 ...

  9. linux下安装与配置nfs服务器

    NFS 什么是NFS?(NAS) NFS(网络文件系统):它的主要功能是通过网络让不同的机器系统之间可以彼此共享文件和目录.NFS服务器可以允许NFS客户端将远端NFS服务器端的共享目录挂载到本地的N ...

随机推荐

  1. http statusCode(状态码)

    转自:1) http://specs.openstack.org/openstack/keystone-specs/api/v3/identity-api-v3.html#unauthorized   ...

  2. Convert a given Binary Tree to Doubly Linked List

    The question and solution are from: http://www.geeksforgeeks.org/convert-given-binary-tree-doubly-li ...

  3. Reorder array to construct the minimum number

    Construct minimum number by reordering a given non-negative integer array. Arrange them such that th ...

  4. poll函数

    poll函数与select函数的功能基本一样,其定义如下: #include <poll.h> int poll(struct pollfd fds[], nfds_t nfds, int ...

  5. DECO 一个REACT NAtive 开发IDE工具

    DECO 一个REACT NAtive 开发IDE工具. 目前只支持 OS,NO WINDOWS https://www.decosoftware.com/ 一个方便的快速 ERXPRESS 教程:h ...

  6. MongoDB 3.0 用户创建

    摘要: MongoDB 3.0 安全权限访问控制,在添加用户上面3.0版本和之前的版本有很大的区别,这里就说明下3.0的添加用户的方法. 环境.测试: 在安装MongoDB之后,先关闭auth认证,进 ...

  7. 从json传递数据显示表格实例

    @interface ViewController ()<UITableViewDataSource,UITableViewDelegate> { UITableView* table; ...

  8. Divide and Conquer:Cable Master(POJ 1064)

    缆绳大师 题目大意,把若干线段分成K份,求最大能分多长 二分法模型,C(x)就是题干的意思,在while那里做下文章就可以了,因为这个题目没有要求长度是整数,所以我们要不断二分才行,一般50-100次 ...

  9. 【leetcode】Reorder List (middle)

    Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You must do thi ...

  10. 【网络】VPN

    VPN: 来自百度百科 虚拟专用网络的功能是:在公用网络上建立专用网络,进行加密通讯.在企业网络中有广泛应用.VPN网关通过对数据包的加密和数据包目标地址的转换实现远程访问.VPN有多种分类方式,主要 ...