[ZT] 向基於Linux的Oracle RAC 10g叢集新增新節點

tolywang發表於2009-04-07

 

 

 

  

 

在多數業務中,Oracle 真正應用叢集 (RAC) 配置的主要業務要求是整個系統中資料庫層的可伸縮性 — 這樣,當使用者數增加時,可將額外例項新增到該叢集來分發該負載。

  在Oracle RAC 10g 中,這個特定的功能已經變得更加容易。當節點/例項變成可用狀態後,Oracle 即可透過必需的幾個設定步驟來包含這個即插即用功能。

  在本文中,我將討論將節點新增到現有 Oracle RAC 10g 第 2 版叢集所需的步驟。

  當前環境

  出於演示目的,我們這裡的環境是一個四節點的 Rd Hat Linux 叢集。該任務是新增一個附加節點,從而使它成為一個五節點叢集。

資料庫名 節點編號 資料庫版本 例項編號 作業系統核心版本 檔案系統 叢集管理器
SSKYDB 四個節點 — oradb1、oradb2、oradb3 和 oradb4 10.2.0.1 四個例項 — SSKY1、SSKY2、SSKY3 和 SSKY4 Red Hat Enterprise Linux AS 3

  Linux sumsky.net 2.4.21-32.ELsmp

OCFS 1.0 和 ASM Oracle 叢集件

  該過程將透過以下 7 個步驟實現:

  1、考慮依賴性和前提條件

  2、配置網路元件

  3、安裝 Oracle 叢集件

  4、配置 Oracle 叢集件

  5、安裝 Oracle 軟體

  6、新增新例項(一個或多個)

  7、執行日常管理任務

  第 1 步:考慮依賴性和前提條件

  任何軟體安裝或升級的第一個主要步驟都是確保系統的完整備份可用,包括作業系統和資料檔案。下一步是驗證系統要求、作業系統版本和所有應用程式補丁級別。

  新節點應該具有與現有節點相同的作業系統版本,包括 Oracle 所需的所有補丁。在這個示例中,由於駐留在節點 1 到 4 上的作業系統是 Red Hat Enterprise Linux 3,因此新節點也應該具有該版本。此外,為了維持當前命名慣例,應該將新節點稱為 oradb5.

  除了基本的作業系統外,還應該安裝 Oracle 需要的以下程式包:

[root@oradb5 root]# rpm -qa | grep -i gcc
compat-gcc-c++-7.3-2.96.128
compat-gcc-7.3-2.96.128
libgcc-3.2.3-42
gcc-3.2.3-42
[root@oradb5 root]# rpm -qa | grep -i openmotif
openmotif-2.2.3-3.RHEL3
openmotif21-2.1.30-8
[root@oradb5 root]# rpm -qa | grep -i glibc
glibc-2.3.3-74
glibc-utils-2.3.3-74
glibc-kernheaders-2.4-8.34.1
glibc-common-2.3.3-74
glibc-headers-2.3.3-74
glibc-devel-2.3.3-74
[root@oradb5 root]# rpm -qa | grep -i compat
compat-libstdc++-7.3-2.96.128
compat-gcc-c++-7.3-2.96.128
compat-gcc-7.3-2.96.128
compat-db-4.0.14-5
compat-libstdc++-devel-7.3-2.96.128
[root@oradb5 root]#

  使用以下值更新核心引數。

kernel.core_uses_pid = 1
kernel.hostname = oradb5.sumsky.net
kernel.domainname = sumsky.net
kernel.shmall = 2097152
#kernel.shmmax = 536870912
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.shmseg = 4096
kernel.sem = 250 32000 100 150
kernel.msgmnl = 2878
kernel.msgmnb = 65535
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.wmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_max = 262144

  將下列引數新增到 /etc/security/limits.conf.

  oracle      soft  nproc      2047
  oracle      hard  nproc      16384
  oracle      soft  nofile     1024
  oracle      hard  nofile     65536

  將裝置新增到 /etc/fstab — 將裝置定義從現有節點之一複製到 oradb5.

