Oracle 10gR2 Clusterware 简明安装步骤

一、安装操作系统(略)
注意,我这里用的都是OEL 5u5版本,因为自带了Oracle提供的环境变量安装包,因此可以很方便地进行Oracle软件的安装,因此推荐使用该版本

二、配置本地yum源

--把安装盘mount到media
mount -t iso9660 /dev/cdrom /media


--配置repos添加以下内容
vi /etc/yum.repos.d/oel5.repos
[oel5]
name = oel 5 DVD
basurl = file:///media/Server
gpgcheck =0
enabled = 1    --为1表示启用这个repos

三、配置信任关系(oracle用户)

--节点1和节点2分别执行:
ssh-keygen -t rsa
ssh-keygen -t dsa

--节点1执行:
cat ~/.ssh/*.pub >> ~/.ssh/authorized_keys
ssh rac2 cat ~/.ssh/*.pub >> ~/.ssh/authorized_keys
scp ~/.ssh/authorized_keys rac2:~/.ssh/authorized_keys

总之就是把2边节点的信息写到公钥文件中去,然后互相ssh就不再需要密码了,因为RAC安装时需要在节点之间复制文件

--验证
节点1执行:
ssh rac1 date
ssh rac2 date
ssh rac1-priv date
ssh rac2-priv date


节点2执行:
ssh rac1 date
ssh rac2 date
ssh rac1-priv date
ssh rac2-priv date

多验证几次,直到不需要输入密码为止,这里要注意authorized_keys中不要漏掉s,我曾经试了半天也没有成功,最后发现是公钥文件名错了,少了个s导致的

四、配置共享磁盘

--添加若干块磁盘并分区
fdisk -l
fdisk /dev/sdb
fdisk /dev/sdc
fdisk /dev/sdd
fdisk /dev/sde

如果碰到需要重启后才能识别分区信息,可以使用linux自带的partporbe命令,执行一下就可以在不重启的情况下让kernel识别新的分区
也可以执行partprobe -s进行查看

[root@rac1 ~]# fdisk /dev/sdc

Command (m for help): n
Command action
  e  extended
  p  primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-12, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-12, default 12):
Using default value 12

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
[root@rac1 ~]# partprobe -s
/dev/sda: msdos partitions 1 2
/dev/sdb: msdos partitions 1
/dev/sdc: msdos partitions 1
/dev/sdd: msdos partitions 1
/dev/sde: msdos partitions 1
[root@rac2 install]#

--绑定磁盘
对于4.x和5.x的系统,绑定方法是不同的

4.x:
# vi /etc/sysconfig/rawdevices

/dev/raw/raw1 /dev/sdc1
/dev/raw/raw2 /dev/sdd1
/dev/raw/raw3 /dev/sde1

#  vi /etc/udev/permissions.d/50-udev.permissions
# raw devices
ram*:root:disk:0660
#raw/*:root:disk:0660
raw/*:oracle:dba:0660

5.x:

# vi /etc/udev/rules.d/60-raw.rules

ACTION=="add",KERNEL=="/dev/sdb1",RUN+="/bin/raw /dev/raw/raw1 %N"

ACTION=="add",ENV{MAJOR}=="8",ENV{MINOR}=="17",RUN+="/bin/raw /dev/raw/raw1 %M %m"

ACTION=="add",KERNEL=="/dev/sdc1",RUN+="/bin/raw /dev/raw/raw2 %N"

ACTION=="add",ENV{MAJOR}=="8",ENV{MINOR}=="33",RUN+="/bin/raw /dev/raw/raw2 %M %m"

ACTION=="add",KERNEL=="/dev/sdd1",RUN+="/bin/raw /dev/raw/raw3 %N"

ACTION=="add",ENV{MAJOR}=="8",ENV{MINOR}=="49",RUN+="/bin/raw /dev/raw/raw3 %M %m"

ACTION=="add",KERNEL=="/dev/sde1",RUN+="/bin/raw /dev/raw/raw4 %N"

ACTION=="add",ENV{MAJOR}=="8",ENV{MINOR}=="65",RUN+="/bin/raw /dev/raw/raw4 %M %m"

ACTION=="add",KERNEL=="raw*",OWNER="oracle",GROUP="oinstall",MODE="660"

只需要添加红色部分就可以了,然后重启udev,配置正常就会显示如下内容:

[root@rac1 ~]$ ll /dev/raw

total 0
crw-rw---- 1 oracle oinstall 162,  1 Jan 15 22:54 raw1
crw-rw---- 1 oracle oinstall 162,  2 Jan 15 22:24 raw2
crw-rw---- 1 oracle oinstall 162,  3 Jan 15 22:56 raw3
crw-rw---- 1 oracle oinstall 162,  4 Jan 15 22:54 raw4

五、添加环境变量

节点1:
[oracle@rac1 ~]$vi .bash_profile
export ORACLE_SID=RAC1
export ORACLE_HOME=/u01/oracle/10.2.0/db_1
export ORA_CRS_HOME=/u01/oracle/10.2.0/crs_1
export PATH=$ORACLE_HOME/bin:$ORA_CRS_HOME/bin:$ORACLE_HOME/jdk/bin:$PATH

节点2:
[oracle@rac1 ~]$vi .bash_profile
export ORACLE_SID=RAC2
export ORACLE_HOME=/u01/oracle/10.2.0/db_1
export ORA_CRS_HOME=/u01/oracle/10.2.0/crs_1
export PATH=$ORACLE_HOME/bin:$ORA_CRS_HOME/bin:$ORACLE_HOME/jdk/bin:$PATH

六、安装Clusterware

--先进行安装前校验
cd ./clusterware/cluvfy

./cluvfy.sh -stage pre crsinst -n rac1,rac2 -verbose

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/31b405184c48b423526a13ac3c7b01cb.html