ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 11gR2 单机RAC+Linux+裸设备

11gR2 单机RAC+Linux+裸设备

原创 Linux操作系统 作者:尛样儿 时间:2012-07-07 23:11:59 0 删除 编辑
       
        在开始写这篇文章前有两点需要说明,这篇文章包含以下两点主要内容:

1).这里讨论的11gR2 单机RAC并不是RAC One Node,而是在单台服务器上安装Grid Infrastructure for Cluster,之后可以向这个单节点集群添加新的节点。
2).从11gR2开始,Oracle不支持在dbca上使用裸设备,但裸设备本身还是继续可以使用的,这篇文章讨论如何安装11gR2 RAC的时候使用裸设备,而非升级而来。
       
        以上两点都只涉及到Grid Infrastructure的安装部署,Database相对而言更加容易,这里就不讨论。下面详细讨论具体内容:

1.对于单节点安装for Cluster的Grid Infrastructure是完全可行的,跟多节点的没太大区别。只需要注意在单节点安装Oracle RAC的情况下,依然需要配置公共网络、私有网络,并分配相应的IP地址和指定VIP地址、SCAN等;存储依然需要配置,并划分多个字符设备的裸设备;在安装过程中依然需要建立用户等效性(虽然只有一个节点,但是也需要创建到本节点的用户等效性)。
        如果使用图形化方式安装Grid Infrastructure,那么在选择Clusterware磁盘文件存储方式的时候选择集群文件系统(可以创建一个临时的NFS文件系统(可以参考文章: http://space.itpub.net/23135684/viewspace-734873),让图形化方式验证通过,非集群文件系统,例如,ext3无法验证通过)。
        等待所有的文件拷贝、编译结束之后,提示执行root.sh脚本的时候,这个时候就需要先将$GRID_HOME/crs/install/crsconfig_params文件中配置的OCR和VOTEDISK文件位置修改为裸设备,之后再执行root.sh脚本就可以顺利将OCR和VOTEDISK存放到裸设备上(orainstRoot脚本可以直接执行)。
        
2.下面详细讨论有关crsconfig_params配置文件的修改:

        在配置Clusterware磁盘文件的时候,有两种选择:ASM和集群文件系统,这里我们要使用裸设备,下面将这3种配置方式对应的crsconfig_params文件进行详细的对比:

a).ASM存储方式对应的crsconfig_params配置文件内容:

SILENT=false
ORACLE_OWNER=grid
ORA_DBA_GROUP=oinstall
ORA_ASM_GROUP=asmadmin
LANGUAGE_ID=AMERICAN_AMERICA.AL32UTF8
TZ=Asia/Shanghai
ISROLLING=true 
REUSEDG=false
ASM_AU_SIZE=1
USER_IGNORED_PREREQ=true


ORACLE_HOME=/u01/app/11.2.0/grid
ORACLE_BASE=/u01/app/grid
OLD_CRS_HOME=

JREDIR=/u01/app/11.2.0/grid/jdk/jre/
JLIBDIR=/u01/app/11.2.0/grid/jlib

VNDR_CLUSTER=false
OCR_LOCATIONS=NO_VAL
CLUSTER_NAME=redhat-cluster
HOST_NAME_LIST=redhat6
NODE_NAME_LIST=redhat6
PRIVATE_NAME_LIST=
VOTING_DISKS=NO_VAL
#VF_DISCOVERY_STRING=%s_vfdiscoverystring%
ASM_UPGRADE=false
ASM_SPFILE=
ASM_DISK_GROUP=OCRVDISK
ASM_DISCOVERY_STRING=/dev/raw/*
ASM_DISKS=/dev/raw/raw1,/dev/raw/raw2,/dev/raw/raw3
ASM_REDUNDANCY=NORMAL 
CRS_STORAGE_OPTION=1
CSS_LEASEDURATION=400
CRS_NODEVIPS='redhat6-vip/255.255.255.0/eth0'
NODELIST=redhat6
NETWORKS="eth0"/192.168.56.0:public,"eth1"/1.1.1.0:cluster_interconnect
SCAN_NAME=redhat-cluster-scan
SCAN_PORT=1521
GPNP_PA=
OCFS_CONFIG=

# GNS consts
GNS_CONF=false
GNS_ADDR_LIST=
GNS_DOMAIN_LIST=
GNS_ALLOW_NET_LIST=
GNS_DENY_NET_LIST=
GNS_DENY_ITF_LIST=

#### Required by OUI add node
NEW_HOST_NAME_LIST=
NEW_NODE_NAME_LIST=
NEW_PRIVATE_NAME_LIST=
NEW_NODEVIPS='redhat6-vip/255.255.255.0/eth0'

############### OCR constants
# GPNPCONFIGDIR is handled differently in dev (T_HAS_WORK for all)
# GPNPGCONFIGDIR in dev expands to T_HAS_WORK_GLOBAL
GPNPCONFIGDIR=$ORACLE_HOME
GPNPGCONFIGDIR=$ORACLE_HOME
OCRLOC=
OLRLOC=
OCRID=
CLUSTER_GUID=

CLSCFG_MISSCOUNT=

#### IPD/OS
CRFHOME="/u01/app/11.2.0/grid"


b).集群文件系统存储方式对应的crsconfig_params配置文件内容: 

SILENT=false
ORACLE_OWNER=grid
ORA_DBA_GROUP=oinstall
ORA_ASM_GROUP=asmadmin
LANGUAGE_ID=AMERICAN_AMERICA.AL32UTF8
TZ=Asia/Shanghai
ISROLLING=true 
REUSEDG=false
ASM_AU_SIZE=1
USER_IGNORED_PREREQ=true


ORACLE_HOME=/u01/app/11.2.0/grid
ORACLE_BASE=/u01/app/grid
OLD_CRS_HOME=

JREDIR=/u01/app/11.2.0/grid/jdk/jre/
JLIBDIR=/u01/app/11.2.0/grid/jlib

VNDR_CLUSTER=false
OCR_LOCATIONS=/u02/ocr1
CLUSTER_NAME=redhat-cluster
HOST_NAME_LIST=redhat6
NODE_NAME_LIST=redhat6
PRIVATE_NAME_LIST=
VOTING_DISKS=/u02/vdsk1,/u02/vdsk2,/u02/vdsk3
#VF_DISCOVERY_STRING=%s_vfdiscoverystring%
ASM_UPGRADE=false
ASM_SPFILE=
ASM_DISK_GROUP=
ASM_DISCOVERY_STRING=
ASM_DISKS=
ASM_REDUNDANCY= 
CRS_STORAGE_OPTION=2
CSS_LEASEDURATION=400
CRS_NODEVIPS='redhat6-vip/255.255.255.0/eth0'
NODELIST=redhat6
NETWORKS="eth0"/192.168.56.0:public,"eth1"/1.1.1.0:cluster_interconnect
SCAN_NAME=redhat-cluster-scan
SCAN_PORT=1521
GPNP_PA=
OCFS_CONFIG=

# GNS consts
GNS_CONF=false
GNS_ADDR_LIST=
GNS_DOMAIN_LIST=
GNS_ALLOW_NET_LIST=
GNS_DENY_NET_LIST=
GNS_DENY_ITF_LIST=

#### Required by OUI add node
NEW_HOST_NAME_LIST=
NEW_NODE_NAME_LIST=
NEW_PRIVATE_NAME_LIST=
NEW_NODEVIPS='redhat6-vip/255.255.255.0/eth0'

############### OCR constants
# GPNPCONFIGDIR is handled differently in dev (T_HAS_WORK for all)
# GPNPGCONFIGDIR in dev expands to T_HAS_WORK_GLOBAL
GPNPCONFIGDIR=$ORACLE_HOME
GPNPGCONFIGDIR=$ORACLE_HOME
OCRLOC=
OLRLOC=
OCRID=
CLUSTER_GUID=

CLSCFG_MISSCOUNT=

#### IPD/OS
CRFHOME="/u01/app/11.2.0/grid"

        从以上两种存储方式配置文件的内容的对比来看,只有加红加粗的地方有区别,且不难看出,一组是具体物理位置的设置(用逗号分隔),另一组是相关ASM磁盘组的设置。

c).裸设备存储方式对应的crsconfig_params配置文件内容: 

SILENT=false
ORACLE_OWNER=grid
ORA_DBA_GROUP=oinstall
ORA_ASM_GROUP=asmadmin
LANGUAGE_ID=AMERICAN_AMERICA.AL32UTF8
TZ=Asia/Shanghai
ISROLLING=true 
REUSEDG=false
ASM_AU_SIZE=1
USER_IGNORED_PREREQ=true


ORACLE_HOME=/u01/app/11.2.0/grid
ORACLE_BASE=/u01/app/grid
OLD_CRS_HOME=

JREDIR=/u01/app/11.2.0/grid/jdk/jre/
JLIBDIR=/u01/app/11.2.0/grid/jlib

VNDR_CLUSTER=false
OCR_LOCATIONS=/dev/raw/raw1,/dev/raw/raw2
CLUSTER_NAME=redhat-cluster
HOST_NAME_LIST=redhat6
NODE_NAME_LIST=redhat6
PRIVATE_NAME_LIST=
VOTING_DISKS=/dev/raw/raw3,/dev/raw/raw4,/dev/raw/raw5
#VF_DISCOVERY_STRING=%s_vfdiscoverystring%
ASM_UPGRADE=false
ASM_SPFILE=
ASM_DISK_GROUP=
ASM_DISCOVERY_STRING=
ASM_DISKS=
ASM_REDUNDANCY= 
CRS_STORAGE_OPTION=2
CSS_LEASEDURATION=400
CRS_NODEVIPS='redhat6-vip/255.255.255.0/eth0'
NODELIST=redhat6
NETWORKS="eth0"/192.168.56.0:public,"eth1"/1.1.1.0:cluster_interconnect
SCAN_NAME=redhat-cluster-scan
SCAN_PORT=1521
GPNP_PA=
OCFS_CONFIG=

# GNS consts
GNS_CONF=false
GNS_ADDR_LIST=
GNS_DOMAIN_LIST=
GNS_ALLOW_NET_LIST=
GNS_DENY_NET_LIST=
GNS_DENY_ITF_LIST=

#### Required by OUI add node
NEW_HOST_NAME_LIST=
NEW_NODE_NAME_LIST=
NEW_PRIVATE_NAME_LIST=
NEW_NODEVIPS='redhat6-vip/255.255.255.0/eth0'

############### OCR constants
# GPNPCONFIGDIR is handled differently in dev (T_HAS_WORK for all)
# GPNPGCONFIGDIR in dev expands to T_HAS_WORK_GLOBAL
GPNPCONFIGDIR=$ORACLE_HOME
GPNPGCONFIGDIR=$ORACLE_HOME
OCRLOC=
OLRLOC=
OCRID=
CLUSTER_GUID=

CLSCFG_MISSCOUNT=

#### IPD/OS
CRFHOME="/u01/app/11.2.0/grid"

       将裸设备与文件系统的crsconfig_params配置文件的内容进行比较,只有加红加粗的两行不同,且是在执行root.sh脚本之前手动修改的,修改完成后执行root.sh脚本就会将OCR和VOTEDISK文件放置在裸设备上,这跟在集群文件系统中指定文件存放位置是一样的道理。

3.修改完成后执行root.sh脚本可能出现如下报错:
[root@redhat6 grid]# ./root.sh
Performing root user operation for Oracle 11g

The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /u01/app/11.2.0/grid

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Using configuration parameter file: /u01/app/11.2.0/grid/crs/install/crsconfig_params
User ignored Prerequisites during installation
Failed to create keys in the OLR, rc = 127, Message:
  /u01/app/11.2.0/grid/bin/clscfg.bin: error while loading shared libraries: libcap.so.1: cannot open shared object file: No such file or directory

Failed to create keys in the OLR at /u01/app/11.2.0/grid/crs/install/crsconfig_lib.pm line 7497.
/u01/app/11.2.0/grid/perl/bin/perl -I/u01/app/11.2.0/grid/perl/lib -I/u01/app/11.2.0/grid/crs/install /u01/app/11.2.0/grid/crs/install/rootcrs.pl execution failed
       
        首先确保操作系统的libcap包已经安装(如果是x86_64bit,那么64bit和32bit都已经安装)。之后执行如下操作:
[root@redhat6 /]# cd lib64
[root@redhat6 lib64]# ls -al libcap.so*
lrwxrwxrwx. 1 root root    14 Jul  6 15:35 libcap.so.2 -> libcap.so.2.16
-rwxr-xr-x. 1 root root 18920 Feb 26  2010 libcap.so.2.16
[root@redhat6 lib64]# ln -s libcap.so.2.16 libcap.so.1
[root@redhat6 lib64]# ls -al libcap.so*
lrwxrwxrwx. 1 root root    14 Jul  7 04:33 libcap.so.1 -> libcap.so.2.16
lrwxrwxrwx. 1 root root    14 Jul  6 15:35 libcap.so.2 -> libcap.so.2.16
-rwxr-xr-x. 1 root root 18920 Feb 26  2010 libcap.so.2.16

        之后再次执行root.sh脚本,非常顺利的就完成了:
[root@redhat6 grid]# ./root.sh
Performing root user operation for Oracle 11g

The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /u01/app/11.2.0/grid

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Using configuration parameter file: /u01/app/11.2.0/grid/crs/install/crsconfig_params
User ignored Prerequisites during installation
OLR initialization - successful
  root wallet
  root wallet cert
  root cert export
  peer wallet
  profile reader wallet
  pa wallet
  peer wallet keys
  pa wallet keys
  peer cert request
  pa cert request
  peer cert
  pa cert
  peer root cert TP
  profile reader root cert TP
  pa root cert TP
  peer pa cert TP
  pa peer cert TP
  profile reader pa cert TP
  profile reader peer cert TP
  peer user cert
  pa user cert
Adding Clusterware entries to upstart
CRS-2672: Attempting to start 'ora.mdnsd' on 'redhat6'
CRS-2676: Start of 'ora.mdnsd' on 'redhat6' succeeded
CRS-2672: Attempting to start 'ora.gpnpd' on 'redhat6'
CRS-2676: Start of 'ora.gpnpd' on 'redhat6' succeeded
CRS-2672: Attempting to start 'ora.cssdmonitor' on 'redhat6'
CRS-2672: Attempting to start 'ora.gipcd' on 'redhat6'
CRS-2676: Start of 'ora.gipcd' on 'redhat6' succeeded
CRS-2676: Start of 'ora.cssdmonitor' on 'redhat6' succeeded
CRS-2672: Attempting to start 'ora.cssd' on 'redhat6'
CRS-2672: Attempting to start 'ora.diskmon' on 'redhat6'
CRS-2676: Start of 'ora.diskmon' on 'redhat6' succeeded
CRS-2676: Start of 'ora.cssd' on 'redhat6' succeeded
clscfg: -install mode specified
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
Now formatting voting disk: /dev/raw/raw3.
Now formatting voting disk: /dev/raw/raw4.
Now formatting voting disk: /dev/raw/raw5.
CRS-4603: Successful addition of voting disk /dev/raw/raw3.
CRS-4603: Successful addition of voting disk /dev/raw/raw4.
CRS-4603: Successful addition of voting disk /dev/raw/raw5.
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   91bb8894ed9a4f8bbf78109e79c8f98a (/dev/raw/raw3) []
 2. ONLINE   69ebecd557c84f40bf93fb98fef71f72 (/dev/raw/raw4) []
 3. ONLINE   0d4f6cead18c4f1abfcdb257f7e4884d (/dev/raw/raw5) []
Located 3 voting disk(s).
Configure Oracle Grid Infrastructure for a Cluster ... succeeded

4.检查集群环境:
[root@redhat6 bin]# ./crsctl query css votedisk
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   91bb8894ed9a4f8bbf78109e79c8f98a (/dev/raw/raw3) []
 2. ONLINE   69ebecd557c84f40bf93fb98fef71f72 (/dev/raw/raw4) []
 3. ONLINE   0d4f6cead18c4f1abfcdb257f7e4884d (/dev/raw/raw5) []
Located 3 voting disk(s).
        表决磁盘文件存放在裸设备上。

[root@redhat6 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          3
         Total space (kbytes)     :    2100092
         Used space (kbytes)      :       2208
         Available space (kbytes) :    2097884
         ID                       :  752398861
         Device/File Name         : /dev/raw/raw1
                                    Device/File integrity check succeeded
         Device/File Name         : /dev/raw/raw2
                                    Device/File integrity check succeeded

                                    Device/File not configured

                                    Device/File not configured

                                    Device/File not configured

         Cluster registry integrity check succeeded

         Logical corruption check succeeded
        OCR文件存放在裸设备上。

[root@redhat6 bin]# ./crsctl status res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER.lsnr
               ONLINE  ONLINE       redhat6
ora.asm
               OFFLINE OFFLINE      redhat6                  Instance Shutdown
ora.gsd
               OFFLINE OFFLINE      redhat6
ora.net1.network
               ONLINE  ONLINE       redhat6
ora.ons
               ONLINE  ONLINE       redhat6
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       redhat6
ora.cvu
      1        ONLINE  ONLINE       redhat6
ora.oc4j
      1        ONLINE  ONLINE       redhat6
ora.redhat6.vip
      1        ONLINE  ONLINE       redhat6
ora.scan1.vip
      1        ONLINE  ONLINE       redhat6
        所有的服务都是正常的,由于使用裸设备作为OCR和VOTEDISK的存储方式,所以ASM是Instance Shutdown的状态。


        这篇文章证明了,在11gR2的环境下,单节点安装RAC和使用裸设备作为Clusterware磁盘文件的存储方式都是可行,且是很简单的事情。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/23135684/viewspace-734883/,如需转载,请注明出处,否则将追究法律责任。

上一篇: 11gR2 RAC+Linux+NFS
请登录后发表评论 登录
全部评论
Oracle数据库管理员,Oracle数据库系统构架员;2012年7月出版《构建最高可用Oracle数据库系统:Oracle 11gR2 RAC管理、维护与性能优化》一书;Oracle 10g OCM。

注册时间:2010-01-05

  • 博文量
    483
  • 访问量
    5328512