[root@oradb5 root]$ more /etc/fstab
LABEL=/         /        ext3  defaults    1 1
none          /dev/pts     devpts gid=5,mode=620 0 0
none          /proc      proc  defaults    0 0
none          /dev/shm     tmpfs  defaults    0 0
/dev/sda2        swap       swap  defaults    0 0
/dev/cdrom       /mnt/cdrom    udf,iso9660 noauto,owner,kudzu,ro 0 0
/dev/fd0        /mnt/floppy   auto  noauto,owner,kudzu 0 0
/dev/sdb5        /u01       ocfs  _netdev 0 0
/dev/sdb6        /u02       ocfs  _netdev 0 0
/dev/sdb7        /u03       ocfs  _netdev 0 0
/dev/sdb8        /u04       ocfs  _netdev 0 0
/dev/sdb9        /u05       ocfs  _netdev 0 0
/dev/sdb10       /u06       ocfs  _netdev 0 0
/dev/sdb14       /u14       ocfs  _netdev 0 0

  接下來,建立管理使用者。Oracle 的每個安裝都要求每個節點上有一個管理使用者帳戶。在所有現有節點中,管理所有者是 oracle,因此下一步是在節點 oradb5 上建立管理使用者帳戶。當建立該使用者帳戶時,重要的是使用者 oracle 的 UID 和 GID 需要與其他 RAC 節點的相同。該資訊可以使用以下命令獲取:

[oracle@oradb1 oracle]$ id oracle
uid=500(oracle) gid=500(oinstall) groups=501(dba), 502(oper)

  作為根連線到 oradb5(基於 Linux 或 Unix 的環境)並建立以下作業系統組。

groupadd -g 500 oinstall
groupadd -g 501 dba
groupadd -g 502 oper

  當建立這些組之後,使用以下命令建立 oracle 使用者帳戶作為 dba 組的成員,然後使用 passwd(密碼)命令重新設定使用者密碼。

useradd -u 500 -g oinstall -G dba, oper oracle
passwd oracle
Changing password for user oracle.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.

  當建立組和使用者之後,應該驗證它們以確保以下命令的輸出與該叢集的所有節點等同。

[root@oradb5 root]$ id oracle
uid=500(oracle) gid=500(oinstall) groups=501(dba), 502(oper)

  第 2 步:配置網路元件

  在節點 oradb5 上將所有網路地址新增到 /etc/hosts 檔案。此外,要在叢集的其他四個節點上交叉註冊節點 oradb5 資訊。

root@oradb5 root]# more /etc/hosts
127.0.0.1   localhost.localdomain localhost
192.168.2.10  oradb1.sumsky.net oradb1
192.168.2.20  oradb2.sumsky.net oradb2
192.168.2.30  oradb3.sumsky.net oradb3
192.168.2.40  oradb4.sumsky.net oradb4
192.168.2.50  oradb5.sumsky.net oradb5
#Private Network/interconnect
10.168.2.110  oradb1-priv.sumsky.net oradb1-priv
10.168.2.120  oradb2-priv.sumsky.net oradb2-priv
10.168.2.130  oradb3-priv.sumsky.net oradb3-priv
10.168.2.140  oradb4-priv.sumsky.net oradb4-priv
10.168.2.150  oradb5-priv.sumsky.net oradb5-priv
# VIP
192.168.2.15  oradb1-vip.sumsky.net oradb1-vip
192.168.2.25  oradb2-vip.sumsky.net oradb2-vip
192.168.2.35  oradb3-vip.sumsky.net oradb3-vip
192.168.2.45  oradb4-vip.sumsky.net oradb4-vip
192.168.2.55  oradb5-vip.sumsky.net oradb5-vip

  用 SSH 建立使用者等效項。當向叢集新增節點時,Orale 將在其中執行初始安裝的節點的檔案複製到該叢集的新節點。這樣的複製過程可以透過使用 ssh 協議(如果可用)來進行,也可以使用遠端複製 (rcp) 來進行。為了使複製操作成功,RAC 節點上的 oracle 使用者必須能夠在無需提供密碼或口令短語的情況下登入到新的 RAC 節點。

  當前,現有的四個節點配置為使用 ssh.要在新節點上配置 oracle 帳戶來使用無需任何密碼的 ssh,執行以下任務:

  1、為使用者 oracle 建立身份驗證金鑰。要建立此金鑰,請將當前目錄更改為 oracle 使用者的預設登入目錄並執行以下操作:

[oracle@oradb5 oracle]$ ssh-keygen -t dsa -b 1024
Generating public/private dsa key pair.
Enter file in which to save the key (/home/oracle/.ssh/id_dsa):
Created directory '/home/oracle/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/oracle/.ssh/id_dsa.
Your public key has been saved in /home/oracle/.ssh/id_dsa.pub.
The key fingerprint is:
b6:07:42:ae:47:56:0a:a3:a5:bf:75:3e:21:85:8d:30 oracle@oradb5.sumsky.net
[oracle@oradb5 oracle]$

  2、從新節點生成的金鑰應新增到所有節點上的 /home/oracle/.ssh/id_dsa/authorized_keys 檔案中,這意味著每個節點都應包含叢集中所有其他節點的金鑰。

