Redhat安装clusterware的文档
关闭sendmail服务,加快启动
# chkconfig sendmail off
完成操作系统的安装后
1)增加两个硬盘,修改Red Hat Enterprise Linux 4.vmx
disk.locking="FALSE"
diskLib.dataCacheMaxSize="0"
diskLib.dataCacheMaxReadAheadSize="0"
diskLib.dataCacheMinReadAheadSize="0"
diskLib.dataCacheMaxPageSize="4096"
diskLib.maxUnsyncedWrites="0
2)添加一张新网卡eth1.
eth0 为RAC的公共网络NAT
eth1 为RAC的私有网络HOST ONLY
#vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
BROADCAST=192.168.119.255
IPADDR=192.168.119.11
NETMASK=255.255.255.0
HWADDR=00:0C:29:B9:4B:E8
ONBOOT=yes
TYPE=Ethernet
#vi /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
BOOTPROTO=static
IPADDR=192.168.101.31
GATEWAY=192.168.101.1
HWADDR=00:0C:29:B9:4B:F2
ONBOOT=yes
TYPE=Ethernet
#service network restart
3)修改主机名和hosts
# vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=node1
# vi /etc/hosts
127.0.0.1 localhost.localdomain localhost
192.168.119.11 node1
192.168.119.12 node2
192.168.119.21 node1-vip
192.168.119.22 node2-vip
192.168.101.31 node1-priv
192.168.101.32 node2-priv
4)创建组oinstall, dba,用户oracle
#groupadd dba
#useradd -g dba oracle
#passwd oracle
#id oracle
5)修改oracle用户的初始化参数文件
$vi /home/oracle/.bash_profile
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_BASE=/opt/ora10g
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORACLE_SID=RACDB1
export ORACLE_TERM=xterm
export PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/bin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin/
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
unset USERNAME
6)创建oracle的安装目录并授权
#groupadd oinstall
#groupadd dba
#useradd -g oinstall -G dba oracle
#passwd oracle
#id oracle
5)修改oracle用
7)修改操作系统内核参数
/*配置内核参数*/
#vi /etc/sysctl.conf
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144
/*设置oracle 使用的文件数权限*/
#vi /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
/*修改安全限制*/
#vi /etc/pam.d/login
session required /lib/security/pam_limits.so
/*配置Hangcheck 计时器*/
#vi /etc/rc.local
modprobe hangcheck-timer hangcheck-tick=30 hangcheck_margin=180
8)磁盘分区
[root@localhost ~]# fdisk -l
Disk /dev/sda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 204 1534207+ 82 Linux swap
/dev/sda3 205 1305 8843782+ 83 Linux
Disk /dev/sdb: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 60 481918+ 83 Linux
/dev/sdb2 61 120 481950 83 Linux
/dev/sdb3 121 180 481950 83 Linux
/dev/sdb4 181 1305 9036562+ 5 Extended
/dev/sdb5 181 240 481918+ 83 Linux
/dev/sdb6 241 300 481918+ 83 Linux
/dev/sdb7 301 360 481918+ 83 Linux
/dev/sdb8 361 480 963868+ 83 Linux
/dev/sdb9 481 600 963868+ 83 Linux
/dev/sdb10 601 720 963868+ 83 Linux
/dev/sdb11 721 840 963868+ 83 Linux
/dev/sdb12 841 960 963868+ 83 Linux
/dev/sdb13 961 1080 963868+ 83 Linux
Disk /dev/sdc: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 1 65 522081 83 Linux
/dev/sdc2 66 130 522112+ 83 Linux
Disk /dev/sdd: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdd1 1 1044 8385898+ 83 Linux
[root@localhost ~]#
9)配置裸设备
+用服务的方式绑定,开机时自动加载裸设备
#vi /etc/sysconfig/rawdevices
/dev/raw/raw1 /dev/sdb1
/dev/raw/raw2 /dev/sdb2
/dev/raw/raw3 /dev/sdb3
/dev/raw/raw4 /dev/sdb5
/dev/raw/raw5 /dev/sdb6
/dev/raw/raw6 /dev/sdb7
/dev/raw/raw7 /dev/sdb8
/dev/raw/raw8 /dev/sdb9
/dev/raw/raw9 /dev/sdb10
/dev/raw/raw10 /dev/sdb11
/dev/raw/raw11 /dev/sdb12
/dev/raw/raw12 /dev/sdb13
/dev/raw/raw13 /dev/sdc1
/dev/raw/raw14 /dev/sdc2
然后启动服务:
#service rawdevices stop
#service rawdevices start
10)修改裸设备的属主
+修改/etc/udev/permissions.d/50-udev.permissions文件
将/etc/udev/permissions.d/50-udev.permissions的113行
从
raw/*:root:disk:0660
修改为
raw/*:oracle:oinstall:0660
11)安装rpm包
compat-gcc-7.3-2.96.128.i386.rpm
compat-libstdc++-7.3-2.96.128.i386.rpm
compat-libstdc++-devel-7.3-2.96.128.i386.rpm
compat-gcc-c++-7.3-2.96.128.i386.rpm
[root@node2 share]# rpm -Uvh compat-libstdc++-7.3-2.96.128.i386.rpm
warning: compat-libstdc++-7.3-2.96.128.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
Preparing... ########################################### [100%]
file /usr/lib/libstdc++-2-libc6.1-1-2.9.0.so from install of compat-libstdc++-7.3-2.96.128 conflicts with file from package compat-libstdc++-296-2.96-132.7.2
file /usr/lib/libstdc++-3-libc6.2-2-2.10.0.so from install of compat-libstdc++-7.3-2.96.128 conflicts with file from package compat-libstdc++-296-2.96-132.7.2
[root@node2 share]# rpm -e compat-libstdc++-296-2.96-132.7.2
[root@node2 share]# rpm -Uvh compat-libstdc++-7.3-2.96.128.i386.rpm
warning: compat-libstdc++-7.3-2.96.128.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
Preparing... ########################################### [100%]
1:compat-libstdc++ ########################################### [100%]
12)COPY新节点node2
+修改HOSTNAME
# vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=node2
+修改IP,MAC
#vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
BROADCAST=192.168.119.255
IPADDR=192.168.119.12
NETMASK=255.255.255.0
HWADDR=00:0C:29:B9:4B:E8
ONBOOT=yes
TYPE=Ethernet
#vi /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
BOOTPROTO=static
IPADDR=192.168.101.32
GATEWAY=192.168.101.1
HWADDR=00:0C:29:B9:4B:F2
ONBOOT=yes
TYPE=Ethernet
#service network restart
+修改.bash_profile
export ORACLE_SID=RACDB2
13)时间同步
+在node1节点启动时间服务
chkconfig time on
如果不启动该服务,则其他节点与该节点同步时间时会报错:Connect Refused
在node2节点与node1节点同步时间
rdate -s 192.168.119.11
# crontab -l
*/1 * * * * rdate -s 192.168.119.11
14)配置clusterware安装环境
+两节点能相互ping通
+oracle 用户下生成公钥和私钥
++in node1
#su - oracle
$mkdir ~/.ssh
$chmod 700 ~/.ssh
$ssh-keygen -t rsa
$ssh-keygen -t dsa
++in node2
#su - oracle
$mkdir ~/.ssh
$chmod 700 ~/.ssh
$ssh-keygen -t rsa
$ssh-keygen -t dsa
++in node1
$cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
$cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
$ssh node2 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
$ssh node2 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
$scp ~/.ssh/authorized_keys node2:~/.ssh/authorized_keys
+在两个节点测试相互执行是否需要输入密码
ssh node1 date
ssh node2 date
ssh node1-priv date
ssh node2-priv date
16)安装clusterware
+in node1检查安装前环境
$clusterware/cluvfy/runcluvfy.sh stage -pre crsinst -n node1,node2 -verbose
此时只有一处错误,是由bug引起的,可以忽略。DOC ID:338924.1
====================================
Suitable interfaces for the private interconnect on subnet "192.168.245.0":
node2 eth0:192.168.245.12
node1 eth0:192.168.245.11
Suitable interfaces for the private interconnect on subnet "192.168.31.0":
node2 eth1:192.168.31.32
node1 eth1:192.168.31.31
ERROR:
Could not find a suitable set of interfaces for VIPs.
Result: Node connectivity check failed.
====================================
17)安装CRS
+in node1
#xhost +
#su - oracle
$./runInstaller
..
...
/dev/raw/raw13
....
[root@node2 ~]# sh /opt/ora10g/oraInventory/orainstRoot.sh
Changing permissions of /opt/ora10g/oraInventory to 770.
Changing groupname of /opt/ora10g/oraInventory to oinstall.
The execution of the script is complete
[root@node2 ~]# sh /opt/ora10g/product/10.2.0/crs_1/root.sh
WARNING: directory '/opt/ora10g/product/10.2.0' is not owned by root
WARNING: directory '/opt/ora10g/product' is not owned by root
WARNING: directory '/opt/ora10g' 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 '/opt/ora10g/product/10.2.0' is not owned by root
WARNING: directory '/opt/ora10g/product' is not owned by root
WARNING: directory '/opt/ora10g' is not owned by root
assigning default hostname node1 for node 1.
assigning default hostname node2 for node 2.
Successfully accumulated necessary OCR keys.
Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node
:
node 1: node1 node1-priv node1
node 2: node2 node2-priv node2
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
Now formatting voting device: /dev/raw/raw4
Format of 1 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.
node1
node2
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.
[root@node2 ~]#
/*手工重新配置node1-vip和node2-vip*/
[root@node2 ~]# /opt/ora10g/product/10.2.0/crs_1/bin/vipca
IP Alias Name IP address
node1-vip 192.168.245.21
node2-vip 192.168.245.22
安装结束后Exit.回到node1,按OK结束.
在Configuration Assistants中
Oracle Cluster Verification Utility 检查失败,但不影响正常运行。
Next -> Finish完成clusterware安装.
+检查安装后cluster的状态
[root@node1 ~]# /opt/ora10g/product/10.2.0/crs_1/bin/crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.node1.gsd application ONLINE ONLINE node1
ora.node1.ons application ONLINE ONLINE node1
ora.node1.vip application ONLINE ONLINE node1
ora.node2.gsd application ONLINE ONLINE node2
ora.node2.ons application ONLINE ONLINE node2
ora.node2.vip application ONLINE ONLINE node2
[root@node1 ~]#
18)安装database软件
+in node1
过程略
19)创建数据库
+in node1
+裸设备的配置文件
[oracle@node1 ~]$ cat raw.conf
control1=/dev/raw/raw1
control2=/dev/raw/raw2
redo1_1=/dev/raw/raw3
redo1_2=/dev/raw/raw4
redo2_1=/dev/raw/raw5
redo2_2=/dev/raw/raw6
sysaux=/dev/raw/raw7
system=/dev/raw/raw8
temp=/dev/raw/raw9
undotbs1=/dev/raw/raw10
undotbs2=/dev/raw/raw11
users=/dev/raw/raw12