oracle 10g rac部署文档
主机网络配置注意事项:
ip地址使用静态配置:static
网关要指定
hostname不要出现在回环地址!
如果启动过单机asm服务,请先停止
-------------------------------
1,配置2台机器IP能是PING通
2更改机器名字
vi /etc/sysconfig/network
3,配置静态IP vi /etc/sysconfig/network-scripts/ifcfg-eth0
4,CP 一个网卡eth:2 --心跳IP
cp ifcfg-eth0 ifcfg-eth0:2
更改里面信息
DEVICE=eth0:2
BOOTPROTO=static
IPADDR=10.10.10.11
GATEWAY=10.10.10.1
改完重启service network restart
5,配置HOSTS文件 A机器 和B机器一样
192.168.10.11 oracle1 --主机静态私有IP
192.168.10.12 oracle2 --主机静态私有IP
192.168.10.21 oracle1-vip --浮动IP
192.168.10.22 oracle2-vip --浮动IP
10.10.10.11 oracle1-priv --心跳线IP
10.10.10.12 oracle2-priv --心跳线IP
6,配置hangcheck-timer
vi /etc/rc.local
7,设置ORACLE用户密码
8,设置私钥、公钥
9,把A的传给B,B追加到authorized_keys,再传给A 2台机器都有融合的信息文件
10,SSH连接把验证一下每个节点验证2次,1次自己的(静态、心跳),1次对方的(静态、心跳)。
11,
-----------------------------
在node1 & node2 运行install.sh
为oracle用户设置口令
修改oracle用户.bashrc文件
export ORA_CRS_HOME=/u01/app/crs_1
export ORACLE_SID=racdb#
su -
chown oracle.oinstall /u01/app -R
配置网络:
vi /etc/hosts
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
# Public Network - (eth0)
192.168.3.50 stu50
192.168.3.52 stu52
# Public Virtual IP (eth0:1)
192.168.3.51 stu50-vip
192.168.3.53 stu52-vip
# Private Interconnect - (eth1 -> eth0:2)
10.0.0.50 stu50-priv
10.0.0.52 stu52-priv
配置eth0:2:
cd /etc/sysconfig/network-scripts/
cp ifcfg-eth0 ifcfg-eth0:2
DEVICE=eth0:2
BOOTPROTO=static
HWADDR=00:E0:4D:3B:0C:B2
IPADDR=10.0.0.50
IPV6INIT=yes
IPV6_AUTOCONF=yes
NETMASK=255.255.255.0
GATEWAY=10.0.0.1
ONBOOT=yes
配置hangcheck-timer:用于监视 Linux 内核是否挂起
vi /etc/modprobe.conf
options hangcheck-timer hangcheck_tick=30 hangcheck_margin=180
自动加载hangcheck-timer 模块/u01/app/oracle/product/10.2.0/db_1
vi /etc/rc.local
modprobe hangcheck-timer--添加完在执行一下这句话
检查hangcheck-timer模块是否已经加载:
lsmod | grep hangcheck_timer
配置信任关系:
node1:192.168.3.50
su - oracle
ssh-keygen -t rsa
ssh-keygen -t dsa
cd .ssh
cat *.pub > authorized_keys
node2:192.168.3.52
su - oracle
ssh-keygen -t rsa
ssh-keygen -t dsa
cd .ssh
cat *.pub > authorized_keys
node1:192.168.3.50
scp authorized_keys oracle@192.168.3.52:/home/oracle/.ssh/keys_dbs
node2:192.168.3.52
cat keys_dbs >> authorized_keys
scp authorized_keys oracle@192.168.3.50:/home/oracle/.ssh/
测试信任关系:
node1:192.168.3.50
node2:192.168.3.52
ssh stu50
ssh stu52
ssh stu50-priv
ssh stu52-priv
准备公用卷:iscsi
rpm -ivh compat-db-4.2.52-5.1.i386.rpm
rpm -ivh libXp-1.0.0-8.1.el5.i386.rpm
rpm -ivh openmotif22-2.2.3-18.i386.rpm
node1 : 192.168.3.50 stu50 (iscsi server)
划分10G分区作为iscsi共享磁盘:
分区:/dev/sda5 5889 7105 9775521 83 Linux
iscsi 服务端:ClusterStorage目录下
rpm -ivh perl-Config-General-2.40-1.el5.noarch.rpm
rpm -ivh scsi-target-utils-0.0-5.20080917snap.el5.x86_64.rpm
Server目录下
rpm -ivh iscsi-initiator-utils-6.2.0.871-0.16.el5.i386.rpm
vi /etc/tgt/targets.conf
----------------------------------------
<target iqn.2011-01.com.oracle.blues:luns1>
backing-store /dev/sda9
initiator-address 10.1.1.0/24
</target>
----------------------------------------
vi /etc/udev/scripts/iscsidev.sh
----------------------------------------
#!/bin/bash
BUS=${1}
HOST=${BUS%%:*}
[ -e /sys/class/iscsi_host ] || exit 1
file="/sys/class/iscsi_host/host${HOST}/device/session*/iscsi_session*/targetname"
target_name=$(cat ${file})
if [ -z "${target_name}" ] ; then
exit 1
fi
echo "${target_name##*:}"
----------------------------------------
chmod +x /etc/udev/scripts/iscsidev.sh
chkconfig iscsi on
chkconfig iscsid on
chkconfig tgtd on
service iscsi start
service iscsid start
service tgtd start
tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL --开启ISCSI
tgtadm --lld iscsi --op show --mode target --查看LUN
iscsiadm -m discovery -t sendtargets -p 10.1.1.103
service iscsi start
fdisk -l
重新扫描服务器
iscsiadm -m session -u
iscsiadm -m discovery -t sendtargets -p 10.1.1.103
vi /etc/rc.local
tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL
service iscsi start
iscsi客户端配置 client : 10.1.1.103
rpm -ivh iscsi-initiator-utils-6.2.0.871-0.16.el5.i386.rpm
vi /etc/udev/rules.d/55-openiscsi.rules
-----------------------------------------------
KERNEL=="sd*",BUS=="scsi",PROGRAM="/etc/udev/scripts/iscsidev.sh %b",SYMLINK+="iscsi/%c"
-----------------------------------------------
vi /etc/udev/scripts/iscsidev.sh
----------------------------------------
#!/bin/bash
BUS=${1}
HOST=${BUS%%:*}
[ -e /sys/class/iscsi_host ] || exit 1
file="/sys/class/iscsi_host/host${HOST}/device/session*/iscsi_session*/targetname"
target_name=$(cat ${file})
if [ -z "${target_name}" ] ; then
exit 1
fi
echo "${target_name##*:}"