[oracle@oradb5 oracle]$ cd .ssh
[oracle@oradb5 .ssh]$ cat id_dsa.pub > authorized_keys

  當建立完金鑰並將其複製到所有節點之後,oracle 使用者帳戶無需使用密碼就可以從一個節點連線到另一個節點上的另一個 oracle 帳戶。這允許 Oracle Universal Installer 將安裝節點的檔案複製到叢集的其他節點。

  以下輸出是從節點 oradb1 到節點 oradb5 顯示 ssh 的驗證。

[oracle@oradb1 oracle]$ ssh oradb1 hostname
oradb1.sumsky.net
[oracle@oradb1 oracle]$ ssh oradb5 hostname
Oradb5.sumsky.net
[oracle@oradb1 oracle]$ ssh oradb1-priv hostname
oradb1.sumsky.net
[oracle@oradb1 oracle]$ ssh oradb5-priv hostname
Oradb5.sumsky.net

  注意:首次執行這些測試時,作業系統將顯示一個金鑰並請求使用者接受或拒絕。輸入“Yes”將接受並註冊此金鑰。應該在其他所有節點上跨叢集中的所有介面執行這些測試,但 VIP 除外。

  第 3 步:安裝 Oracle 叢集件

  Oracle 叢集件已經安裝在叢集上;這裡的任務是將新節點新增到叢集配置中。要執行該任務,需要執行 Oracle 提供的名為 addnode 的實用程式,該工具位於 Clusterware 的主 oui/bin 目錄中。Oracle 叢集件有兩個檔案(Oracle 叢集資訊庫 (OCR) 和 Oracle 叢集同步服務 (CSS) 表決磁碟),它們包含有關該叢集以及由 Oracle 叢集件管理的應用程式的資訊。這些檔案需要使用關於新節點的資訊進行更新。叢集件安裝過程的第一步是驗證新節點是否準備好進行安裝。

  叢集驗證。在 Oracle 資料庫 10g 第 2 版中,Oracle 引入了一個稱為 Oracle 叢集驗證實用程式 (CVU) 的新實用程式作為該叢集件軟體的一部分。使用適當的引數執行該實用程式可以確定叢集狀態。在該階段,在安裝 Oracle 叢集件之前,應該執行兩個驗證:

  1、如果硬體和作業系統配置已經完成:

cluvfy stage -post hwos -n oradb1,oradb5
Performing post-checks for hardware and operating system setup
Checking node reachability...
Node reachability check passed from node "oradb1".
Checking user equivalence...
User equivalence check passed for user "oracle".
Checking node connectivity...
Node connectivity check passed for subnet "192.168.2.0" with node(s) oradb5,oradb1.
Node connectivity check passed for subnet "10.168.2.0" with node(s) oradb5,oradb1.
Suitable interfaces for the private interconnect on subnet "192.168.2.0":
oradb5 eth0:192.168.2.50 eth0:192.168.2.55
oradb1 eth0:192.168.2.10 eth0:192.168.2.15
Suitable interfaces for the private interconnect on subnet "10.168.2.0":
oradb5 eth1:10.168.2.150
oradb1 eth1:10.168.2.110
Checking shared storage accessibility...
Shared storage check failed on nodes "oradb5".
Post-check for hardware and operating system setup was unsuccessful on all the nodes.

  正如突出顯示的部分一樣,上面的驗證失敗於儲存檢查驗證;節點 oradb5 無法檢視儲存裝置。在這個特定示例中,磁碟沒有足夠的許可權。

  如果忽略該錯誤繼續安裝,Oracle 叢集件安裝將失敗。但如果在重新執行前解決了該錯誤,該驗證步驟將成功,如下所示。

Checking shared storage accessibility...
Shared storage check passed on nodes "oradb5,oradb1".
Post-check for hardware and operating system setup was successful on all the nodes.

  2、在安裝 Oracle 叢集件之前請對節點列表中的所有節點執行相應的檢查。

[oracle@oradb1 cluvfy]$ cluvfy stage -pre crsinst -n oradb1,oradb5
Performing pre-checks for cluster services setup
Checking node reachability...
Node reachability check passed from node "oradb1".
Checking user equivalence...
User equivalence check passed for user "oracle".
Checking administrative privileges...
User existence check passed for "oracle".
Group existence check passed for "oinstall".
Membership check for user "oracle" in group "oinstall" [as Primary] failed.
Check failed on nodes:
    oradb5,oradb1
