一斤蔓、修改root用戶環(huán)境變量
[root@RAC1 ~]# vi .bash_profile
添加如下語句
JAVA_HOME=/usr/local/java
export JAVA_HOME
ORACLE_BASE=/u01/app/grid
export ORACLE_BASE
ORACLE_HOME=/u01/app/11.2.0/grid
export ORACLE_HOME
ORACLE_PATH=/u01/app/oracle/common/oracle/sql
export ORACLE_PATH
ORACLE_TERM=xterm
export ORACLE_TERM
NLS_DATE_FORMAT="DD-MON-YYYY HH24:MI:SS"
export NLS_DATE_FORMAT
TNS_ADMIN=$ORACLE_HOME/network/admin
export TNS_ADMIN
PATH=.:${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE
CLASSPATH=${CLASSPATH}:ORACLE_HOME/jlib
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib
export CLASSPATH
THREADS_FLAG=native
export THERADS_FLAG
export TEMP=/tmp
export TMPDIR=/tmp
運(yùn)行
[root@RAC1 ~]# source .bash_profile
使修改生效
二、原RAC信息
[root@RAC1 ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
#eth0 - Public IP
10.5.10.2 rac1
10.5.10.3 rac2
#eth1 - Private IP
8.8.8.1 rac1-priv
8.8.8.2 rac2-priv
#VIP
10.5.10.4 rac1-vip
10.5.10.5 rac2-vip
#SCAN
10.5.10.6 rac-cluster-scan
目前兩個(gè)節(jié)點(diǎn)的eth0 對應(yīng)Public IP的圆,eth1 對應(yīng)Private IP,目標(biāo)是eth0 與eht1 綁定bond0對應(yīng)Public IP尿背,eth3 與eth4 綁定bond1對應(yīng)Private IP,具體IP地址不變弟疆。
三、修改RAC配置
一旦修改網(wǎng)卡綁定之后批钠,RAC就不能啟動宇植,也就不能進(jìn)行修改,所以我們這里先修改PUBLIC和 Private配置埋心。修改完之后再綁定雙網(wǎng)卡当纱。
當(dāng)前Public和 Private信息
[root@RAC1 ~]# cd /u01/app/11.2.0/grid/bin/
[root@RAC1 bin]# oifcfg getif -global
eth0 10.5.10.0 global public
eth1 8.0.0.0 global cluster_interconnect
[root@RAC1 bin]# srvctl config nodeapps
網(wǎng)絡(luò)存在: 1/10.5.10.0/255.255.255.0/eth0, 類型 static
VIP 存在: /10.5.10.4/10.5.10.4/10.5.10.0/255.255.255.0/eth0, 托管節(jié)點(diǎn) rac1
VIP 存在: /10.5.10.5/10.5.10.5/10.5.10.0/255.255.255.0/eth0, 托管節(jié)點(diǎn) rac2
GSD 已存在
ONS 存在: 本地端口 6100, 遠(yuǎn)程端口 6200, EM 端口 2016
[root@RAC1 bin]# srvctl config nodeapps -n rac1 -a
-n <node_name> 選項(xiàng)已過時(shí)。
網(wǎng)絡(luò)存在: 1/10.5.10.0/255.255.255.0/eth0, 類型 static
VIP 存在: /10.5.10.4/10.5.10.4/10.5.10.0/255.255.255.0/eth0, 托管節(jié)點(diǎn) rac1
[root@RAC1 bin]# srvctl config nodeapps -n rac2 -a
-n <node_name> 選項(xiàng)已過時(shí)踩窖。
網(wǎng)絡(luò)存在: 1/10.5.10.0/255.255.255.0/eth0, 類型 static
VIP 存在: /10.5.10.5/10.5.10.5/10.5.10.0/255.255.255.0/eth0, 托管節(jié)點(diǎn) rac2
修改Public和 Private信息
刪除當(dāng)前配置
[root@RAC1 ~]# cd /u01/app/11.2.0/grid/bin/
[root@RAC1 bin]# oifcfg delif -global eth0
[root@RAC1 bin]# oifcfg delif -global eth1
PRIF-31: Failed to deletethe specified network interface because it is the last private interface
目前無法刪除Private 信息,需要先添加再刪除
[root@RAC1 bin]# oifcfg setif -global bond0/10.5.10.0:public
[root@RAC1 bin]# oifcfg setif -global bond1/8.0.0.0:cluster_interconnect
[root@RAC1 bin]# oifcfg delif -global eth1
[root@RAC1 bin]# oifcfg getif
bond0 10.5.10.0 global public
bond1 8.0.0.0 global cluster_interconnect
四晨横、雙網(wǎng)卡綁定配置
停止RAC
[root@RAC1 bin]# crsctl stop crs
RAC1操作
修改網(wǎng)卡配置文件
創(chuàng)建bond0配置文件
[root@RAC1 bin]# vi /etc/sysconfig/network-scripts/ifcfg-bond0
寫入
DEVICE=bond0
BOOTPROTO=none
IPADDR=10.5.10.2
NETMASK=255.255.255.0
ONBOOT=yes
TYPE=Ethernet
GATEWAY=10.5.10.254
USERCTL=no
IPV6INIT=no
PEERDNS=yes
創(chuàng)建bond1配置文件
[root@RAC1 bin]# vi /etc/sysconfig/network-scripts/ifcfg-bond1
寫入
DEVICE=bond1
BOOTPROTO=none
IPADDR=8.8.8.1
NETMASK=255.0.0.0
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
PEERDNS=yes
修改eth0
[root@RAC1 bin]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
IPV6INIT=no
USERCTL=no
PEERDNS=yes
MASTER=bond0
SLAVE=yes
修改eth1
[root@RAC1 bin]# vi /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
IPV6INIT=no
USERCTL=no
PEERDNS=yes
MASTER=bond0
SLAVE=yes
修改eth2
[root@RAC1 bin]# vi /etc/sysconfig/network-scripts/ifcfg-eth2
DEVICE=eth2
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
IPV6INIT=no
USERCTL=no
PEERDNS=yes
MASTER=bond1
SLAVE=yes
修改eth3
[root@RAC1 bin]# vi /etc/sysconfig/network-scripts/ifcfg-eth3
DEVICE=eth3
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
IPV6INIT=no
USERCTL=no
PEERDNS=yes
MASTER=bond1
SLAVE=yes
配置綁定模型
[root@RAC1 ~]# vi /etc/modprobe.d/dist.conf
添加
alias bond0 bonding
options bond0 miimon=100 mode=0
alias bond1 bonding
options bond1 miimon=100 mode=0
mode 的值表示工作模式洋腮,0代表負(fù)載,1代表冗余
配置網(wǎng)卡啟動順序
[root@RAC1 ~]# vi /etc/rc.d/rc.local
添加
ifenslave bond0 eth0 eth1
ifenslave bond1 eth2 eth3
關(guān)閉NetworkManager 服務(wù)
[root@RAC1 ~]# service NetworkManager stop
[root@RAC1 ~]# chkconfig NetworkManager off
重啟網(wǎng)絡(luò)服務(wù)
[root@RAC1 ~]# chkconfig NetworkManager off
[root@RAC1 ~]# service network restart
正在關(guān)閉接口 bond0: [確定]
正在關(guān)閉接口 bond1: [確定]
關(guān)閉環(huán)回接口: [確定]
彈出環(huán)回接口: [確定]
彈出界面 bond0: Determining if ip address 10.5.10.2 is already in use for device bond0...
[確定]
彈出界面 bond1: Determining if ip address 8.8.8.1 is already in use for device bond1...
[確定]
RAC1的網(wǎng)卡綁定操作完成
RAC2操作
RAC2的網(wǎng)卡綁定操作步驟與RAC1相同手形,注意修改對應(yīng)的bond0與bond1的IP地址即可啥供。
五、重啟RAC1與RAC2
六库糠、修改VIP
[root@RAC1 ~]# cd /u01/app/11.2.0/grid/bin/
[root@RAC1 bin]# srvctl modify nodeapps -n rac1 -A 10.5.10.4/255.255.255.0/bond0
[root@RAC1 bin]# srvctl modify nodeapps -n rac2 -A 10.5.10.5/255.255.255.0/bond0
七伙狐、啟動RAC
[root@RAC1 bin]# crsctl start crs
CRS-4640: Oracle High Availability Services is already active
CRS-4000: Command Start failed, or completed with errors.
RAC已經(jīng)啟動
[root@RAC1 bin]# crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.BACKUP.dg ora....up.type ONLINE ONLINE rac2
ora.DATA.dg ora....up.type ONLINE ONLINE rac2
ora....ER.lsnr ora....er.type ONLINE ONLINE rac1
ora....N1.lsnr ora....er.type ONLINE ONLINE rac1
ora.OCR.dg ora....up.type ONLINE ONLINE rac2
ora.asm ora.asm.type ONLINE ONLINE rac2
ora.cvu ora.cvu.type ONLINE ONLINE rac1
ora.db.db ora....se.type ONLINE ONLINE rac2
ora.gsd ora.gsd.type OFFLINE OFFLINE
ora....network ora....rk.type ONLINE ONLINE rac1
ora.oc4j ora.oc4j.type ONLINE ONLINE rac1
ora.ons ora.ons.type ONLINE ONLINE rac1
ora....SM1.asm application ONLINE OFFLINE
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application OFFLINE OFFLINE
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip ora....t1.type ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application ONLINE ONLINE rac2
ora.rac2.gsd application OFFLINE OFFLINE
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip ora....t1.type ONLINE ONLINE rac2
ora.scan1.vip ora....ip.type ONLINE ONLINE rac1
2016/9/12