四.配置Clusterware安装环境及安装
通信配置
在clusterware(CRS)和RacDatabase安装过程中,OracleUniversalInstaller(OUI)必须能够以oracle的身份自动将软件复制到所有RAC节点。这里我们通过配置ssh让oracle用户拥有不输入密码即可访问各节点的能力。
首先两个节点间互ping,要确保都是通的
要建立用户等效性,需要在两个节点上以oracle用户身份生成用户的公钥和私钥,首先在rac1执行:
[root@rac1opt]#su-oracle
[oracle@rac1~]$mkdir~/.ssh
[oracle@rac1~]$chmod700~/.ssh
[oracle@rac1~]$ssh-keygen-trsa
Generatingpublic/privatersakeypair.
Enterfileinwhichtosavethekey(/home/oracle/.ssh/id_rsa):
Enterpassphrase(emptyfornopassphrase):
Entersamepassphraseagain:
Youridentificationhasbeensavedin/home/oracle/.ssh/id_rsa.
Yourpublickeyhasbeensavedin/home/oracle/.ssh/id_rsa.pub.
Thekeyfingerprintis:
d2:69:eb:ac:86:62:27:50:99:ff:e8:1e:a2:e6:5d:7foracle@node1
[oracle@rac1~]$ssh-keygen-tdsa
Generatingpublic/privatedsakeypair.
Enterfileinwhichtosavethekey(/home/oracle/.ssh/id_dsa):
Enterpassphrase(emptyfornopassphrase):
Entersamepassphraseagain:
Youridentificationhasbeensavedin/home/oracle/.ssh/id_dsa.
Yourpublickeyhasbeensavedin/home/oracle/.ssh/id_dsa.pub.
Thekeyfingerprintis:
0a:9a:20:46:a2:28:ec:72:23:82:f2:9d:f8:62:9b:d1oracle@node1
接着在rac2中作同样的操作
切回rac1
[oracle@rac1~]$cat~/.ssh/id_rsa.pub>>~/.ssh/authorized_keys
[oracle@rac1~]$cat~/.ssh/id_dsa.pub>>~/.ssh/authorized_keys
提示:下列命令会提示你输入rac2的oracle密码,按照提示输入即可,如果失败可重新尝试执行命令。
[oracle@rac1~]$sshrac2cat~/.ssh/id_rsa.pub>>~/.ssh/authorized_keys
Theauthenticityofhost¨node2(192.168.100.102)¨can¨tbeestablished.
RSAkeyfingerprintis92:d1:ce:5b:c8:a1:52:d5:ac:00:5f:48:5d:12:06:e4.
Areyousureyouwanttocontinueconnecting(yes/no)?yes
Warning:Permanentlyadded¨node2,192.168.100.102¨(RSA)tothelistofknownhosts.
[oracle@rac1~]$sshrac2cat~/.ssh/id_dsa.pub>>~/.ssh/authorized_keys
[oracle@rac1~]$scp~/.ssh/authorized_keys
rac2:~/.ssh/authorized_keys
authorized_keys100%19922.0KB/s00:00
两机相互执行,看看是否还需要输入密码
[oracle@rac1~]$sshrac1date
[oracle@rac1~]$sshrac2date
[oracle@rac1~]$sshrac1-privdate
[oracle@rac1~]$sshrac2-privdate
切换至rac2执行
[oracle@rac2~]$sshrac1date
[oracle@rac2~]$sshrac2date
[oracle@rac2~]$sshrac1-privdate
[oracle@rac2~]$sshrac2-privdate
提示:
注意命令的返回信息,由于rac对节点间时间较敏感,因此如果此处显示节点单时间不一至,建议同步(一般相隔超过20秒就需要同步时间了)。
配置asm
注意:必须以root身份进行
首先在node1执行:
[root@rac1~]#/etc/init.d/oracleasmconfigure
ConfiguringtheOracleASMlibrarydriver.
Thiswillconfiguretheon-bootpropertiesoftheOracleASMlibrary
driver.Thefollowingquestionswilldeterminewhetherthedriveris
loadedonbootandwhatpermissionsitwillhave.Thecurrentvalues
willbeshowninbrackets(¨[]¨).Hittingwithouttypingan
answerwillkeepthatcurrentvalue.Ctrl-Cwillabort.
Defaultusertoownthedriverinterface[]:oracle
Defaultgrouptoownthedriverinterface[]:dba
StartOracleASMlibrarydriveronboot(y/n)[n]:y
FixpermissionsofOracleASMdisksonboot(y/n)[y]:y
WritingOracleASMlibrarydriverconfiguration:[OK]
Loadingmodule"oracleasm":[OK]
MountingASMlibdriverfilesystem:[OK]
ScanningsystemforASMdisks:[OK]
提示:如果本步执行出错(可能出错机率最高的是在ScanningsystemforASM),不妨将转换一下命令行的执行方式,改成:
[root@rac1~]#sh/etc/init.d/oracleasmconfigure
有可能解决你的问题!
然后切换至rac2执行
[root@rac2~]#/etc/init.d/oracleasmconfigure
ConfiguringtheOracleASMlibrarydriver.
Thiswillconfiguretheon-bootpropertiesoftheOracleASMlibrary
driver.Thefollowingquestionswilldeterminewhetherthedriveris
loadedonbootandwhatpermissionsitwillhave.Thecurrentvalues
willbeshowninbrackets(¨[]¨).Hittingwithouttypingan
answerwillkeepthatcurrentvalue.Ctrl-Cwillabort.
Defaultusertoownthedriverinterface[]:oracle
Defaultgrouptoownthedriverinterface[]:dba
StartOracleASMlibrarydriveronboot(y/n)[n]:y
FixpermissionsofOracleASMdisksonboot(y/n)[y]:y
WritingOracleASMlibrarydriverconfiguration:[OK]
Loadingmodule"oracleasm":[OK]
MountingASMlibdriverfilesystem:[OK]
ScanningsystemforASMdisks:[OK]
再切换回rac1执行
[root@rac1~]#/etc/init.d/oracleasmcreatediskVOL1/dev/sdd1
Markingdisk"/dev/sdd1"asanASMdisk:[OK]
[root@rac1~]#/etc/init.d/oracleasmcreatediskVOL2/dev/sde1
Markingdisk"/dev/sde1"asanASMdisk:[OK]
[root@rac1linux-patch]#/etc/init.d/oracleasmscandisks
ScanningsystemforASMdisks:[OK]
查看一下当前的磁盘组:
[root@rac1~]#/etc/init.d/oracleasmlistdisks
VOL1
VOL2
rac2上也查看一下当前磁盘组:
[root@rac2~]#/etc/init.d/oracleasmscandisks
ScanningsystemforASMdisks:[OK]
[root@rac2~]#/etc/init.d/oracleasmlistdisks
VOL1
VOL2
检查
/data/rhel5/clusterware/cluvfy/runcluvfy.shstage-precrsinst-nrac1,rac2–verbose
存在部分报错如:CouldnotfindasuitablesetofinterfacesforVIPs.compat-*等等报错,但可以忽略掉
安装时时间必须同步,两台虚拟机时刻存在时间不同步问题
可用ntp协议同
*****/usr/sbin/ntpdate192.168.100.100
*****sleep5;/usr/sbin/ntpdate192.168.100.100
*****sleep10;/usr/sbin/ntpdate192.168.100.100
*****sleep15;/usr/sbin/ntpdate192.168.100.100
*****sleep20;/usr/sbin/ntpdate192.168.100.100
*****sleep25;/usr/sbin/ntpdate192.168.100.100
*****sleep30;/usr/sbin/ntpdate192.168.100.100
*****sleep35;/usr/sbin/ntpdate192.168.100.100
*****sleep40;/usr/sbin/ntpdate192.168.100.100
*****sleep45;/usr/sbin/ntpdate192.168.100.100
*****sleep50;/usr/sbin/ntpdate192.168.100.100
*****sleep55;/usr/sbin/ntpdate192.168.100.100
隔5秒执行一次同步