Administrative privileges check passed.
Checking node connectivity...
Node connectivity check passed for subnet "192.168.2.0" with node(s) oradb5,oradb1.
Node connectivity check passed for subnet "10.168.2.0" with node(s) oradb5,oradb1.
Suitable interfaces for the private interconnect on subnet "192.168.2.0":
oradb5 eth0:192.168.2.50 eth0:192.168.2.55
oradb1 eth0:192.168.2.10 eth0:192.168.2.15
Suitable interfaces for the private interconnect on subnet "10.168.2.0":
oradb5 eth1:10.168.2.150
oradb1 eth1:10.168.2.110
Checking system requirements for 'crs'...
Total memory check passed.
Check failed on nodes:
    oradb5,oradb1
Free disk space check passed.
Swap space check passed.
System architecture check passed.
Kernel version check passed.
Package existence check passed for "make-3.79".
Package existence check passed for "binutils-2.14".
Package existence check passed for "gcc-3.2".
Package existence check passed for "glibc-2.3.2-95.27".
Package existence check passed for "compat-db-4.0.14-5".
Package existence check passed for "compat-gcc-7.3-2.96.128".
Package existence check passed for "compat-gcc-c++-7.3-2.96.128".
Package existence check passed for "compat-libstdc++-7.3-2.96.128".
Package existence check passed for "compat-libstdc++-devel-7.3-2.96.128".
Package existence check passed for "openmotif-2.2.3".
Package existence check passed for "setarch-1.3-1".
Group existence check passed for "dba".
Group existence check passed for "oinstall".
User existence check passed for "nobody".
System requirement failed for 'crs'
Pre-check for cluster services setup was successful on all the nodes.

  第 4 步:配置 Oracle 叢集件

  執行 OUI 需要執行該安裝程式的終端與 X-windows 相容。否則,應安裝相應的 X-windows 模擬器並使用以下語法透過 DISPLAY 命令呼叫此模擬器。

  export DISPLAY=:0.0

  例如:

  [oracle@oradb1 oracle]$export DISPLAY=192.168.2.101:0.0下一步是在新節點 oradb5 上配置叢集件。為此,如前所述,Oracle 已經提供了一個新的稱為 addNode.sh 的可執行檔案,它位於 /oui/bin 目錄。

  1、執行指令碼 /oui/bin/addNode.sh。

  2、Welcome — 單擊 Next。

  3、指定要透過新增來安裝的叢集節點 — 在該螢幕中,OUI 列出了叢集的現有節點,並在下半個螢幕中列出了要新增到適當列中的新節點(一個或多個)資訊。輸入資訊之後,單擊 Next。

公共節點名稱 私有節點名稱 虛擬主機名稱
oradb5 oradb5-priv oradb5-vip

  4、叢集節點新增總結 — 驗證新節點列在“New Nodes”下拉選單之下並單擊 Install。

  5、當需要的所有叢集件元件從 oradb1 複製到 oradb5 之後,OUI 將提示執行三個檔案:

/usr/app/oracle/oraInventory/orainstRoot.sh on node oradb5
[root@oradb5 oraInventory]# ./orainstRoot.sh
Changing permissions of /usr/app/oracle/oraInventory to 770.
Changing groupname of /usr/app/oracle/oraInventory to dba.
The execution of the script. is complete
[root@oradb5 oraInventory]#

  /usr/app/oracle/product/10.2.0/crs/install/rootaddnode.sh on node oradb1.(addnoderoot.sh 檔案將使用 srvctl 實用程式將新節點資訊新增到 OCR.請注意下面指令碼輸出末尾的具有 nodeapps 引數的 srvctl 命令。)

[root@oradb1 install]# ./rootaddnode.sh
clscfg: EXISTING configuration version 3 detected.
clscfg: version 3 is 10G Release 2.
Attempting to add 1 new nodes to the configuration
Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node :
node 5: oradb5 oradb5-priv oradb5
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
/usr/app/oracle/product/10.2.0/crs/bin/srvctl
add nodeapps -n oradb5 -A oradb5-v ip/255.255.255.0/bond0
-o /usr/app/oracle/product/10.2.0/crs
[root@oradb1 install]#

  /usr/app/oracle/product/10.2.0/crs/root.sh on node oradb5.

