jony413

多媒体信息发布、排队叫号、医院分诊、电子班牌

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

五、安装oracle clusterware
Oracle CRS 包含所有集群和数据库配置元数据以及多个适用于 RAC 的系统管理特性。通过它,数据库管理员可以将一个 Oracle 实例(或多个实例)注册和调用到集群。通常,CRS 将向集群中配置的所有节点发送消息(通过一种特殊的 ping 操作),通常称作“心跳”。如果针对任何节点的心跳检测失败,则它将核对 CRS 配置文件(位于共享磁盘上)以辨别是节点故障还是网络故障。 
安装 CRS 后,用于安装 Oracle 数据库 10g 的 Oracle Universal Installer (OUI) 将自动识别这些节点。与安装CRS一样,只需从一个节点运行 Oracle 10g 数据库软件。OUI 将把此软件程序包复制到 RAC 集群中配置的所有节点。 

必须在安装 oracle database前先安装并运行 CRS。
必须将 CRS_HOME 和 ORACLE_HOME 安装在不同的位置。 
在安装 CRS 之前,必须提供表决文件(votingdisk)和 Oracle 配置信息库 (OCR) 文件的共享位置或设备。表决文件的大小至少应为20MB,OCR 文件的大小至少应为100MB。 
 
强烈建议在安装前使用CVU工具来检测一下安装环境,用法见“cluvfy用法”一文。事实上,在安装完clusterware后,OUI会调用CVU来检查安装情况。
1、到oracle网站下载clusterware软件,并解压,,两个节点都需要
gunzip 10201_clusterware_linux_x86_64.cpio.gz 
cpio -idmv <10201_clusterware_linux_x86_64.cpio
2、在zhh1节点,图形化界面以oracle用户登陆
[oracle@zhh1 ~]$ source .bash_profile
[oracle@zhh1 ~]$ cd /usr/oracle/soft/clusterware
[oracle@zhh1 clusterware]$ ./runInstaller
3、出现提示:Has 'rootpre.sh' been run by root? [y/n] (n)
在两个节点上都以root用户运行rootpre.sh
[root@zhh1 oracle]# sh /usr/oracle/soft/clusterware/rootpre/rootpre.sh 
No OraCM running
[root@zhh2 soft]# sh /usr/oracle/soft/clusterware/rootpre/rootpre.sh 
No OraCM running
4、欢迎页面:单击 Next 
5、指定 Inventory 目录和身份证明: 
输入 inventory 目录的完整路径:/usr/oracle/oraInventory 
指定操作系统组名:dba
6、指定 Home 详细内容: 
名称:OraCrs10g_home 
/usr/oracle/product/10.2.0/crs_1
7、特定于产品的必要条件检查: 
忽略有关物理内存要求的警告。
8、指定集群配置:单击 Add 
公共节点名称:zhh2 
专用节点名称:zhh2-priv
虚拟主机名称:zhh2-vip
9、指定网络接口用法: 
接口名称:eth0 
子网: 192.168.5.0 
接口类型:Public 
接口名称:eth1 
子网: 10.0.0.0 
接口类型:Private
10、指定 Oracle 集群注册表 (OCR) 位置:选择 Normal Redundancy
指定 OCR 位置:/dev/raw/raw1
镜像位置/ocr/ocr
11、指定表决磁盘位置:选择 External Redundancy
表决磁盘位置:/dev/raw/raw2
镜像1/dev/raw/raw3
镜像2/votingdisk/votingdisk
12、摘要:单击 Install 
13、执行配置脚本:以 root 用户身份按顺序执行以下脚本(一次执行一个)。在当前脚本完成后,再继续执行下一个脚本。 
 zhh1 上执行/usr/oracle/oraInventory/orainstRoot.sh 
 zhh2 上执行/usr/oracle/oraInventory/orainstRoot.sh 
 zhh1 上执行/usr/oracle/product/10.2.0/crs_1/root.sh 
 zhh2 上执行/usr/oracle/product/10.2.0/crs_1/root.sh
 
[root@zhh1 /]# sh /usr/oracle/oraInventory/orainstRoot.sh
Changing permissions of /usr/oracle/oraInventory to 770.
Changing groupname of /usr/oracle/oraInventory to dba.
The execution of the script is complete
 
[root@zhh2 ~]# sh /usr/oracle/oraInventory/orainstRoot.sh
Changing permissions of /usr/oracle/oraInventory to 770.
Changing groupname of /usr/oracle/oraInventory to dba.
The execution of the script is complete
 
[root@zhh1 /]# sh /usr/oracle/product/10.2.0/crs_1/root.sh
WARNING: directory '/usr/oracle/product/10.2.0' is not owned by root
WARNING: directory '/usr/oracle/product' is not owned by root
WARNING: directory '/usr/oracle' is not owned by root
Checking to see if Oracle CRS stack is already configured
/etc/oracle does not exist. Creating it now.
 
Setting the permissions on OCR backup directory
Setting up NS directories
Oracle Cluster Registry configuration upgraded successfully
WARNING: directory '/usr/oracle/product/10.2.0' is not owned by root
WARNING: directory '/usr/oracle/product' is not owned by root
WARNING: directory '/usr/oracle' is not owned by root
Successfully accumulated necessary OCR keys.
Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node <nodenumber>: <nodename> <private interconnect name> <hostname>
node 1: zhh1 zhh1-priv zhh1
node 2: zhh2 zhh2-priv zhh2
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
Now formatting voting device: /dev/raw/raw2
Now formatting voting device: /dev/raw/raw3
Now formatting voting device: /votingdisk/votingdisk
Format of 3 voting devices complete.
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.
        zhh1
