一、实施前期准备工作
二、安装前期准备工作
- 2.1 各节点系统时间校对
- 2.2 各节点关闭防火墙和SELinux
- 2.3 各节点检查系统依赖包安装情况
- 2.4 各节点配置/etc/hosts
- 2.5 各节点创建需要的用户和组
- 2.6 各节点创建安装目录
- 2.7 各节点系统配置文件修改
- 2.8 各节点设置用户的环境变量
Linux平台 Oracle 11gR2 RAC安装指导:
Part1:Linux平台 Oracle 11gR2 RAC安装Part1:准备工作
Part2:Linux平台 Oracle 11gR2 RAC安装Part2:GI安装
Part3:Linux平台 Oracle 11gR2 RAC安装Part3:DB安装
一、实施前期准备工作
1.1 服务器安装操作系统
配置完全相同的两台服务器,安装相同版本的Linux操作系统。留存系统光盘或者镜像文件。
我这里是RHEL6.2,系统目录大小均一致。对应RHEL6.2的系统镜像文件放在服务器上,供后面配置本地yum使用。
1.2 Oracle安装介质
Oracle 11.2.0.4版本的前3个zip包。这个用MOS账号自己去support.oracle.com下载,然后只需要上传到节点1即可。
1.3 共享存储规划
从存储中划分出两台主机可以同时看到的共享LUN,3个10G的盘用作OCR和Voting Disk,剩余做数据盘。根据实际需要选择multipath或者udev绑定设备。这里选用multipath绑定。
multipath -ll
multipath -F
multipath -v2
multipath -ll
1.4 网络规范分配
公有网络 以及 私有网络。
公有网络:两个物理网卡eth1和eth3先做的bonding,然后公网使用绑定后的设备bond0
bond0{public IP,VIP} ScanIP(1~3个);
私有网络:eth0,eth2{2组private IP}
二、安装前期准备工作
2.1 各节点系统时间校对
service ntpd stop
date
#如果时间有问题,就按下面的语法进行设定
date 072310472015 //设定日期为2015-07-23 10:47:00
hwclock -w
hwclock -r
2.2 各节点关闭防火墙和SELinux
service iptables stop
chkconfig iptables off && chkconfig ip6tables off && chkconfig libvirtd off //libvirtd这个服务会调用启动防火墙,所以一起关闭
setenforce 0
#验证防火墙状态为关闭
service iptables status
#验证都是off
chkconfig --list |grep iptables && chkconfig --list |grep ip6tables && chkconfig --list |grep libvirtd
#验证SELinux配置和当前状态
vi /etc/selinux/config
getenforce
2.3 各节点检查系统依赖包安装情况
检查依赖包,没安装的配置本地yum安装即可:
rpm -q binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel glibc glibc-common glibc-devel gcc- gcc-c++ libaio-devel libaio libgcc libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel pdksh ksh compat-libcap1
2.4 各节点配置/etc/hosts
根据主机名和IP规划来配置/etc/hosts
#public ip
172.16.7.112 jyracdb1
172.16.7.114 jyracdb2
#private ip
192.168.10.2 jyracdb1-priv
192.168.10.1 jyracdb2-priv
192.168.20.2 jyracdb1-priv-2
192.168.20.1 jyracdb2-priv-2
#virtual ip
172.16.7.113 jyracdb1-vip
172.16.7.115 jyracdb2-vip
#scan ip
172.16.7.120 jyracdb-scan
2.5 各节点创建需要的用户和组
#新建组:
groupadd -g 700 asmadmin
groupadd -g 701 asmdba
groupadd -g 702 asmoper
groupadd -g 800 oinstall
groupadd -g 801 dba
groupadd -g 802 oper
#新建用户:
useradd -g oinstall -G asmadmin,asmdba,asmoper -u 700 grid
useradd -g oinstall -G dba,asmdba,oper -u 800 oracle
#设置用户密码:
passwd oracle
passwd grid
2.6 各节点创建安装目录
我这里规划的是Oracle DB安装目录/opt/app/oracle,GI安装目录/opt/app/11.2.0/grid
只需要建立/opt/app目录并赋权即可。
mkdir -p /opt/app/ && chown -R oracle:oinstall /opt/app/ && chmod 775 /opt/app && ls -lh /opt
2.7 各节点系统配置文件修改
vi /etc/sysctl.conf
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 51539607552 //一般设置为系统内存75%单位是字节
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
sysctl -p 生效
vi /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
grid soft nproc 2047
grid hard nproc 16384
grid soft nofile 1024
grid hard nofile 65536
grid soft stack 1024
vi /etc/pam.d/login
session required /lib64/security/pam_limits.so
2.8 各节点设置用户的环境变量
第1个节点grid用户:
export GRID_HOME=/opt/app/11.2.0/grid
export ORACLE_HOME=/opt/app/11.2.0/grid
export PATH=$GRID_HOME/bin:$GRID_HOME/OPatch:/sbin:/bin:/usr/sbin:/usr/bin
export ORACLE_SID=+ASM1
export LD_LIBRARY_PATH=$GRID_HOME/lib:$GRID_HOME/lib32
export ORACLE_BASE=/opt/app/grid
export ORA_NLS10=$ORACLE_HOME/nls/data
export NLS_LANG=American_america.ZHS16GBK
第2个节点grid用户:
export GRID_HOME=/opt/app/11.2.0/grid
export ORACLE_HOME=/opt/app/11.2.0/grid
export PATH=$GRID_HOME/bin:$GRID_HOME/OPatch:/sbin:/bin:/usr/sbin:/usr/bin
export ORACLE_SID=+ASM2
export LD_LIBRARY_PATH=$GRID_HOME/lib:$GRID_HOME/lib32
export ORACLE_BASE=/opt/app/grid
export ORA_NLS10=$ORACLE_HOME/nls/data
export NLS_LANG=American_america.ZHS16GBK
第1个节点oracle用户:
export ORACLE_HOME=/opt/app/oracle/product/11.2.0/dbhome_1
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:/sbin:/bin:/usr/sbin:/usr/bin
export ORACLE_SID=jyzhao1
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/lib32
export ORACLE_BASE=/opt/app/oracle
export NLS_LANG=American_america.ZHS16GBK
第2个节点oracle用户:
export ORACLE_HOME=/opt/app/oracle/product/11.2.0/dbhome_1
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:/sbin:/bin:/usr/sbin:/usr/bin
export ORACLE_SID=jyzhao2
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/lib32
export ORACLE_BASE=/opt/app/oracle
export NLS_LANG=American_america.ZHS16GBK
节点1网卡信息查询
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 | [root@fjracdb1 bond0 49 :0B:C1: 10 :1B inet addr : 172.16.7.112 Bcast: 172.16.7.127 Mask: 255.255.255.224 inet6 addr : fe80::da49:bff:fec1:101b/ 64 Scope:Link UP BROADCAST RUNNING MASTER MULTICAST MTU: 1500 Metric: 1 RX packets: 1127373 errors: 0 dropped: 0 overruns: 0 frame: 0 TX packets: 4227955 errors: 0 dropped: 0 overruns: 0 carrier: 0 collisions: 0 txqueuelen: 0 RX bytes: 491585923 ( 468.8 MiB) TX bytes: 5686391418 ( 5.2 GiB) bond0: 1 Link encap:Ethernet HWaddr D8: 49 :0B:C1: 10 :1B inet addr : 172.16.7.113 Bcast: 172.16.7.127 Mask: 255.255.255.224 UP BROADCAST RUNNING MASTER MULTICAST MTU: 1500 Metric: 1 eth0 49 :0B:C1: 10 :1A inet addr : 192.168.10.2 Bcast: 192.168.10.255 Mask: 255.255.255.0 inet6 addr : fe80::da49:bff:fec1:101a/ 64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU: 1500 Metric: 1 RX packets: 1148874 errors: 0 dropped: 0 overruns: 0 frame: 0 TX packets: 953531 errors: 0 dropped: 0 overruns: 0 carrier: 0 collisions: 0 txqueuelen: 1000 RX bytes: 1007828876 ( 961.1 MiB) TX bytes: 735140288 ( 701.0 MiB) Memory: 94980000 -94a00000 eth0: 1 Link encap:Ethernet HWaddr D8: 49 :0B:C1: 10 :1A inet addr : 169.254.17.116 Bcast: 169.254.127.255 Mask: 255.255.128.0 UP BROADCAST RUNNING MULTICAST MTU: 1500 Metric: 1 Memory: 94980000 -94a00000 eth1 49 :0B:C1: 10 :1B UP BROADCAST RUNNING SLAVE MULTICAST MTU: 1500 Metric: 1 RX packets: 1028704 errors: 0 dropped: 0 overruns: 0 frame: 0 TX packets: 4227955 errors: 0 dropped: 0 overruns: 0 carrier: 0 collisions: 0 txqueuelen: 1000 RX bytes: 361319649 ( 344.5 MiB) TX bytes: 5686391418 ( 5.2 GiB) Memory: 94900000 - 94980000 eth2 49 :0B:C1: 10 :1C inet addr : 192.168.20.2 Bcast: 192.168.20.255 Mask: 255.255.255.0 inet6 addr : fe80::da49:bff:fec1:101c/ 64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU: 1500 Metric: 1 RX packets: 940738 errors: 0 dropped: 0 overruns: 0 frame: 0 TX packets: 781219 errors: 0 dropped: 0 overruns: 0 carrier: 0 collisions: 0 txqueuelen: 1000 RX bytes: 814340632 ( 776.6 MiB) TX bytes: 575044221 ( 548.4 MiB) Memory: 94880000 - 94900000 eth2: 1 Link encap:Ethernet HWaddr D8: 49 :0B:C1: 10 :1C inet addr : 169.254.198.122 Bcast: 169.254.255.255 Mask: 255.255.128.0 UP BROADCAST RUNNING MULTICAST MTU: 1500 Metric: 1 Memory: 94880000 - 94900000 eth3 49 :0B:C1: 10 :1B UP BROADCAST RUNNING SLAVE MULTICAST MTU: 1500 Metric: 1 RX packets: 98669 errors: 0 dropped: 0 overruns: 0 frame: 0 TX packets: 0 errors: 0 dropped: 0 overruns: 0 carrier: 0 collisions: 0 txqueuelen: 1000 RX bytes: 130266274 ( 124.2 MiB) TX bytes: 0 ( 0.0 b) Memory: 94800000 - 94880000 lo inet addr : 127.0.0.1 Mask: 255.0.0.0 inet6 addr : :: 1 / 128 Scope:Host UP LOOPBACK RUNNING MTU: 16436 Metric: 1 RX packets: 1118983 errors: 0 dropped: 0 overruns: 0 frame: 0 TX packets: 1118983 errors: 0 dropped: 0 overruns: 0 carrier: 0 collisions: 0 txqueuelen: 0 RX bytes: 1061842206 ( 1012.6 MiB) TX bytes: 1061842206 ( 1012.6 MiB) |
1.在非标准安装的系统上,碰到系统未安装compat-libcap1导致执行root脚本时报错,
1 | rpm |
这点需要注意下, 可以在开始检查依赖的时候也检查下这个包。