[root@oradb5 crs]# ./root.sh
WARNING: directory '/usr/app/oracle/product/10.2.0' is not owned by root
WARNING: directory '/usr/app/oracle/product' is not owned by root
WARNING: directory '/usr/app/oracle' is not owned by root
Checking to see if Oracle CRS stack is already configured
/etc/oracle does not exist. Creating it now.
OCR backup directory '/usr/app/oracle/product/10.2.0/crs/cdata/SskyClst'
does not exist. Creating now
Setting the permissions on OCR backup directory
Setting up NS directories
Oracle Cluster Registry configuration upgraded successfully
WARNING: directory '/usr/app/oracle/product/10.2.0' is not owned by root
WARNING: directory '/usr/app/oracle/product' is not owned by root
WARNING: directory '/usr/app/oracle' is not owned by root
clscfg: EXISTING configuration version 3 detected.
clscfg: version 3 is 10G Release 2.
assigning default hostname oradb1 for node 1.
Successfully accumulated necessary OCR keys.
Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node
:
node 1: oradb1 oradb1-priv oradb1
node 2: oradb2 oradb2-priv oradb2
node 3: oradb3 oradb3-priv oradb3
node 4: oradb4 oradb4-priv oradb4
clscfg: Arguments check out successfully.
NO KEYS WERE WRITTEN. Supply -force parameter to override.
-force is destructive and will destroy any previous cluster
configuration.
Oracle Cluster Registry for cluster has already been initialized
Startup will be queued to init within 90 seconds.
Adding daemons to inittab
Expecting the CRS daemons to be up within 600 seconds.
CSS is active on these nodes.
    oradb1
    oradb2
    oradb3
    oradb4
    oradb5
CSS is active on all nodes.
Waiting for the Oracle CRSD and EVMD to start
Oracle CRS stack installed and running under init(1M)
Running vipca(silent) for configuring nodeapps
IP address "oradb-vip" has already been used.
Enter an unused IP address.

  產生錯誤“oradb-vip‘ has already been used”,因為 VIP 已經在所有節點(而非 oradb5)上進行了配置。重要的是在繼續之前手動執行 VIPCA(虛擬 IP 配置助手)。

  使用 VIPCA 手動配置 VIP.與執行 OUI 相似,執行 VIPCA 要求執行該安裝程式的終端與 X-windows 相容。否則,應安裝相應的 X-windows 模擬器並使用以下語法透過 DISPLAY 命令呼叫此模擬器:

  export DISPLAY=:0.0

  例如:

  [oracle@oradb1 oracle]$export DISPLAY=192.168.2.101:0.0在節點 oradb1(或者執行新增節點過程的節點)上的命令提示符處執行 root.sh 之後,還要立即作為根呼叫 VIPCA.(VIPCA 還將在新節點上配置 GSD 和 ONS 資源。)

  I、Welcome — 單擊 Next。

  II、第 1 步(共 2 步):網路介面 — 顯示網路介面列表;選擇 VIP 將分配/對映到的網路公共網路介面。通常是列表 (eth0) 中的第一個介面;但是,在這個特定情況中,由於針對私有互連啟用了繫結而且該列表以字母次序顯示,因此 bond0 介面將顯示在列表頂部。完成後單擊 Next。

  III、第 2 步(共 2 步):叢集節點的虛擬 IP — 對於列表中的每個節點名,在適當的列中提供 VIP 別名和虛擬 IP 地址。完成後單擊 Next。

  IV、總結 — 列出當前所選配置的總結。當所有設定正確後,單擊 Finish。

  V、配置助手進度對話方塊 — 該螢幕將顯示 VIP、GSD 和 ONS 配置過程的進度。VIPCA 提示後單擊 OK。

  VI、配置結果 — 該螢幕將顯示配置結果。單擊 Exit 退出 VIPCA。

  完成 Oracle 叢集件安裝後,將在其各自目錄中建立下列檔案。

  叢集件檔案:

[root@oradb5 root]# ls -ltr /etc/init.d/init.*
-r-xr-xr-x  1 root   root   3197 Aug 13 23:32 /etc/init.d/init.evmd
-r-xr-xr-x  1 root   root  35401 Aug 13 23:32 /etc/init.d/init.cssd
-r-xr-xr-x  1 root   root   4721 Aug 13 23:32 /etc/init.d/init.crsd
-r-xr-xr-x  1 root   root   1951 Aug 13 23:32 /etc/init.d/init.crs
[root@oradb5 root]#

  使用以下條目更新了作業系統提供的 inittab 檔案。

[root@oradb5 root]# tail -5 /etc/inittab
# Run xdm in runlevel 5
x:5:respawn:/etc/X11/prefdm -nodaemon
h1:35:respawn:/etc/init.d/init.evmd run >/dev/null 2>&1 h2:35:respawn:/etc/init.d/init.cssd fatal >/dev/null 2>&1 h3:35:respawn:/etc/init.d/init.crsd run >/dev/null 2>&1

  6、當列出的所有指令碼都在所有節點上執行後,單擊 OK。

  7、安裝結束 — 單擊 Exit。

  8、使用 olsnodes 命令驗證叢集件是否註冊了所有節點。

[oracle@oradb1 oracle]$ olsnodes
oradb1
oradb2
oradb3
oradb4
oradb5
[oracle@oradb1 oracle]$

  9、使用 crs_stat 命令驗證是否啟動了叢集服務。

