oracle 10g rac,刪除故障節點並新增新節點

germany006發表於2015-03-19

 

    最近客戶報障說一個節點失敗,目前只有單節點執行,叫我們現場支援一下。到現場後,我們發現一個節點已經失敗,同時他們打算用一臺新機器來做,我們在現場部署後,新增節點,現在把過程記下來!   
    失敗節點是第一節點。

1、刪除失敗節點的相關資訊

--在存活節點上刪除失敗節點註冊

[root@dbrac2 bin]# ./srvctl remove nodeapps -n dbrac1
[root@dbrac2 bin]# ./crs_unregister ora.dbrac.dbrac1.inst
[root@dbrac2 bin]# ./crs_unregister ora.dbrac1.ASM1.asm
[root@dbrac2 bin]# ./crs_unregister ora.dbrac1.LISTENER_DBRAC1.lsnr
[root@dbrac2 bin]# ./crs_unregister ora.dbrac1.vip
[root@dbrac2 bin]# ./racgons remove_config dbrac1:6200

網上有一種方法,但我沒驗證,如下:
/*
1 cat /oracle/product/10.2.0/crs_1//opmn/conf/ons.config 獲得remoteport
2 /oracle/product/10.2.0/crs_1/bin/racgons remove_config rac1:6200
2 srvctl remove instance -d dbrac -i dbrac11 (rac1上的service也自動刪除)
3 srvctl remove asm -n dbrac1
4 如果是10.2.0.4 可以 srvctl remove listener -n rac1 -i LISTENER_RAC1
        10.2.0.4以下的用netca刪除listener  */


--更新oracle inventory

[oracle@dbrac2 bin]$ pwd
/u01/oracle/product/10.2.0/db_1/oui/bin
[oracle@dbrac2 bin]$ ./runInstaller -updateNodeList ORACLE_HOME=$ORACLE_HOME "CLUSTER_NODES=dbrac2,dbrac3"  如果有多個則為:"CLUSTER_NODES=dbrac2,dbrac3"

[oracle@dbrac2 bin]$ pwd
/u01/oracle/product/10.2.0/crs/oui/bin

[oracle@dbrac2 bin]$ ./runInstaller -updateNodeList ORACLE_HOME=/u01/oracle/product/10.2.0/crs "CLUSTER_NODES=dbrac2,dbrac3" 

注意,這裡是目錄,一個是crs,一個是db

--刪除其它的一些註冊

[root@dbrac2 install]# pwd
/u01/oracle/product/10.2.0/crs/install
[root@dbrac2 install]# ./rootdeletenode.sh dbrac1,1

--最後確認成功
[oracle@dbrac2 bin]$ ./olsnodes -n
dbrac2  2

2、新增節點,一臺機器全新安裝後的新增

--首先安裝作業系統,保證與第一個節點版本一樣,包括asm的幾個包等

--確保,共享儲存能夠識別,並用用raw繫結

--配置引數

--建相應的目錄

安裝及繫結磁碟等,如果儲存方面出重啟磁碟亂序,請繫結ssid,詳細步驟,請參閱《linux系統 重啟磁碟機代號錯亂問題

--建立叢集信任

[oracle@dbrac3 ~]$ mkdir ~/.ssh

[oracle@dbrac3 ~]$ chmod 700 ~/.ssh

[oracle@dbrac3 ~]$ ssh-keygen -t rsa

[oracle@dbrac3 ~]$ ssh-keygen -t dsa

[oracle@dbrac2 ~]$ scp ~/.ssh/authorized_keys dbrac3:~/.ssh/authorized_keys

從其它節點複製這個檔案到新加節點去了

[oracle@dbrac3 .ssh]$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
[oracle@dbrac3 .ssh]$ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
[oracle@dbrac3 .ssh]$ scp ~/.ssh/authorized_keys dbrac2:~/.ssh/authorized_keys

同時複製回其它節點去,從上面的情況看,是複製到dbrac2這個節點,如果其它地方有,也要複製過去

--配置asm

[root@dbrac3 ~]# /etc/init.d/oracleasm configure

[root@dbrac3 init.d]# ./oracleasm listdisks
ASMD1
ASMD2
ASMD3
[root@dbrac3 init.d]# ./oracleasm scandisks
Scanning the system for Oracle ASMLib disks: [  OK  ]

