分类: LINUX
2012-10-16 23:12:21
参考: http://candon123.blog.51cto.com/704299/336002
2.软环境:
NO. |
Item |
Public network
|
Private network
|
Vip network |
Scan ip |
hardware |
OS |
App |
|
1 |
Node01 |
FQDN |
node01.studios.com |
node01-priv |
node01-vip.studios.com |
oracle-san.studios.com 192.168.1.120 |
1.cpu:i7-2600 mem:2G(oracle require) disk:120G |
RHEL5.5_64bit |
ASM/oracle grid oracle 11g/2 |
IP Addr |
192.168.1.111 |
172.25.100.111 |
192.168.1.115 |
||||||
2 |
Node02 |
FQDN |
node02.studios.com |
node02-priv |
node02-vip.studios.com |
||||
IP Addr |
192.168.1.112 |
172.25.100.112 |
192.168.1.116 |
||||||
3 |
Openfiler |
FQDN |
san.studios.com |
san-priv.studios.com |
MEM:1G DISK:20G+3*80G |
Openfiler |
openfiler |
||
IP Addr |
192.168.1.249 |
172.25.100.249 |
|||||||
4 |
DNS |
FQDN |
MEM:2G DISK:120G |
RHEL5.5_64bit |
VSFTPD createrepo |
||||
IP Addr |
192.168.1.250 |
||||||||
5 |
Clent |
192.168.1.100 |
Win7 |
Oracle client |
3.OS install: 1)install DNS/YUM
2) Install Openfiler
Download:
After installed openfiler:
user:openfiler password: password
Volumes
在dns/yum与openfiler设置完成后,下面正式进行node01/node02的设置与配置。
3)node01(node02)安装与配置 1.OS install
1)disabled firewall(iptables) 2)disabled selinux 2.setup yum repos(private yum resource) #vi /etc/yum.repos.d/rhel-source.repo4.setup san storge disk:
#yum -y install iscsi-initiator-utils*
#service iscsid start
#chkconfig iscsid on
mount disk:
#iscsiadm -m discovery -t sendtargets -p 192.168.1.249
#iscsiadm -m discovery -t sendtargets -p 192.168.1.249:3260 >>/etc/rc.local
#iscsiadm -m node -T iqn.2006-01.com.openfiler:tsn.982fa0420fc2 -p 192.168.1.249:3260 -l >>/etc/rc.local
#fdisk -l (/dev/sdb |/dev/sdc /dev/sdd)
#fisk /dev/sd* (进行分区) (/dev/sdb1 /dev/sdc1 /dev/sdd1)
(以个人iscsi为准)
4.Oracle 相关环境配置
1).Install Software for oracle
sysstat-7.0.2
unixODBC
unixODBC-devel (官方提供)
#yum -y install binutils compat-libstdc++ 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
2) add users and groups:
groupadd -g 600 oinstall
groupadd -g 601 asmadmin
groupadd -g 602 asmdba
groupadd -g 603 asmoper
groupadd -g 604 dba
groupadd -g 605 oper
useradd -u 600 -g oinstall -G asmdba,dba,oper -m -d /home/oracle oracle
useradd -u 601 -g oinstall -G asmadmin,asmdba,asmoper -m -d /home/grid grid
####make directory for the oralce#####
mkdir -p /u01/app/11.2.0/grid
mkdir -p /u01/app/grid
mkdir -p /u01/app/oracle
chown -R grid:oinstall /u01
chown -R grid:oinstall /u01/app/11.2.0/grid
chown -R grid:oinstall /u01/app/grid
chown -R oracle:oinstall /u01/app/oracle
chmod -R 775 /u01/
3) 相关参数配置(node01 node02): (1).#vi /etc/sysctl.conf
#sysctl -p (使自己的配置生效)
(2)./etc/security/limits.conf (添加oracle的相关limits)
(3)./etc/pam.d/login 追加:pam限制。
#echo "session required pam_limits.so " >>/etc/pam.d/login
(4).#/etc/profile 添加:
umask 022 fi
(5).设置用户.bash_profile
For oracle用户(/home/oracle/.bash_profile) (node01与node02相应,只是把sid作了变更。)
ORACLE_SID=orc1; export ORACLE_SID #node02 变更ORACLE_SID=orc2
ORACLE_UNQNAME=racdb; export ORACLE_UNQNAME
JAVA_HOME=/usr/local/java; export JAVA_HOME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1; export ORACLE_HOME
ORACLE_PATH=/u01/app/common/oracle/sql; export ORACLE_PATH
For grid用户(/home/grid/.bash_profile) (node01与node02相应,只是把sid作了变更。)
(6).安装asm
download software:oracleasm-support oracleasmlib oracleasm (根据自己系统版本下载)
# uname -crm
2.6.9-5.ELsmp i686
#rpm -ivh oracleasm*
oracleasm-2.6.18-194.el5-2.0.5-1.el5.x86_64.rpm
oracleasm-support-2.1.7-1.el5.x86_64.rpm
oracleasmlib-2.0.4-1.el5.x86_64.rpm
(7).配置ssh通道: 1)node01:
2)node02:
#su - oracle
#mkdir ~/.ssh chmod 700 ~/.ssh
#/usr/bin/ssh-keygen -t rsa
#/usr/bin/ssh-keygen -t dsa
#su - oracle
$mkdir ~/.ssh chmod 700 ~/.ssh
$/usr/bin/ssh-keygen -t rsa #(直接回车,默认就可)
$/usr/bin/ssh-keygen -t dsa #(直接回车,默认就可)
$touch .ssh/authorized_keys
$ssh node01 cat /home/oracle/.ssh/id_rsa.pub >> authorized_keys
$ssh node01 cat /home/oracle/.ssh/id_dsa.pub >> authorized_keys
$ssh node02 cat /home/oracle/.ssh/id_dsa.pub >> authorized_keys
$ssh node02 cat /home/oracle/.ssh/id_rsa.pub >> authorized_keys
$scp authorized_keys node02:/home/oracle/.ssh/
$ssh node01 date
$ssh node02 date
$ssh node01-priv date
$ssh node01-priv date
$ssh node02-priv date
$ssh node01-priv date
$ssh node02-priv date
以上是作为oracle用户的配置,grid用户的ssh配置与oracle相同。
(8).去掉本机的ntpd时间同步。
(8).重新启动(node01/node02) 按上面配置检测一下,看看配置是否和上面的配置相同。
ORACLEASM_SCANEXCLUDE=""
[root@node01 file]# oracleasm configure -i #oracleasm configure -i
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#oracleasm createdisk CRSV /dev/sdc1 #oracleasm createdisk DATAV /dev/sdb1 #oracleasm createdisk FRAV /dev/sdd1 #oracleasm listdisks #####node02查看分区类型######### #oracleasm scandisks
#oracleasm listdisks至此oracle grid的基本环境已经配置完成。
#创建asm分区
5.安装Grid Infrastructure (Node01) 上传oracle的相关基础包到node01: /var/software
linux_11gR2_grid.zip linux_11gR2_database_1of2.zip linux_11gR2_database_2of2.zip(node01 node02都需要安装) (node01 node02都需要安装)
(检查grid的安装环境)
......
Fixup information has been generated for following node(s): node2,node1 Please run the following script on each node as
"root" user to execute the fixups: '/tmp/CVU_11.2.0.1.0_grid/runfixup.sh' Pre-check for cluster services setup was
unsuccessful on all the nodes.
(在node01 node02 用root用户执行 /tmp/CVU_11.2.0.1.0_grid/runfixup.sh)
重启执行:./runcluvfy.sh stage -pre crsinst -n node01,node02 -fixup -verbose
Pre-check for cluster services setup was successful (检测成功后,可以正常执行下一步)
安装grid infrastructure [grid@node1 grid]$ ./runInstaller
不配置GNS SCAN名称和/etc/hosts中的对应 cluster名称可以自己定义一个
选择网卡用途eth0为公网 eth1为私网->asm
C
2个节点脚本执行完成后 最后是 'UpdateNodeList' was successful. 表示执行成功 执行完毕后 点击 ok 开始剩余内容配置
S
至此grid infrastructure安装完成。
6. 安装oracle 11g r2 1).用ASM配置磁盘组:
#su - grid
创建DATA FRA磁盘:
2).安装oracle 11g R2 node01:
#su - oracle $cd /var/software $sudo unzip linux_11gR2_database $cd database [oracle@node1 database]$ ./runInstaller用root在node01,node02上执行root.sh
安装数据库: [oracle@node01 ~]$ dbca (图片略)
检查rac的状态:
[grid@node01 ~]$ crsctl status resource –t [grid@node02~]$ crsctl status resource –t
[oracle@node01 ~]$ srvctl start nodeapps -n node01 RAC的启动顺利/关闭正好相反[oracle@node01 ~]$ srvctl start nodeapps -n node02
[oracle@node01 ~]$ srvctl start asm -n node01
[oracle@node01 ~]$ srvctl start asm -n node02
[oracle@node01 ~]$ srvctl start instance -d oracledb -i orc1 -o mount [oracle@node01 ~]$ srvctl start instance -d oracledb -i orc2 -o open