[oracle@oradb1 oracle]$ crs_stat -t
Name      Type      Target  State   Host
------------------------------------------------------------
ora.oradb1.gsd application  ONLINE  ONLINE  oradb1
ora.oradb1.ons application  ONLINE  ONLINE  oradb1
ora.oradb1.vip application  ONLINE  ONLINE  oradb1
ora.oradb2.gsd application  ONLINE  ONLINE  oradb2
...
ora.oradb3.vip application  ONLINE  ONLINE  oradb3
ora.oradb4.gsd application  ONLINE  ONLINE  oradb4
ora.oradb4.ons application  ONLINE  ONLINE  oradb4
ora.oradb4.vip application  ONLINE  ONLINE  oradb4
ora.oradb5.gsd application  ONLINE  ONLINE  oradb5
ora.oradb5.ons application  ONLINE  ONLINE  oradb5
ora.oradb5.vip application  ONLINE  ONLINE  oradb5

  10、驗證是否在 OS 級配置了 VIP 服務。配置虛擬 IP 地址並將其新增到 OS 網路配置並啟動網路服務。VIP 配置可以使用 ifconfig 命令在 OS 級驗證。

[oracle@oradb5 oracle]$ ifconfig -a
eth0   Link encap:Ethernet HWaddr 00:90:27:B8:58:10
     inet addr:192.168.2.50 Bcast:192.168.2.255 Mask:255.255.255.0
     UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
     RX packets:123 errors:0 dropped:0 overruns:0 frame.:0
     TX packets:67 errors:0 dropped:0 overruns:0 carrier:0
     collisions:0 txqueuelen:1000
     RX bytes:583308844 (556.2 Mb) TX bytes:4676477 (4.4 Mb)
eth0:1  Link encap:Ethernet HWaddr 00:90:27:B8:58:10
     inet addr:192.168.2.55 Bcast:192.168.3.255 Mask:255.255.252.0
     UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
     RX packets:14631 errors:0 dropped:0 overruns:0 frame.:0
     TX packets:21377 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:8025681 (7.6 Mb) TX bytes:600 (600.0 b)
    Interrupt:11 Base address:0x2400 Memory:41300000-41300038

  注意:eth0:1 指示它是基本主機 eth0 的 VIP 地址。當節點出現故障時,eth0:1 將移動到叢集中的一個可用節點。故障切換伺服器上的 VIP 的新識別符號變為 eth0:2 或更高數值,具體情況取決於叢集中哪些節點故障以及 VIP 移植到的其他節點。

  第 5 步:安裝 Oracle 軟體

  下一步是在新節點上安裝 Oracle 軟體。如前所述,Oracle 已經提供了一個新的稱為 addNode.sh 的可執行檔案,它位於 $ORACLE_HOME/oui/bin 目錄。

  1、執行指令碼 $ORACLE_HOME/oui/bin/addNode.sh。

  2、Welcome — 單擊 Next。

  3、指定要透過新增來安裝的叢集節點 — 在該螢幕中,OUI 列出了叢集的現有節點,並在下半個螢幕中列出了新節點(一個或多個)。選擇節點 oradb5。輸入資訊之後,單擊 Next。

  4、叢集節點新增總結 — 驗證新節點列在“New Nodes”下拉選單之下並單擊 Install 按鈕。

  5、將 Oracle 軟體複製到節點 oradb5 之後,OUI 將提示您以 root 使用者的身份在另一個視窗中對叢集中的新節點(一個或多個)執行 /usr/app/oracle/product/10.2.0/db_1/root.sh 指令碼。

[root@oradb5 db_1]# ./root.sh
Running Oracle10 root.sh script...
The following environment variables are set as:
  ORACLE_OWNER= oracle
  ORACLE_HOME= /usr/app/oracle/product/10.2.0/db_1
Enter the full pathname of the local bin directory: [/usr/local/bin]:
The file "dbhome" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: y
  Copying dbhome to /usr/local/bin ...
The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: y
  Copying oraenv to /usr/local/bin ...
The file "coraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: y
  Copying coraenv to /usr/local/bin ...