CSS is inactive on these nodes.
        zhh2
Local node checking complete.
Run root.sh on remaining nodes to start CRS daemons.
 
[root@zhh2 ~]# sh /usr/oracle/product/10.2.0/crs_1/root.sh
WARNING: directory '/usr/oracle/product/10.2.0' is not owned by root
WARNING: directory '/usr/oracle/product' is not owned by root
WARNING: directory '/usr/oracle' is not owned by root
Checking to see if Oracle CRS stack is already configured
/etc/oracle does not exist. Creating it now.
 
Setting the permissions on OCR backup directory
Setting up NS directories
Oracle Cluster Registry configuration upgraded successfully
WARNING: directory '/usr/oracle/product/10.2.0' is not owned by root
WARNING: directory '/usr/oracle/product' is not owned by root
WARNING: directory '/usr/oracle' is not owned by root
clscfg: EXISTING configuration version 3 detected.
clscfg: version 3 is 10G Release 2.
Successfully accumulated necessary OCR keys.
Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node <nodenumber>: <nodename> <private interconnect name> <hostname>
node 1: zhh1 zhh1-priv zhh1
node 2: zhh2 zhh2-priv zhh2
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.
        zhh1
        zhh2
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
The given interface(s), "eth0" is not public. Public interfaces should be used to configure virtual IPs.
 
zhh2 上的 root.sh 脚本会自动调用 VIPCA,但会因为“The given interface(s), "eth0" is not public.Public interfaces should be used to configure virtual IPs.”错误而失败。如果公共接口使用不可路由的 IP 地址 (192.168.x.x),则 Oracle 集群验证实用程序 (CVU) 将无法找到合适的公共接口。解决方法是手动运行 VIPCA 
在两个节点上检查CRS是否安装成功。
[root@zhh2 ~]# /usr/oracle/product/10.2.0/crs_1/bin/crsctl check crs
CSS appears healthy
CRS appears healthy
EVM appears healthy
 
14、图形化界面以 root 用户身份在第二个节点zhh2上手动调用 VIPCA
# /usr/oracle/product/10.2.0/crs_1/bin/vipca 
15、欢迎页面:单击 Next 
16、网络接口:选择 eth0 
17、集群节点的虚拟 IP 
只需要在“IP Alias Name”中填入名称,tab键自动补全ip address
节点名称:zhh1 
IP 别名:zhh1-vip 
IP 地址: 192.168.5.233 
子网掩码: 255.255.255.0 
节点名称:zhh2 
IP 别名:zhh2-vip 
IP 地址: 192.168.5.234 
子网掩码: 255.255.255.0
18、摘要:单击 Finish
19、配置助手进度对话框:配置完成后,单击 OK 
20、配置结束:单击 Exit 
21、返回到 zhh1 的执行配置脚本屏幕,然后单击 OK
22、配置助手:验证所有检查均成功。OUI 在最后会执行集群件安装后检查。
23、确认clusterware安装成功
[root@zhh1 ~]#  /usr/oracle/product/10.2.0/crs_1/bin/crsctl check crs
CSS appears healthy
CRS appears healthy
EVM appears healthy
[root@zhh1 ~]# cd /usr/oracle/product/10.2.0/crs_1/bin/
[root@zhh1 bin]# ./olsnodes
zhh1
zhh2
[root@zhh1 bin]# ./crsctl check crs
CSS appears healthy
CRS appears healthy
EVM appears healthy
 [root@zhh1 bin]# ./crs_stat -t -v
Name           Type           R/RA   F/FT   Target    State     Host        
----------------------------------------------------------------------
ora.zhh1.gsd   application    0/5    0/0    ONLINE    ONLINE    zhh1        
ora.zhh1.ons   application    0/3    0/0    ONLINE    ONLINE    zhh1        
ora.zhh1.vip   application    0/0    0/0    ONLINE    ONLINE    zhh1        
ora.zhh2.gsd   application    0/5    0/0    ONLINE    ONLINE    zhh2        
ora.zhh2.ons   application    0/3    0/0    ONLINE    ONLINE    zhh2        
ora.zhh2.vip   application    0/0    0/0    ONLINE    ONLINE    zhh2  
 
ps
1、这一步的root.sh会在/etc/inittab文件最下边增加3行:
h1:35:respawn:/etc/init.d/init.evmd run >/dev/null 2>&1 </dev/null
h2:35:respawn:/etc/init.d/init.cssd fatal >/dev/null 2>&1 </dev/null
h3:35:respawn:/etc/init.d/init.crsd run >/dev/null 2>&1 </dev/null
熟悉linux的都会知道respawn参数的意思:如果crsdevmd进程发生异常,则系统自动重启这两个进程;如果cssd进程发生异常,则系统会立即重启。因此想通过kill -9 pid来停掉crs是行不通的。
2、如果clusterware安装失败,需要干净地卸载才能重装。请参考metalink 239998.1文档。
一般情况下在每个节点上先运行$ORA_CRS_HOME/install/rootdelete.sh,然后运行$ORA_CRS_HOME/install/rootdeinstall.sh即可。

posted on 2013-01-20 10:46  jony413  阅读(380)  评论(0)    收藏  举报