12c RAC安装过程
注: 以下配置,没有特殊说明,均在双节点执行
以rac01为例,两node都要配置
eth0和eth2 做bond0
eth3和eth4 做bond1
Mac地址记录如下:
eth0 : 00:0C:29:12:28:2C
eth2 : 00:0c:29:12:28:36
eth3 : 00:0c:29:12:28:40
eth4 : 00:0c:29:12:28:4a
[root@test-rac01 network-scripts]# cat ifcfg-bond0
# Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)
DEVICE=bond0
BOOTPROTO=none
BROADCAST=10.109.67.255
IPADDR=10.109.67.52
NETMASK=255.255.255.0
NETWORK=10.109.67.0
USERCTL=no
ONBOOT=yes
GATEWAY=10.109.67.1
TYPE=BOND
[root@test-rac01 network-scripts]# cat ifcfg-bond1
# Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)
DEVICE=bond1
BOOTPROTO=none
BROADCAST=193.168.1.255
IPADDR=193.168.1.102
NETMASK=255.255.255.0
NETWORK=193.168.1.0
USERCTL=no
ONBOOT=yes
TYPE=BOND
BONDING_OPTS="mode=1 miimon=50"
[root@test-rac01 network-scripts]# cat ifcfg-eth0
# Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)
DEVICE=eth0
BOOTPROTO=none
HWADDR=00:0C:29:12:28:2C
MASTER=bond0
ONBOOT=yes
SLAVE=yes
USERCTL=no
TYPE=Ethernet
PEERDNS=yes
IPV6INIT=no
[root@test-rac01 network-scripts]# cat ifcfg-eth2
# Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)
DEVICE=eth2
BOOTPROTO=none
ONBOOT=yes
HWADDR=00:0c:29:12:28:36
MASTER=bond0
SLAVE=yes
USERCTL=no
TYPE=Ethernet
PEERDNS=yes
IPV6INIT=no
[root@test-rac01 network-scripts]# cat ifcfg-eth3
# Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)
DEVICE=eth3
BOOTPROTO=none
ONBOOT=yes
HWADDR=00:0c:29:12:28:40
MASTER=bond1
SLAVE=yes
USERCTL=no
TYPE=Ethernet
PEERDNS=yes
IPV6INIT=no
[root@test-rac01 network-scripts]# cat ifcfg-eth4
# Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)
DEVICE=eth4
BOOTPROTO=none
ONBOOT=yes
HWADDR=00:0c:29:12:28:4a
MASTER=bond1
SLAVE=yes
USERCTL=no
TYPE=Ethernet
PEERDNS=yes
IPV6INIT=no
[root@rac01 ~]# vi /etc/modprobe.d/dist.conf
添加内容
alias bond0 bonding
alias bond1 bonding
alias scsi_hostadapter2 lpfc
[root@rac01 ~]# vi /etc/modprobe.d/openfwwf.conf
添加内容
options lpfc lpfc_nodev_tmo=30 lpfc_lun_queue_depth=16 lpfc_discovery_threads=32
options hangcheck-timer hangcheck_tick=1 hangcheck_margin=10 hangcheck_reboot=1
options e1000 FlowControl=1
[root@test-rac01 ~]# chkconfig sendmail off
[root@test-rac01 ~]# chkconfig --list | grep sendmail
sendmail 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[root@test-rac01 ~]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 test-rac01 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
# Public IP for Oracle 11g RAC
10.109.67.52 rac01.localdomain rac01
10.109.67.53 rac02.localdomain rac02
# Private IP for Oracle 11g RAC
193.168.1.102 rac01pri.localdomain rac01pri
193.168.1.103 rac02pri.localdomain rac02pri
# Virtual IP for Oracle 11g RAC
10.109.67.46 rac01vip.localdomain rac01vip
10.109.67.47 rac02vip.localdomain rac02vip
保证两节点均可以利用host相互通信
配置DNS
[root@rac01 ~]# yum install bind*
Running Transaction
Installing : 32:bind-9.8.2-0.17.rc1.el6_4.6.x86_64 1/3
Installing : 32:bind-chroot-9.8.2-0.17.rc1.el6_4.6.x86_64 2/3
Installing : bind-dyndb-ldap-2.3-5.el6.x86_64 3/3
Verifying : 32:bind-9.8.2-0.17.rc1.el6_4.6.x86_64 1/3
Verifying : 32:bind-chroot-9.8.2-0.17.rc1.el6_4.6.x86_64 2/3
Verifying : bind-dyndb-ldap-2.3-5.el6.x86_64 3/3
Installed:
bind.x86_64 32:9.8.2-0.17.rc1.el6_4.6
bind-chroot.x86_64 32:9.8.2-0.17.rc1.el6_4.6
bind-dyndb-ldap.x86_64 0:2.3-5.el6
Complete!
[root@rac01 u01]# cat /etc/named.rfc1912.zones
zone "localdomain.com" IN {
type master;
file "named.localdomain.com";
allow-update { none; };
};
zone "1.168.193.in-addr.arpa" IN {
type master;
file "named.193.168.1.db";
allow-update { none; };
};
zone "67.109.10.in-addr.arpa" IN {
type master;
file "named.10.109.67.db";
allow-update { none; };
};
[root@rac01 u01]# cat /var/named/chroot/var/named/named.localdomain.com
$TTL 1D
@ IN SOA localdomain.com. root.localdomain.com. (
0 ; serial
28800 ; refresh
14400 ; retry
3600000 ; expire
86400 ) ; minimum
NS @
A 127.0.0.1
AAAA ::1
rac01vip IN A 10.109.67.46
rac02vip IN A 10.109.67.47
rac01 IN A 10.109.67.52
rac02 IN A 10.109.67.53
rac01pri IN A 193.168.1.102
rac02pri IN A 193.168.1.103
scan-oracle IN A 10.109.67.48
注:此处的scanIP与vip类似,为虚拟IP,无需真实网卡
[root@rac01 u01]# cat /var/named/chroot/var/named/named.10.109.67.db
$TTL 1D
@ IN SOA localdomain.com. root.localdomain.com. (
0 ; serial
28800 ; refresh
14400 ; retry
3600000 ; expire
86400 ) ; minimum
NS @
A 127.0.0.1
AAAA ::1
52 IN PTR rac01.localdomain.com.
53 IN PTR rac02.localdomain.com.
46 IN PTR rac01vip.localdomain.com.
47 IN PTR rac02vip.localdomain.com.
48 IN PTR scan-oracle.localdomain.com.
[root@rac01 u01]# cat /var/named/chroot/var/named/named.193.168.1.db
$TTL 1D
@ IN SOA localdomain.com. root.localdomain.com. (
0 ; serial
28800 ; refresh
14400 ; retry
3600000 ; expire
86400 ) ; minimum
NS @
A 127.0.0.1
AAAA ::1
102 IN PTR rac01pri.localdomain.com.
103 IN PTR rac02pri.localdomain.com.
[root@rac01 ~]# mount /dev/cdrom /mnt/
mount: block device /dev/sr0 is write-protected, mounting read-only
[root@rac01 ~]# cd /etc/yum.repos.d/
[root@rac01 yum.repos.d]# cp rhel-source.repo rhel-source.repo.bak
[root@rac01 yum.repos.d]# vi rhel-source.repo
修改内容如下
[rhel6.5]
name=Red Hat 6.5
baseurl=file:///mnt/Server
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[root@rac01 yum.repos.d]# yum update
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
rhel6.5 | 3.9 kB 00:00 ...
rhel6.5/primary_db | 3.1 MB 00:00 ...
Setting up Update Process
No Packages marked for Update
yum install binutils -y
yum install compat-libcap1 -y
yum install compat-libstdc++-33 -y
yum install compat-libstdc++-33.i686 -y
yum install gcc -y
yum install gcc-c++ -y
yum install glibc -y
yum install glibc.i686 -y
yum install glibc-devel -y
yum install glibc-devel.i686 -y
yum install ksh -y
yum install libgcc -y
yum install libgcc.i686 -y
yum install libstdc++ -y
yum install libstdc++.i686 -y
yum install libstdc++-devel -y
yum install libstdc++-devel.i686 -y
yum install libaio -y
yum install libaio.i686 -y
yum install libaio-devel -y
yum install libaio-devel.i686 -y
yum install libXext -y
yum install libXext.i686 -y
yum install libXtst -y
yum install libXtst.i686 -y
yum install libX11 -y
yum install libX11.i686 -y
yum install libXau -y
yum install libXau.i686 -y
yum install libxcb -y
yum install libxcb.i686 -y
yum install libXi -y
yum install libXi.i686 -y
yum install make -y
yum install sysstat -y
yum install unixODBC -y
yum install unixODBC-devel -y
binutils-2.20.51.0.2-5.11.el6 (x86_64)
compat-libcap1-1.10-1 (x86_64)
compat-libstdc++-33-3.2.3-69.el6 (x86_64)
compat-libstdc++-33-3.2.3-69.el6 (i686)
gcc-4.4.4-13.el6 (x86_64)
gcc-c++-4.4.4-13.el6 (x86_64)
glibc-2.12-1.7.el6 (i686)
glibc-2.12-1.7.el6 (x86_64)
glibc-devel-2.12-1.7.el6 (x86_64)
glibc-devel-2.12-1.7.el6 (i686)
ksh
libgcc-4.4.4-13.el6 (i686)
libgcc-4.4.4-13.el6 (x86_64)
libstdc++-4.4.4-13.el6 (x86_64)
libstdc++-4.4.4-13.el6 (i686)
libstdc++-devel-4.4.4-13.el6 (x86_64)
libstdc++-devel-4.4.4-13.el6 (i686)
libaio-0.3.107-10.el6 (x86_64)
libaio-0.3.107-10.el6 (i686)
libaio-devel-0.3.107-10.el6 (x86_64)
libaio-devel-0.3.107-10.el6 (i686)
libXext-1.1 (x86_64)
libXext-1.1 (i686)
libXtst-1.0.99.2 (x86_64)
libXtst-1.0.99.2 (i686)
libX11-1.3 (x86_64)
libX11-1.3 (i686)
libXau-1.0.5 (x86_64)
libXau-1.0.5 (i686)
libxcb-1.5 (x86_64)
libxcb-1.5 (i686)
libXi-1.3 (x86_64)
libXi-1.3 (i686)
make-3.81-19.el6
sysstat-9.0.4-11.el6 (x86_64)
[root@rac01 ~]# sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
kernel.shmmax = 4398046511104
kernel.shmall = 1073741824
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.wmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576
[root@rac01 ~]# vi /etc/security/limits.conf
grid soft nproc 2047
grid hard nproc 16384
grid soft nofile 131072
grid hard nofile 65536
grid soft stack 10240
grid hard stack 32768
oracle soft nproc 131072
oracle hard nproc 131072
oracle soft nofile 131072
oracle hard nofile 65536
oracle hard nofile 131072
oracle soft nofile 131072
[root@rac02 ~]# vi /etc/pam.d/login
[root@rac01 ~]# cat /etc/security/limits.conf
ession required pam_limits.so
session required /lib64/security/pam_limits.so
[root@rac01 ~]# cat /etc/security/limits.d/90-nproc.conf
# Default limit for number of user's processes to prevent
# accidental fork bombs.
# See rhbz #432903 for reasoning.
* soft nproc 1024
root soft nproc unlimited
[root@rac02 ~]# cat /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
groupadd oinstall
groupadd dba
groupadd oper
groupadd backupdba
groupadd dgdba
groupadd kmdba
groupadd asmdba
groupadd asmoper
groupadd asmadmin
useradd -g oinstall -G dba,asmadmin,asmdba,asmoper grid
useradd -g oinstall -G dba,oper,backupdba,dgdba,kmdba,asmdba,asmadmin oracle
passwd grid
passwd oracle
mkdir -p /u01/app/12.1.0/grid
mkdir -p /u01/app/grid
mkdir -p /u01/app/oracle/product/12.1.0/db_1
chown -R grid:oinstall /u01
chmod -R 775 /u01/
chown -R oracle:oinstall /u01/app/oracle
[root@rac02 ~]# su - grid
[grid@rac02 ~]$ vi .bash_profile
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/12.1.0/grid
export ORACLE_SID=+ASM
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export DISPLAY=:0.0
umask=022
[root@rac02 ~]# su - oracle
[oracle@rac02 ~]$ vi .bash_profile
PATH=$PATH:$HOME/bin
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/12.1.0/db_1
export ORACLE_SID=orcl2
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export DISPLAY=:0.0
umask=022
export PATH
依次安装
oracleasm-support-2.1.8-1.el6.x86_64.rpm
kmod-oracleasm-2.0.6.rh2-2.el6.x86_64.rpm
oracleasmlib-2.0.4-1.el6.x86_64.rpm
对磁盘进行分区(一个节点上执行)
[root@rac02 ~]# fdisk -l
Disk /dev/sda: 53.7 GB, 53687091200 bytes
64 heads, 32 sectors/track, 51200 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000588f1
Device Boot Start End Blocks Id System
/dev/sda1 * 2 151 153600 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 152 10391 10485760 83 Linux
Partition 2 does not end on cylinder boundary.
/dev/sda3 10392 12439 2097152 82 Linux swap / Solaris
Partition 3 does not end on cylinder boundary.
/dev/sda4 12440 51200 39691264 5 Extended
Partition 4 does not end on cylinder boundary.
/dev/sda5 12441 51200 39690240 83 Linux
Disk /dev/sdb: 16.1 GB, 16106127360 bytes
64 heads, 32 sectors/track, 15360 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/sdc: 16.1 GB, 16106127360 bytes
64 heads, 32 sectors/track, 15360 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/sdd: 42.9 GB, 42949672960 bytes
64 heads, 32 sectors/track, 40960 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
分区后的磁盘信息
Device Boot Start End Blocks Id System
/dev/sdb1 1 15360 15728624 83 Linux
Disk /dev/sdc: 16.1 GB, 16106127360 bytes
64 heads, 32 sectors/track, 15360 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x9c8ae290
Device Boot Start End Blocks Id System
/dev/sdc1 1 15360 15728624 83 Linux
Disk /dev/sdd: 42.9 GB, 42949672960 bytes
64 heads, 32 sectors/track, 40960 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x4c33655b
Device Boot Start End Blocks Id System
/dev/sdd1 1 40960 41943024 83 Linux
[root@rac01 u01]# /etc/init.d/oracleasm scandisks
Scanning the system for Oracle ASMLib disks: [ OK ]
[root@rac01 u01]# /etc/init.d/oracleasm listdisks
CRS
DATA
FLA
[grid@rac01 ~]$ chmod 700 /home/grid/.ssh
[grid@rac01 ~]$ vi /home/grid/.ssh/config
Host *
ForwardX11 no
[grid@rac01 ~]$ /usr/bin/ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/grid/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/grid/.ssh/id_rsa.
Your public key has been saved in /home/grid/.ssh/id_rsa.pub.
The key fingerprint is:
c4:33:bd:26:3b:0a:dc:01:d4:ce:24:0d:62:05:58:05 grid@rac01
The key's randomart image is:
+--[ RSA 2048]----+
| oE==+ |
|.. o. +. . |
| .= = . |
| .o. o . |
| . S o |
| . . . + |
| o . o |
| . . . |
| . |
+-----------------+
[grid@rac01 ~]$ /usr/bin/ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/home/grid/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/grid/.ssh/id_dsa.
Your public key has been saved in /home/grid/.ssh/id_dsa.pub.
The key fingerprint is:
cf:be:03:09:57:56:00:ff:14:7e:f1:e3:69:a6:00:39 grid@rac01
The key's randomart image is:
+--[ DSA 1024]----+
| ...oo . |
| .+. . o |
| E. o ...|
| . . oo .. o|
| oS. .. = |
| oo . + |
| .o . |
| .. |
| oo |
+-----------------+
Node2
[grid@rac02 ~]$ mkdir .ssh
[grid@rac02 ~]$ chmod 700 .ssh
[grid@rac02 ~]$ cd .ssh
[grid@rac02 .ssh]$ scp rac01:/home/oracle/.ssh/authorized_keys .
grid@rac01's password:
authorized_keys 100% 992 1.0KB/s 00:00
[grid@rac02 .ssh]$ /usr/bin/ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/home/grid/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/grid/.ssh/id_dsa.
Your public key has been saved in /home/grid/.ssh/id_dsa.pub.
The key fingerprint is:
7b:bc:5e:f3:41:d0:7e:73:5f:ed:16:b2:94:ec:d8:89 grid@rac02
The key's randomart image is:
+--[ DSA 1024]----+
| |
| . |
| . . |
| .o. .|
| S =oo=|
| o *.+o*|
| . oEo=. +|
| . o o o |
| .o . |
+-----------------+
[grid@rac02 .ssh]$ /usr/bin/ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/grid/.ssh/id_rsa): Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/grid/.ssh/id_rsa.
Your public key has been saved in /home/grid/.ssh/id_rsa.pub.
The key fingerprint is:
c4:f7:a5:d6:e7:6b:f1:46:04:c2:19:77:ca:40:4f:e8 grid@rac02
The key's randomart image is:
+--[ RSA 2048]----+
| o++o .|
| . =*.o |
| o .. .=. |
| . . .E+ .|
| S + ...|
| . +.|
| .+|
| .+|
| .o |
+-----------------+
[grid@rac02 .ssh]$ cat id_rsa.pub >> authorized_keys
[grid@rac02 .ssh]$ cat id_dsa.pub >> authorized_keys
[grid@rac02 .ssh]$ scp authorized_keys rac01:/home/grid/.ssh/authorized_keys
grid@rac01's password:
authorized_keys 100% 1984 1.9KB/s 00:00
[grid@rac02 ~]$ ssh rac01 date
Tue Sep 30 11:00:49 CST 2014
[grid@rac02 ~]$ ssh rac02 date
Tue Sep 30 11:00:51 CST 2014
[root@rac01 grid]# unzip linuxamd64_12102_grid_1of2.zip
[root@rac01 grid]# unzip linuxamd64_12102_grid_2of2.zip
[root@rac01 u01]# cd grid/
RAC01
[root@rac01 rpm]# rpm -ivh cvuqdisk-1.0.9-1.rpm
Preparing... ########################################### [100%]
Using default group oinstall to install package
1:cvuqdisk ########################################### [100%]
RAC02
[root@rac02 ~]# scp rac01:/u01/grid/rpm/cvuqdisk-1.0.9-1.rpm /u01
The authenticity of host 'rac01 (10.109.67.52)' can't be established.
RSA key fingerprint is cf:bf:03:06:2d:c8:83:ae:fa:f7:93:7e:87:a5:3b:7a.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'rac01' (RSA) to the list of known hosts.
root@rac01's password:
cvuqdisk-1.0.9-1.rpm 100% 8976 8.8KB/s 00:00
[root@rac02 ~]# cd /u01/
[root@rac02 u01]# rpm -ivh cvuqdisk-1.0.9-1.rpm
Preparing... ########################################### [100%]
Using default group oinstall to install package
1:cvuqdisk ########################################### [100%]
./runInstaller 开始配置安装
检查安装
[grid@rac01 ~]$ srvctl status nodeapps
VIP rac01vip.localdomain.com is enabled
VIP rac01vip.localdomain.com is running on node: rac01
VIP rac02vip.localdomain.com is enabled
VIP rac02vip.localdomain.com is running on node: rac02
Network is enabled
Network is running on node: rac01
Network is running on node: rac02
ONS is enabled
ONS daemon is running on node: rac01
ONS daemon is running on node: rac02
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。