Creating /etc/oratab file...
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.sh script.
Now product-specific root actions will be performed

  6、單擊 OK(當 root.sh 在節點 oradb5 上執行後)。

  7、安裝結束 — 單擊 Exit。

  當安裝 RDBMS 軟體之後,比較好的做法是在進行下一步之前執行 netca.Netca 將配置需要的所有網路檔案和引數,例如,監聽程式、sql*net 和 tnsnames.ora 檔案。

  第 6 步:新增新例項(一個或多個)

  DBCA 具有將附加例項新增到叢集所需的所有選項。

  要求:

  1、在開始執行升級過程前,請建立資料庫的完整冷備份。

  2、Oracle 叢集件應該執行在所有節點上。

  1、Welcome 螢幕 — 選擇 Oracle Real Application Cluster database 並單擊 Next。

  2、第 1 步(共 7 步):操作 — 列出了可以使用 DBCA 執行的所有操作列表。選中 Instance Management,然後單擊 Next。

  3、第 2 步(共 7 步):例項管理 — 列出了可以執行的例項管理操作列表。選中 Add an Instance,然後單擊 Next。

  4、第 3 步(共 7 步):叢集資料庫列表 — 列出了該節點上執行的叢集資料庫列表。在本例中,執行在節點 oradb1 上的資料庫是 SSKYDB;選擇該資料庫。在螢幕下半部分,DBCA 要求您“利用 SYSDBA 系統特權指定一個使用者”:

  Username:sys

  Password: 並單擊 Next。

  5、第 4 步(共 7 步):叢集資料庫例項列表 — DBCA 將列出叢集上當前可用的所有例項。驗證是否列出了所有例項並單擊 Next。/li>

  6、第 5 步(共 7 步):例項命名和節點選擇 — DBCA 將列出序列中的下一個例項名並請求該節點來新增此例項。在我們的示例中,下一個例項名是 SSKY5,節點名是 oradb5。進行適當的選擇後單擊 Next。在該階段,在下一螢幕顯示之前會有一個小暫停,因為 DBCA 要確定新節點的當前狀態以及當前節點上配置了什麼服務。

  7、第 6 步(共 7 步):資料庫服務 — 如果當前配置中配置了任何資料庫服務,將顯示該螢幕(否則跳過)。在我們的示例中,當前配置定義了兩個服務 — CRM 和 PAYROLL。該螢幕提示跨新例項配置它們。進行適當的選擇並在準備好後單擊 Next。

  8、第 7 步(共 7 步):例項儲存 — 在該螢幕中,DBCA 將列出例項特定的檔案,例如,撤消表空間、重做日誌組,等等。驗證是否列出了所需的所有檔案並單擊 Finish。

  9、資料庫配置助手:總結 — 驗證該總結後,單擊 OK 開始軟體安裝。

  10、DBCA 驗證新節點 oradb5,而且由於該資料庫配置為使用 ASM,將提示訊息“ASM 位於該叢集上,但需要擴充套件到以下節點:[oradb5]。您想擴充套件 ASM 嗎?”單擊 Yes 將 ASM 新增到新例項。

  11、為了在新節點上建立並啟動 ASM 例項,Oracle 要求監聽程式可用且已啟動。DBCA 透過請求特權提示使用埠 1521 和監聽程式名 LISTENER_ORADB5 配置監聽程式。如果預設埠可用,單擊 Yes,否則單擊 No 並在 oradb5 上手動執行 NetCA 來使用不同埠建立監聽程式。

  12、資料庫配置助手進度螢幕 — 當例項管理完成後,將提示使用者訊息“您想執行另一操作嗎?”單擊 No 結束。

  13在該階段,以下內容是真實的:

  a、已經在節點 oradb5 上安裝了該叢集件,現在它是該叢集的一部分。

  b、已經在節點 oradb5 上安裝了該 Oracle 軟體。

  c、已經在節點 oradb5 上建立並配置了 ASM5 和新 Oracle 例項 SSKY5。

  14、驗證更新是否成功。

  a、從任何參與例項使用 V$ACTIVE_INSTANCES 檢視驗證是否啟動了叢集中的所有例項。 例如:

SQL> select * from v$active_instances;
INST_NUMBER INST_NAME
----------- -----------------------------------
     1 oradb1.sumsky.net:SSKY1
     2 oradb2.sumsky.net:SSKY2
     3 oradb3.sumsky.net:SSKY3
     4 oradb4.sumsky.net:SSKY4
     5 oradb5.sumsky.net:SSKY5

  b、驗證是否已經安裝了所有 ASM 磁碟組,而且資料檔案是否對新例項可視。

SQL> SELECT NAME,STATE,TYPE FROM V$ASM_DISKGROUP;
NAME              STATE    TYPE
------------------------------ ----------- ------
ASMGRP1            CONNECTED  NORMAL
ASMGRP2            CONNECTED  NORMAL
SQL> SELECT NAME FROM V$DATAFILE;
NAME
-----------------------------------------------------------------
+ASMGRP1/sskydb/datafile/system.256.581006553
+ASMGRP1/sskydb/datafile/undotbs1.258.581006555
+ASMGRP1/sskydb/datafile/sysaux.257.581006553
+ASMGRP1/sskydb/datafile/users.259.581006555
+ASMGRP1/sskydb/datafile/example.269.581007007
+ASMGRP1/sskydb/datafile/undots2.271.581029215

  c、驗證 OCR 是否知道:

  叢集中的新例項:

