RHEL 6.0 +Cluster+oracle11g 實施問題小結

實施了一次RHEL雙機Oracle的項目,實施過程慘不忍睹,2套HA,做了一個星期。

時隔一月,總算有時間把實施過程總結一下了。隨手寫幾點遇到的情況。

一、安裝RHEL6和HA環境

在安裝RHEL6操作系統的時候,可以手工的把HA模塊勾上,讓RHEL自動安裝。

如果安裝系統的時候沒有選擇,那就手工安裝吧:安裝 ricci、cman、rgmanager、lvm2-cluster。

 

二、配置RHEL6YUM源的方法:

1.Mount RHEL 6 ISO to /media/rhel6

# mount -o loop RHEL6.0-20101111.0-Server-x86_64-DVD.iso /media/rhel6

(掛載本地iso鏡像安裝採用此方式)

# mount /dev/cdrom /media/rhel6

(掛載光驅安裝採用此方式)

2.Copy media.repo file from the RHEL 6 ISO to /etc/yum.repos.d/

# cp /media/media.repo /etc/yum.repos.d/rhel6.repo

3.Configure the repo file to point to the /media/rhel6

# vi /etc/yum.repos.d/rhel6.repo

4.add following line :

baseurl=file:///media/rhel6/Server

5.If you want to configure repository for HighAvailability , LoadBalancer , ResilientStorage , ScalableFileSystem then you can add following lines in rhel6.repo file(如果你想配置高可用,負載均衡,存儲及擴展文件系統,添加如下內容:)

[dvd-HighAvailability]

mediaid=1289489697.332694

name=DVD for RHEL6 - HighAvailability

baseurl=file:///media/rhel6/HighAvailability

enabled=1

gpgcheck=0

[dvd-LoadBalancer]

mediaid=1289489697.332694

name=DVD for RHEL6 - LoadBalancer

baseurl=file:///media/rhel6/LoadBalancer

enabled=1

gpgcheck=0

[dvd-ResilientStorage]

mediaid=1289489697.332694

name=DVD for RHEL6 - ResilientStorage

baseurl=file:///media/rhel6/ResilientStorage

enabled=1

gpgcheck=0

[dvd-ScalableFileSystem] //這個只有在x86_64的光盤裏面纔有

mediaid=1289489697.332694

name=DVD for RHEL6 - ScalableFileSystem

baseurl=file:///media/rhel6/ScalableFileSystem

enabled=1

gpgcheck=0

6. 保存上面的內容,執行下面的命令:

# yum list

# yum grouplist 如果顯示出很多 rpm 包的名字,那麼說明配置成功了。

 三、關於lvm2的限制,或者說最大的數量。lvm2的最大數量爲4G即4294967296個。 同時對單個lv的最大大小也有限制,如下:The answer to this question depends upon the CPU architecture of your computer and the kernel you are a running:    For 2.4 based kernels, the maximum LV size is 2TB. For some older kernels, however, the limit was 1TB due to signedness problems in the block layer. Red Hat Enterprise Linux 3 Update 5 has fixes to allow the full 2TB LVs. Consult your distribution for more information in this regard.    For 32-bit CPUs on 2.6 kernels, the maximum LV size is 16TB.    For 64-bit CPUs on 2.6 kernels, the maximum LV size is 8EB. (Yes, that is a very large number.)

四、如果添加節點的時候報這個錯誤“The following errors occurred while creating cluster "zzdagora": %d format: a number is required, not Unicode”這個就是RHEL6.0的Luci的Bug,只能卸載老版本的Luci用最新版的Luci。rm -rf /var/lib/luci #刪除clui的數據庫yum -y remove luci #刪除luci軟件 yum -y install luci #重新安裝軟件 在確保2個節點cman停止的情況下,通過luci重新配置cluster. 

五、配置ILO3 IP地址

配置好節點內服務器的ILO3的IP和管理員帳號,具體方法google吧。

http://www.51kvm.com/technology/sp_10003.asp

 

六、關於HP ILO3接口RHCS的支持問題

