11g oracle rac udev 安装配置
11g oracle udev rac安装配置
1、环境准备
1)解析主机名称
######public#######
192.168.11.10 rac1
192.168.11.30 rac2
#######private#####
192.168.56.10 rac1-prv
192.168.56.30 rac2-prv
######vip#########
192.168.11.12 rac1-vip
192.168.11.32 rac2-vip
2)关闭防火墙、seliunx
service iptables stop
chkconfig iptables off
service iptables status
chkconfig iptables --list
sed -i '/SELINUX/s/enforcing/disabled/' /etc/selinux/config
sestatus
3)配置主机名称
vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=rac1
4) yum源的配置
4.1)将镜像挂载
#mount /dev/cdrom /mnt
4.2)修改yum源的配置文件
# vi /etc/yum.repos.d/CentOS-Base.repo
[base]
name=CentOS6.6-Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
baseurl=file:///mnt
gpgcheck=1
enable=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
4.3、#yum clean all
4.4、安装oracle需要的rpm包
yum install
-y binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc-common glibc-devel libaio libaio-devel libgcc libstdc++ libstdc++-devel make
numactl sysstat libXp unixODBC unixODBC-devel
5)dns解析scanip
节点一:
5.1)配置DNS服务
挂载上镜像文件,yum配置好,安装DNS服务
#yum install bind -y
#yum install bind-chroot -y
5.2)配置dns解析scanip,达到负载均衡的效果。
配置如下:
1、配置dns服务文件
# vi /var/named/chroot/etc/named.conf
options {
directory "/var/named";
};
zone "oracle.com" IN {
type master;
file "oracle.com.zone";
};
zone "11.168.192.in-addr.arpa" IN {
type master;
file "0.zone";
};
2、配置dns解析文件
#vi /var/named/chroot/var/named/oracle.com.zone
$TTL 86400
@ IN SOA dns.oracle.com. root.oracle.com (
130830;
3H;
15M;
1W;
1D)
IN NS dns.oracle.com.
dns IN A 192.168.11.10 #自己服务器主机的ip地址
scan IN A 192.168.11.31
scan IN A 192.168.11.32
scanIN A 192.168.11.33
3、配置dns反解析文件
#vi /var/named/chroot/var/named/0.zone
$TTL 86400
@ IN SOA dns.oracle.com. root.oracle.com (
130830;
3H;
15M;
1W;
1D)
IN NS dns.oracle.com.
31 IN PTR scan.oracle.com.
32 IN PTR scan.oracle.com.
33 IN PTR scan.oracle.com.
4、重启dns服务
service named restart
chkconfig named on
5、节点二:
客户端DNS配置
编辑/etc/resolv.conf文件
vi /etc/resolv.conf
nameserver 192.168.11.10 -- 我们刚才添加的DNS Server(也就是节点一的rac1的ip地址)
6、将dns配置在网卡上
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=08:00:27:7e:60:82
TYPE=Ethernet
UUID=fd25d479-e2f6-43a6-a3b3-3363533e037d
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
IPADDR=192.168.11.10
NETMASK=255.255.255.0
GATEWAY=192.168.11.1
DNS1=192.168.11.10
IPV6INIT=no
USERCTL=no
重启网卡
service network restart
6、验证dns
nslookup scan.oracle.com
6)修改内核参数
vi /etc/sysctl.conf
fs.file-max = 6815744
fs.aio-max-nr=1048576
kernel.shmall = 2097152
kernel.shmmax = 2147483648
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 = 1048576
#/sbin/sysctl -p立即生效
注意:在其他节点重复内核参数的操作
7)限制参数
vi /etc/security/limits.conf
grid soft nproc 2047
grid hard nproc 16384
grid soft nofile 1024
grid hard nofile 65536
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
8) 修改全局变量
vi /etc/profile
if [ $USER = "oracle" ] || [ $USER = "grid" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
umask 022
fi
source /etc/profile --生效
9)创建用户
groupadd -g 1000 oinstall
groupadd -g 1002 dba
groupadd -g 1001 oper
groupadd -g 1010 asmadmin
groupadd -g 1011 asmoper
groupadd -g 1012 asmdba
useradd -u 1012 -g oinstall -G asmadmin,asmdba,asmoper,dba grid
useradd -u 1002 -g oinstall -G dba,oper,asmdba oracle
passwd oracle
passwd grid
10)创建目录
mkdir -p /u01/app/11.2.0/grid
mkdir -p /u01/app/grid
chown -R grid:oinstall /u01
mkdir /u01/app/oracle
chown oracle:oinstall /u01/app/oracle
chmod -R 775 /u01/
11)环境变量
vi .bash_profile文件
export ORACLE_SID=+ASM1
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/11.2.0/grid
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"
export PATH=$ORACLE_HOME/bin:$PATH
Oracle用户的环境变量设置
在oracle的家目录下/home/oracle
vi .bash_profile文件
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export CRS_HOME=/u01/app/oracle/crs_1
export PATH=$HOME/bin:$CRS_HOME/bin:$ORACLE_HOME/bin:$PATH
export ORACLE_OWNER=oracle
export ORACLE_SID=DAAS1
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
12)安装所需要的rpm (所有节点安装)
[root@rac1 soft]# rpm -ivh pdksh-5.2.14-30.x86_64.rpm
warning: pdksh-5.2.14-30.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 73307de6: NOKEY
Preparing...########################################### [100%]
1:pdksh########################################### [100%]
[root@rac1 rpm]# rpm -ivh cvuqdisk-1.0.9-1.rpm
Preparing...########################################### [100%]
Using default group oinstall to install package
1:cvuqdisk########################################### [100%]
2、配置磁盘
添加六块共享磁盘
本次实验使用的虚拟机为vtribox
添加共享磁盘略。
Rac1:
[root@rac2 ~]# fdisk -l
Disk /dev/sda: 214.7 GB, 214748364800 bytes
255 heads, 63 sectors/track, 26108 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000f0fba
Device Boot Start End BlocksId System
/dev/sda1* 1 26 20480083 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 26 5484194304 82 Linux swap / Solaris
Partition 2 does not end on cylinder boundary.
/dev/sda3 548 26109205315072 83 Linux
Disk /dev/sdb: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/sdc: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/sdd: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/sde: 214.7 GB, 214748364800 bytes
255 heads, 63 sectors/track, 26108 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/sdf: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/sdg: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Rac2:
fdisk -l
Disk /dev/sda: 214.7 GB, 214748364800 bytes
255 heads, 63 sectors/track, 26108 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000eceaf
Device Boot Start End BlocksId System
/dev/sda1* 1 26 20480083 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 26 5484194304 82 Linux swap / Solaris
Partition 2 does not end on cylinder boundary.
/dev/sda3 548 26109205315072 83 Linux
Disk /dev/sdb: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/sdc: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/sdd: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/sde: 214.7 GB, 214748364800 bytes
255 heads, 63 sectors/track, 26108 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/sdf: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/sdg: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
[root@rac1 ~]# ls -l /dev/sd*
brw-rw---- 1 root disk 8, 0 Jun7 11:57 /dev/sda
brw-rw---- 1 root disk 8, 1 Jun7 11:57 /dev/sda1
brw-rw---- 1 root disk 8, 2 Jun7 11:57 /dev/sda2
brw-rw---- 1 root disk 8, 3 Jun7 11:57 /dev/sda3
brw-rw---- 1 root disk 8, 16 Jun 7 11:57 /dev/sdb
brw-rw---- 1 root disk 8, 32 Jun 7 11:57 /dev/sdc
brw-rw---- 1 root disk 8, 48 Jun 7 11:57 /dev/sdd
brw-rw---- 1 root disk 8, 64 Jun 7 11:57 /dev/sde
brw-rw---- 1 root disk 8, 80 Jun 7 11:57 /dev/sdf
brw-rw---- 1 root disk 8, 96 Jun 7 11:57 /dev/sdg
[root@rac2 ~]# ls -l /dev/sd*
brw-rw---- 1 root disk 8, 0 Jun7 11:57 /dev/sda
brw-rw---- 1 root disk 8, 1 Jun7 11:57 /dev/sda1
brw-rw---- 1 root disk 8, 2 Jun7 11:57 /dev/sda2
brw-rw---- 1 root disk 8, 3 Jun7 11:57 /dev/sda3
brw-rw---- 1 root disk 8, 16 Jun 7 11:57 /dev/sdb
brw-rw---- 1 root disk 8, 32 Jun 7 11:57 /dev/sdc
brw-rw---- 1 root disk 8, 48 Jun 7 11:57 /dev/sdd
brw-rw---- 1 root disk 8, 64 Jun 7 11:57 /dev/sde
brw-rw---- 1 root disk 8, 80 Jun 7 11:57 /dev/sdf
brw-rw---- 1 root disk 8, 96 Jun 7 11:57 /dev/sdg
2)获取共享磁盘的UUID
vi 1.sh
for i in b c d e f g
do
echo "KERNEL==\"sd*\", BUS==\"scsi\", PROGRAM==\"/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/\$name\", RESULT==\"`/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/sd$i`\", NAME=\"asm-disk$i\", OWNER=\"grid\", GROUP=\"asmadmin\", MODE=\"0660\""
done
vi /etc/udev/rules.d/99-oracle-asmdevices.rules
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c294347acba383e23ecbd43867c4", NAME="asm-diskb", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c2913d3b49354c9d030816bd5de9", NAME="asm-diskc", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c296cf9ff63b87e2903925bdec21", NAME="asm-diskd", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c2952ef3147bf0c3efc345133b00", NAME="asm-diske", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c296f16a22e6292edfb3ec3b1934", NAME="asm-diskf", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c29ae38dfe96f6342cb2afd7f3fb", NAME="asm-diskg", OWNER="grid", GROUP="asmadmin", MODE="0660"
将配置文件传输到rac2节点
scp /etc/udev/rules.d/99-oracle-asmdevices.rules rac2:/etc/udev/rules.d/
3)在node1,node2上重新启动udev
start_udev
4)验证asm
ls -al /dev/asm*
3、GI安装
到100%的时候报错,可以直接点击OK,然后skip。查看日志发现几个error,
INFO: Checking name resolution setup for "dbscan"...
INFO: ERROR:
INFO: PRVG-1101 : SCAN name "dbscan" failed to resolve
INFO: ERROR:
INFO: PRVF-4657 : Name resolution setup check for "dbscan" (IP address: 192.168.16.30) failed
INFO: ERROR:
INFO: PRVF-4664 : Found inconsistent name resolution entries for SCAN name "dbscan"
INFO: Verification of SCAN VIP and Listener setup failed
INFO: Checking OLR integrity...
INFO: Checking OLR config file...
INFO: OLR config file check successful
INFO: Checking OLR file attributes...
INFO: OLR file check successful
INFO: WARNING:
INFO: Checking name resolution setup for "dbscan"...
INFO: ERROR:
INFO: PRVG-1101 : SCAN name "dbscan" failed to resolve
INFO: ERROR:
INFO: PRVF-4657 : Name resolution setup check for "dbscan" (IP address: 192.168.16.30) failed
INFO: ERROR:
INFO: PRVF-4664 : Found inconsistent name resolution entries for SCAN name "dbscan"
INFO: Verification of SCAN VIP and Listener setup failed
INFO: Checking OLR integrity...
INFO: Checking OLR config file...
INFO: OLR config file check successful
INFO: Checking OLR file attributes...
INFO: OLR file check successful
这个错误是scan解析失败,在os中ping一下scanip和scan name如果能ping通的话,那就没问题,直接ok,然后skip