11gR2 單機RAC+Linux+裸裝置

尛樣兒發表於2012-07-07
       
        在開始寫這篇文章前有兩點需要說明,這篇文章包含以下兩點主要內容:

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/,如需轉載,請註明出處,否則將追究法律責任。

相關文章