RHEL6中的Cluster是不支持ILO3的,只能使用fence_ipmilan來實現

The iLO3 firmware should be a minimum of 1.15 as provided by HP.

On both cluster nodes, install the following OpenIPMI packages used for fencing:$ yum install OpenIPMI OpenIPMI-tools

Stop and disable the 'acpid' daemon:$ service acpid stop; chkconfig acpid off

Test ipmitool interaction with iLO3:$ ipmitool -H <ilo_ip> -I lanplus -U <ilo_username> -P <ilo_password> chassis power status

The desired output is:Chassis Power is on

Test that fencing is successful.  From node1 attempt to fence node2 as follows:$ fence_node node2

測試成功的話,直接在Luci Web界面中配置Fence資源吧。

 

七、配置集羣

添加節點名稱和成員

添加fence設備,注意:這裏的Fence設備要選擇ipmila

之後在節點界面,點節點名稱,關聯節點和Fence設備。

添加故障切換域

添加源:虛擬IP、共享卷、腳本等

添加服務

集羣的安裝、配置就到這裏了。

 

八、下面是Oracle,這個和其他的雙機軟件配置差不多。

兩臺機器上的Oracle安裝配置等要一致。Oracle安裝到本地,用DBCA創建數據庫,庫文件、控制文件、聯機重做日誌文件等都放到共享盤櫃上。

注意: 創建數據庫的時候最好和應用方溝通好細節問題,如字符集、歸檔、連接模式等,雖然之後可以改,但還是建議事先溝通。

 

九、Oracle的起停腳本

操作如下:
在root賬戶下修改/etc/oratab 文件:
# vi /etc/oratab
找到orcl=/db/app/oracle/product/11.1.0/db_1 :N這一行
改爲:
orcl=/db/app/oracle/product/11.1.0/db_1 :Y
也就是將最後的N改爲Y,意思是將不允許自動啓動改爲允許自動啓動。

注意:RHEL的HA必須按照上述設置

修改ORACLE自帶的啓動與關閉腳本,分別是dbstartdbshut

在oracle賬戶下修改$ORACLE_HOME/bin/dbstart文件:

# su - ORACLE
$ cd $ORACLE_HOME/bin
$ vi dbstart

找到 ORACLE_HOME_LISTNER=$1這一行
改爲:
ORACLE_HOME_LISTNER=$ORACLE_HOME

然後同樣的方案 修改dbshut文件。

這個腳本被放在/etc/init.d目錄中,腳本的名字是oracle11g

 

#!/bin/bash

#chkconfig:2345 99 10

#description:StartupScriptfororacleDatabases

#/etc/rc.d/init.d/oradbstart

export ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_1/

export ORACLE_SID=orcl

export PATH=$PATH:$ORACLE_HOME/bin

case "$1" in

start)

echo"-----startuporacle-----"&gt;&gt;/var/log/oracle11log

su - oracle -lc $ORACLE_HOME/bin/dbstart

touch /var/lock/subsys/oracle11

echo "-----startuporaclesuccessful-----"&gt;&gt;/var/log/oracle11log

echo "OK"

;;

stop)

echo"-----shutdwnoracle-----"&gt;&gt;/var/log/oracle11log

su - oracle -lc $ORACLE_HOME/bin/dbshut

rm -f /var/lock/subsys/oracle11

echo "-----shutdownoraclesuccessful-----"&gt;&gt;/var/log/oracle11log

echo "OK"

;;

status)

status oracle

;;

*)

echo "usage: oracle11g { start | stop | status}"

exit 1

esac

exit 0

先寫到這裏吧,寫的很亂,想到了再添加。

 

十、參考的資料:

http://hi.baidu.com/btpolo/blog/item/0e89ccfb23c45f7e034f56af.html

http://32727.blog.51cto.com/22727/687485

 

紅帽官方中文文檔:

http://docs.redhat.com/docs/zh-CN/Red_Hat_Enterprise_Linux/6/html/Cluster_Administration/index.html

 

RHEL6_LAMP環境雙機熱備.pdf:

http://bbs.51cto.com/thread-861411-1.html

 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章