在Solaris上安装过11.2的RAC,Linux上还是第一次。描述一下安装配置过程。
这一篇描述环境准备工作。
在两个节点上分别检查操作系统软硬件是否满足安装要求:
[root@rac3 ~]# uname -a
Linux rac3 2.6.18-194.el5 #1 SMP Tue Mar 16 21:52:39 EDT 2010 x86_64 x86_64 x86_64
GNU/Linux
[root@rac3 ~]# more /etc/issue
Red Hat Enterprise Linux Server release 5.5 (Tikanga)
Kernel \r on an \m
[root@rac3 ~]# grep MemTotal /proc/meminfo
MemTotal: 98835800 kB
[root@rac3 ~]# grep SwapTotal /proc/meminfo
SwapTotal: 10289144 kB
[root@rac3 ~]# df -h /tmp
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
9.8G 3.3G 6.0G 36% /
[root@rac3 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
9.8G 3.4G 6.0G 36% /
/dev/sda1 99M 13M 82M 14% /boot
tmpfs 48G 0 48G 0% /dev/shm
/dev/sdc 40G 466M 37G 2% /data
检查系统包的安装情况:
[root@rac3 ~]# rpm -q binutils compat-libstdc++-33
compat-db control-center gcc gcc-c++ glibc glibc-common libstdc++ libstdc++-devel
make sysstat setarch libaio libaio-devel
binutils-2.17.50.0.6-14.el5
compat-libstdc++-33-3.2.3-61
compat-libstdc++-33-3.2.3-61
compat-db-4.2.52-5.1
control-center-2.16.0-16.el5
control-center-2.16.0-16.el5
gcc-4.1.2-48.el5
gcc-c++-4.1.2-48.el5
glibc-2.5-49
glibc-2.5-49
glibc-common-2.5-49
libstdc++-4.1.2-48.el5
libstdc++-4.1.2-48.el5
libstdc++-devel-4.1.2-48.el5
make-3.81-3.el5
sysstat-7.0.2-3.el5_5.1
setarch-2.0-1.1
libaio-0.3.106-5
libaio-0.3.106-5
libaio-devel-0.3.106-5
对于Linux5以上版本,修改/etc/selinux/config,确保SELINUX设置为DISABLED:
[root@rac3 ~]# vi /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 - SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons
are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted
关闭IPTABLES:
[root@rac3 ~]# service iptables stop
Flushing firewall rules: [ OK ]
Setting chains to policy ACCEPT: filter [
OK ]
Unloading iptables modules: [ OK ]
[root@rac3 ~]# service ip6tables stop
Flushing firewall rules: [ OK ]
Setting chains to policy ACCEPT: filter [
OK ]
Unloading ip6tables modules: [ OK ]
[root@rac3 ~]# /sbin/chkconfig iptables off
[root@rac3 ~]# /sbin/chkconfig ip6tables off
调整系统参数:
[root@rac3 ~]# sysctl -w fs.aio-max-nr=4194304
fs.aio-max-nr = 4194304
[root@rac3 ~]# echo "fs.aio-max-nr=4194304" >> /etc/sysctl.conf
添加Huge Pages设置,设置的值乘以2048K应该大约SGA_MAX_SIZE:
[root@rac3 ~]# sysctl -w vm.nr_hugepages=12000
vm.nr_hugepages = 12000
[root@rac3 ~]# echo "vm.nr_hugepages=12000" >> /etc/sysctl.conf
创建grid和oracle用户:
[root@rac3 ~]# groupadd -g 1000 oinstall
[root@rac3 ~]# groupadd -g 1200 dba
[root@rac3 ~]# useradd -u 1100 -g oinstall -G dba oracle
[root@rac3 ~]# useradd -u 1300 -g oinstall -G dba grid
[root@rac3 ~]# passwd oracle
[root@rac3 ~]# passwd grid
建立对应的目录并授权:
[root@rac3 ~]# mkdir -p /data/grid
[root@rac3 ~]# mkdir /data/oracle
[root@rac3 ~]# mkdir -p /data/11.2.0/grid
[root@rac3 ~]# chown grid /data
[root@rac3 ~]# chown -R grid:oinstall /data/grid
[root@rac3 ~]# chown -R oracle:oinstall /data/oracle
[root@rac3 ~]# chown -R grid:oinstall /data/11.2.0
[root@rac3 ~]# chmod -R 755 /data
修改两个节点上的/etc/hosts文件,添加下面的内容:
10.0.10.142 rac3
10.0.10.143 rac2
10.0.10.145 rac3-vip
10.0.10.146 rac2-vip
192.168.1.10 rac3-priv
192.168.1.30 rac2-priv
10.0.10.140 rac-cluster
两个节点上安装asmlib包:
[root@rac3 ~]# rpm -ivh oracleasm-support-2.1.3-1.el5.x86_64.rpm
warning: oracleasm-support-2.1.3-1.el5.x86_64.rpm: Header V3 DSA signature: NOKEY,
key ID 1e5e0159
Preparing... ###########################################
[100%]
1:oracleasm-support ###########################################
[100%]
[root@rac3 ~]# rpm -ivh oracleasm-2.6.18-194.el5-2.0.5-1.el5.x86_64.rpm
warning: oracleasm-2.6.18-194.el5-2.0.5-1.el5.x86_64.rpm: Header V3 DSA signature:
NOKEY, key ID 1e5e0159
Preparing... ###########################################
[100%]
1:oracleasm-2.6.18-194.el###########################################
[100%]
[root@rac3 ~]# rpm -ivh oracleasmlib-2.0.4-1.el5.x86_64.rpm
warning: oracleasmlib-2.0.4-1.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key
ID 1e5e0159
Preparing... ###########################################
[100%]
1:oracleasmlib ###########################################
[100%]
两个节点上配置asmlib:
[root@rac3 dev]# oracleasm configure
-i -e -u grid -g dba
Configuring the Oracle ASM library driver.
This will configure the on-boot properties
of the Oracle ASM library
driver. The following questions will determine
whether the driver is
loaded on boot and what permissions it will have. The current values
will be shown in brackets ('[]'). Hitting
answer will keep that current value. Ctrl-C
will abort.
Default user to own the driver interface
[grid]:
Default group to own the driver interface [dba]:
Start Oracle ASM library driver on boot (y/n) [y]:
Scan for Oracle ASM disks on boot (y/n) [y]:
Writing Oracle ASM library driver configuration: done
[root@rac3 dev]# oracleasm init
Creating /dev/oracleasm mount point: /dev/oracleasm
Loading module "oracleasm": oracleasm
Mounting ASMlib driver filesystem: /dev/oracleasm
在一个节点上利用asmlib创建裸设备:
Disk /dev/sdc doesn't contain a valid
partition table
[root@rac3 dev]# dd if=/dev/zero f=/dev/sdb bs=8192 count=10000
10000+0 records in
10000+0 records out
81920000 bytes (82 MB) copied, 0.580924 seconds, 141 MB/s
[root@rac3 dev]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
The number of cylinders for this disk is set to 78325.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): n
Command action
e
extended
p
primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-78325, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-78325, default 78325):
Using default value 78325
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition
table.
Syncing disks.
[root@rac3 dev]# ls -l /dev/sdb*
brw-r----- 1 root disk 8, 16 Mar 23 01:36 /dev/sdb
brw-r----- 1 root disk 8, 17 Mar 23 01:36 /dev/sdb1
[root@rac3 dev]# oracleasm createdisk VOL1 /dev/sdb1
Writing disk header: done
Instantiating disk: done
在另外的节点扫描磁盘:
[root@rac4 ~]# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
Instantiating disk "VOL1"
确认磁盘创建成功后,安装的准备工作完成。