[root@dbrac3 init.d]# raw -qa
/dev/raw/raw1:  bound to major 8, minor 17
/dev/raw/raw2:  bound to major 8, minor 33
/dev/raw/raw3:  bound to major 8, minor 49
/dev/raw/raw4:  bound to major 8, minor 65
/dev/raw/raw5:  bound to major 8, minor 81
/dev/raw/raw6:  bound to major 8, minor 97
/dev/raw/raw7:  bound to major 8, minor 113
/dev/raw/raw8:  bound to major 8, minor 129

注意,raw的繫結,要配置!

用叢集軟體檢查:

[oracle@dbrac3 .ssh]$ /u02/database/cluvfy/runcluvfy.sh stage -pre crsinst -n dbrac3 -verbose

檢查合格後,便可以安裝了

3、增加節點

--複製叢集軟體
[oracle@dbrac2 bin]$ pwd
/u01/oracle/product/10.2.0/crs/oui/bin
[oracle@dbrac2 bin]$ export DISPLAY=192.168.104.212:0.0
[oracle@dbrac2 bin]$ ls -lrt
total 224
-rwxrwxr-x 1 oracle oinstall  35634 Jun 22  2005 lsnodes
-rwxrwxr-x 1 oracle oinstall 163185 Jun 22  2005 runInstaller
drwxrwx--- 2 oracle oinstall   4096 Oct 12 15:26 resource
-rwxrwxr-x 1 oracle oinstall     70 Oct 12 15:27 runInstaller.sh
-rwxrwxr-x 1 oracle oinstall    952 Oct 12 15:27 runConfig.sh
-rwxr-xr-x 1 oracle oinstall    488 Oct 12 15:27 ouica.sh
-rwxrwxr-x 1 oracle oinstall     93 Oct 12 15:27 addNode.sh
-rwxrwxr-x 1 oracle oinstall    180 Oct 12 15:27 addLangs.sh
[oracle@dbrac2 bin]$ ./addNode.sh

在下一步中,新增節點的資訊,基本上按提示操作就行了

最後執行幾個指令碼,注意機器位置,看清楚

--在新加節點執行
[root@dbrac3 init.d]# sh /u01/oracle/oraInventory/orainstRoot.sh
Changing permissions of /u01/oracle/oraInventory to 770.
Changing groupname of /u01/oracle/oraInventory to oinstall.
The execution of the script is complete

--在存活節點執行
[root@dbrac2 ~]# sh /u01/oracle/product/10.2.0/crs/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 3: dbrac3 priv3 dbrac3
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
/u01/oracle/product/10.2.0/crs/bin/srvctl add nodeapps -n dbrac3 -A virt3/255.255.255.0/eth0 -o /u01/oracle/product/10.2.0/crs

--在新加節點執行
[root@dbrac3 init.d]# sh /u01/oracle/product/10.2.0/crs/root.sh

直接回車就可以了!

--增加rdbms軟體
[oracle@dbrac2 bin]$ pwd
/u01/oracle/product/10.2.0/db1/oui/bin
[oracle@dbrac2 bin]$ ./addNode.sh
Starting Oracle Universal Installer...

No pre-requisite checks found in oraparam.ini, no system pre-requisite checks will be executed.
Oracle Universal Installer, Version 10.2.0.1.0 Production
Copyright (C) 1999, 2005, Oracle. All rights reserved.

到最後的時候,仍然要執行一下root.sh

[root@dbrac3 init.d]# sh /u01/oracle/product/10.2.0/db1/root.sh

4、配置監聽
[oracle@dbrac2 bin]$ netca

透過圖形介面選擇,叢集,然後進行配置,如果提示存在,可以用reconfig選項,基本上沒問題


5、新增例項

注意,在現在存活的節點上執行,也就是有例項的節點進行,本例中只且一個dbrac2

[oracle@dbrac2 admin]$ dbca

注意,我在實際處理過程中,出現了一個失敗節點的錯誤,最後我只重新配置crs解決,詳細說明請參閱《oracle10g rac 表決盤損壞、ocr損壞處理》,再進行dbca時,完全透過!
關鍵步驟如下:
--選擇Oracle Real Application clusters database
--選擇instance management
--選擇add an instance

後面選擇檔案、日誌這些都可以完全透過,不影響!在開始的時候,1%的時候,要確定extend asm!

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

相關文章