|
#*********正式实施文档部分开始****************
# 本实施文档包含4个节点的RAC集群 *
# 除特别说明以下都4个节点同时执行 *
#********************************************
#*********关闭selinux************************
vi /etc/selinux/config
SELINUX=disabled
#*********关闭防火墙************************
#service iptables status
service iptables stop
chkconfig iptables off
chkconfig --list|grep iptables
#*********关闭时间同步服务********************
mv /etc/ntp.conf /etc/ntp.conf.orig
rm /var/run/ntpd.pid
#*********修改配置host文件********************
vi /etc/hosts
#public Network - (eth0)
192.168.150.81 rac1
192.168.150.82 rac2
192.168.150.83 rac3
192.168.150.84 rac4
#private Interconnect - (eth1)
10.10.10.1 rac1-prv
10.10.10.2 rac2-prv
10.10.10.3 rac3-prv
10.10.10.4 rac4-prv
#Public Virtual IP (VIP) addresses - (eth0:1)
192.168.150.85 rac1-vip
192.168.150.86 rac2-vip
192.168.150.87 rac3-vip
192.168.150.88 rac4-vip
#Single Client Access Name (SCAN)
192.168.150.89 cluster-scan
#********使用iscsi存储时才增加*************
# Private Storage Network for Openfiler - (eth1)
192.168.150.195 openfiler1
10.10.10.195 openfiler1-priv
#*****//redhat*****
vi /etc/sysconfig/network
#*****//suse*****
vi /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=rac1 #此处为本节点主机名
GATEWAY=192.168.150.254
#*****添加用户和组*****
groupadd -g 1101 oinstall
groupadd -g 1102 dba
groupadd -g 1103 asmadmin
groupadd -g 1104 asmdba
groupadd -g 1105 asmoper
groupadd -g 1106 oper
#*****************redhat*************
useradd -u 1201 -g oinstall -G asmadmin,asmdba,asmoper,dba grid
useradd -u 1202 -g oinstall -G dba,asmdba,oper oracle
#*****************suse****************
useradd -u 1201 -g oinstall -G asmadmin,asmdba,asmoper,dba grid -m
useradd -u 1202 -g oinstall -G dba,asmdba,oper oracle -m
#*****为用户设置密码*****
passwd grid (password@123)
passwd oracle (password@123)
#*****/etc/sysctl.conf*******
vi /etc/sysctl.conf
kernel.shmall = 4194304
kernel.shmmax = 17179869184 #物理内存的一半字节(17179869184/1024/1024/1024=16G)
#以上两项系统一般已添加
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 6815744
fs.aio-max-nr=1048576
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
#********执行生效**********
/sbin/sysctl -p
#可进行验证/sbin/sysctl -a | grep 'core\.[rw]mem'
#*********/etc/security/limits.conf*************
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
#*************/etc/pam.d/login********************
vi /etc/pam.d/login
session required pam_limits.so
#*************/etc/profile******************
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
#************/etc/csh.login*****************
vi /etc/csh.login
if ( $USER = "oracle" || $USER = "grid" ) then
limit maxproc 16384
limit descriptors 65536
endif
#*******list the currently installed packages*******
rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' binutils \
compat-libstdc++-33 \
elfutils-libelf \
elfutils-libelf-devel \
gcc \
gcc-c++ \
glibc \
glibc-common \
glibc-devel \
glibc-headers \
ksh \
libaio \
libaio-devel \
libgcc \
libstdc++ \
libstdc++-devel \
make \
sysstat \
unixODBC \
unixODBC-devel
********Enterprise Linux 5, and Red Hat Enterprise Linux 5***********
********The following packages (or later versions) must be installed:
binutils-2.17.50.0.6
compat-libstdc++-33-3.2.3
compat-libstdc++-33-3.2.3 (32 bit)
elfutils-libelf-0.125
elfutils-libelf-devel-0.125
gcc-4.1.2
gcc-c++-4.1.2
glibc-2.5-24
glibc-2.5-24 (32 bit)
glibc-common-2.5
glibc-devel-2.5
glibc-devel-2.5 (32 bit)
glibc-headers-2.5
ksh-20060214
libaio-0.3.106
libaio-0.3.106 (32 bit)
libaio-devel-0.3.106
libaio-devel-0.3.106 (32 bit)
libgcc-4.1.2
libgcc-4.1.2 (32 bit)
libstdc++-4.1.2
libstdc++-4.1.2 (32 bit)
libstdc++-devel 4.1.2
make-3.81
sysstat-7.0.2
unixODBC-2.2.11
unixODBC-2.2.11 (32 bit)
unixODBC-devel-2.2.11
unixODBC-devel-2.2.11 (32 bit)
*********SUSE 11 The following packages (or later versions) must be installed:
rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' binutils-2.19 \
gcc-4.3 \
gcc-32bit-4.3 \
gcc-c++-4.3 \
glibc-2.9 \
glibc-32bit-2.9 \
glibc-devel-2.9 \
glibc-devel-32bit-2.9 \
ksh-93t \
libaio-0.3.104 \
libaio-32bit-0.3.104 \
libaio-devel-0.3.104 \
libaio-devel-32bit-0.3.104 \
libstdc++33-3.3.3 \
libstdc++33-32bit-3.3.3 \
libstdc++43-4.3.3_20081022 \
libstdc++43-32bit-4.3.3_20081022 \
libstdc++43-devel-4.3.3_20081022 \
libstdc++43-devel-32bit-4.3.3_20081022 \
libgcc43-4.3.3_20081022 \
libstdc++-devel-4.3 \
make-3.81 \
sysstat-8.1.5 \
#********安装rpm包(大部分包在linux安装盘)**********
rpm -Uvh compat-libstdc++-33**
#强制安装不建议:rpm -ivh compat-libstdc++-33** --nodeps --force
#********suse可用yum安装rpm包**********
#*******目录创建*********
mkdir -p /u01/app/grid
mkdir -p /u01/app/11.2.0/grid
chown -R grid.oinstall /u01
mkdir -p /u01/app/oracle
chown -R oracle.oinstall /u01/app/oracle
chmod -R 775 /u01/
#********grid用户的.bash_profile设置/第二节点ORACLE_SID=+ASM2********
#********grid用户的.bash_profile设置/第三节点ORACLE_SID=+ASM3********
#********grid用户的.bash_profile设置/第四节点ORACLE_SID=+ASM4********
su - grid
#********redhat*******
vi .bash_profile
#********suse*******
vi .profile
# Grid Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_SID=+ASM1; export ORACLE_SID
ORACLE_BASE=/u01/app/grid; export ORACLE_BASE
CVUQDISK_GRP=oinstall; export CVUQDISK_GRP
ORACLE_HOME=/u01/app/11.2.0/grid; export ORACLE_HOME
NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"; export NLS_DATE_FORMAT
THREADS_FLAG=native; export THREADS_FLAG
PATH=$ORACLE_HOME/bin:$PATH; export PATH
THREADS_FLAG=native; export THREADS_FLAG
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib
CLASSPATH=$ORACLE_HOME/JRE
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 .bash_profile
#********oracle用户的.bash_profile设置/第二节点ORACLE_SID=orcl2********
#********oracle用户的.bash_profile设置/第三节点ORACLE_SID=orcl3********
#********oracle用户的.bash_profile设置/第四节点ORACLE_SID=orcl4********
su - oracle
#********redhat*******
vi .bash_profile
#********suse*******
vi .profile
# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db1; export ORACLE_HOME
ORACLE_SID=orcl1; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"; export NLS_DATE_FORMAT
NLS_LANG=AMERICAN_AMERICA.ZHS16GBK;export NLS_LANG
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 .bash_profile
#11gr2中的 OUI 界面包含了一个新的特性,该特性可以在 Oracle 软件的实际安装阶段为执行该安装的用户帐户自动配置SSH。
#OUI 执行的自动配置会在集群的所有成员节点间创建无口令的 SSH 连接。Oracle 建议,只要有可能就使用自动配置过程。
#注:Oracle Clusterware 11g 第 2 版及更高版本不再支持使用口令短语配置 SSH。Oracle 11g 第 2 版及更高版本需要无口令的 SSH。
#********grid用户的ssh设置********
su - grid
#在所有节点执行
ssh-keygen -t rsa
ssh-keygen -t dsa
#第一种方法配置
#在节点1执行
ssh rac1 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
ssh rac1 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
scp ~/.ssh/authorized_keys rac2:~/.ssh/authorized_keys
#在节点2执行
ssh rac2 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
ssh rac2 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
scp ~/.ssh/authorized_keys rac3:~/.ssh/authorized_keys
#在节点3执行
ssh rac3 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
ssh rac3 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
scp ~/.ssh/authorized_keys rac4:~/.ssh/authorized_keys
#在节点4执行
ssh rac4 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
ssh rac4 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
scp ~/.ssh/authorized_keys rac1:~/.ssh/authorized_keys
scp ~/.ssh/authorized_keys rac2:~/.ssh/authorized_keys
scp ~/.ssh/authorized_keys rac3:~/.ssh/authorized_keys
#第二种简单方法配置
#在节点1执行
ssh rac1 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
ssh rac2 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
ssh rac3 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
ssh rac4 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
scp ~/.ssh/authorized_keys rac2:.ssh/authorized_keys
scp ~/.ssh/authorized_keys rac3:.ssh/authorized_keys
scp ~/.ssh/authorized_keys rac4:.ssh/authorized_keys
#**************最后在所有节点执行ssh rac* date*********
#********oracle用户的ssh设置********
su - oracle
#在所有节点执行
ssh-keygen -t rsa
ssh-keygen -t dsa
#第一种方法配置
#在节点1执行
ssh rac1 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
ssh rac1 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
scp ~/.ssh/authorized_keys rac2:~/.ssh/authorized_keys
#在节点2执行
ssh rac2 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
ssh rac2 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
scp ~/.ssh/authorized_keys rac3:~/.ssh/authorized_keys
#在节点3执行
ssh rac3 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
ssh rac3 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
scp ~/.ssh/authorized_keys rac4:~/.ssh/authorized_keys
#在节点4执行
ssh rac4 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
ssh rac4 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
scp ~/.ssh/authorized_keys rac1:~/.ssh/authorized_keys
scp ~/.ssh/authorized_keys rac2:~/.ssh/authorized_keys
scp ~/.ssh/authorized_keys rac3:~/.ssh/authorized_keys
#第二种简单方法配置
#在节点1执行
ssh rac1 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
ssh rac2 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
ssh rac3 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
ssh rac4 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
scp ~/.ssh/authorized_keys rac2:.ssh/authorized_keys
scp ~/.ssh/authorized_keys rac3:.ssh/authorized_keys
scp ~/.ssh/authorized_keys rac4:.ssh/authorized_keys
#**************最后要在所有节点执行ssh rac* "date;hostname"*********
#**************安装用于 Linux 的 cvuqdisk 程序包*******
#如果没有 cvuqdisk,集群验证实用程序就无法发现共享磁盘,当运行(手动运行或在 Oracle Grid Infrastructure
#安装结束时自动运行)集群验证实用程序时,您会收到这样的错误消息:“Package cvuqdisk not installed”。
su -
CVUQDISK_GRP=oinstall; export CVUQDISK_GRP
rpm -iv cvuqdisk-1.0.7-1.rpm
#设置变变量后,需不重起LINUX系统就进行GRID软件,否则请把CVUQDISK_GRP=oinstall; export CVUQDISK_GRP加入
#grid用户的配置文件中
#友情提醒,使用unzip 命令, 将下载到的ORACLE 安装文件放在/data/software 目录下
#最后使用chown 命令修改目录的所有者为oracle 用户:
#[root@rac1 ~]# chown -R grid:oinstall /data/software
#[root@rac1 ~]# chown -R oracle:oinstall /data/software
#********orcle11g r2 grid使用 CVU 验证是否满足 Oracle 集群件要求********
./runcluvfy.sh stage -pre crsinst -n rac1,rac2,rac3,rac4 -fixup -verbose | tee check4node.txt
#********orcle11g r2 grid使用 CVU 验证硬件和操作系统设置********
./runcluvfy.sh stage -post hwos -n racnode1,racnode2 -verbose
#********orcle11g r2 grid安装************
./runInstaller –ignoresysprereqs
#********orcle11g r2 database安装********
./runInstaller –ignoresysprereqs
#*********正式实施文档部分完华 *******************
# *
# 以下为附录部分 *
# *
#************************************************
|
|