[oracle@oradb1 oracle]$ srvctl status database -d SSKYDB
Instance SSKY1 is running on node oradb1
Instance SSKY2 is running on node oradb2
Instance SSKY3 is running on node oradb3
Instance SSKY4 is running on node oradb4
Instance SSKY5 is running on node oradb5

  資料庫服務:

[oracle@oradb1 oracle]$ srvctl status service -d SSKYDB
Service CRM is running on instance(s) SSKY1
Service CRM is running on instance(s) SSKY2
Service CRM is running on instance(s) SSKY3
Service CRM is running on instance(s) SSKY4
Service CRM is running on instance(s) SSKY5
Service PAYROLL is running on instance(s) SSKY1
Service PAYROLL is running on instance(s) SSKY5

  第 7 步:執行日常管理任務

  為便於管理和導航,應在登入配置檔案中定義幾個不同的環境變數。例如:

[oracle@oradb5 oracle]$ more .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
    . ~/.bashrc
fi
# User specific environment and startup programs
export ORACLE_BASE=/usr/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORA_CRS_HOME=$ORACLE_BASE/product/10.2.0/crs
export PATH=.:${PATH}:$HOME/bin:$ORACLE_HOME/bin
export PATH=${PATH}:$ORA_CRS_HOME/bin
export PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin:/sbin
export ORACLE_ADMIN=$ORACLE_BASE/admin
export TNS_ADMIN=$ORACLE_HOME/network/admin
export LD_ASSUME_KERNEL=2.4.19
export LD_LIBRARY=$ORACLE_HOME/lib
export LD_LIBRARY=${LD_LIBRARY}:/lib:/usr/lib:/usr/local/bin
export LD_LIBRARY=${LD_LIBRARY}:$ORA_CRS_HOME/lib
export CLASSPATH=$ORACLE_HOME/JRE
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib
export THREADS_FLAG=native
export ORACLE_SID=SSKY5

  將網路地址新增到 DNS 以進行檢視。為了便於連線到使用 VIP 的資料庫的應用程式和客戶端將別名轉換為適當的 IP 地址,重要的是將 VIP 地址新增到 DNS.

  還要將新網路地址新增到 clinet tnsnames.ora 檔案,新增到適當的 connect 描述符。

CRAC =
 (DESCRIPTION =
  (ADDRESS = (PROTOCOL = TCP)(HOST = oradb1-vip)(PORT = 1521))
  (ADDRESS = (PROTOCOL = TCP)(HOST = oradb2-vip)(PORT = 1521))
  (ADDRESS = (PROTOCOL = TCP)(HOST = oradb3-vip)(PORT = 1521))
  (ADDRESS = (PROTOCOL = TCP)(HOST = oradb4-vip)(PORT = 1521))
  (ADDRESS = (PROTOCOL = TCP)(HOST = oradb5-vip)(PORT = 1521))
  (LOAD_BALANCE = yes)
  (CONNECT_DATA =
   (SERVER = DEDICATED)
   (SERVICE_NAME = CRM)
  )
 )

  如果這些伺服器配置為使用 FAN 功能,將新的伺服器地址新增到所有資料庫伺服器上的 onsctl 檔案中。ons.config 檔案位於

[oracle@oradb4 oracle]$ more $ORACLE_HOME/opmn/conf/ons.config
localport=6101
remoteport=6201
loglevel=3
useocr=on
nodes=oradb4.sumsky.net:6101,oradb2.sumsky.net:6201,
oradb1.sumsky.net:6201,oradb3.sumsky.net:6201,oradb5.sumsky.net:6201
onsclient1.sumsky.net:6200,onsclient2.sumsky.net:6200

  結論

  恭喜,您已成功地將一個新節點新增到了四節點的現有配置。下表顯示了新配置。

資料庫名 節點編號 資料庫版本 例項編號 作業系統核心版本 檔案系統 叢集管理器
SSKYDB 五個節點 — oradb1、oradb2、oradb3、oradb4 和 oradb5 10.2.0.1 五個例項 — SSKY1、SSKY2、SSKY3、SSKY4 和 SSKY5 Red Hat Advanced Server 3.0

  Linux sumsky.net 2.4.21-32.ELsmp

OCFS 1.0 和 ASM Oracle 叢集件

 

 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/35489/viewspace-586724/,如需轉載,請註明出處,否則將追究法律責任。

相關文章