您好,欢迎访问三七文档
当前位置:首页 > IT计算机/网络 > 数据库 > Linux+Oracle10g+RAC
RAC应用集群一.实施规划1.平台:操作系统:RedHatEnterpriseLinuxAdvancedServer5.0内存大小:2048M交换空间:2048M硬盘空间:10G网卡配置:2(publicIP,VitualIP,PrivateIP)主机结点:2(node1,node2)存储设备:1(DBfies)2.网络规划Node1公共192.168.100.101Node2公共192.168.100.102Node1-vip虚拟192.168.100.201Node2-vip虚拟192.168.100.202Node1-priv专用19.168.100.101Node2-priv专用19.168.100.1023.安装流程安装虚拟机vmwareServer1.0.9安装RHEL5.4配置RHEL操作系统复制第二台虚拟机配置双机信任关系建立ASM存储安装clusterware软件安装database软件配置监听Listener建立数据库实例二.新建虚拟机1.选择-》新建,虚拟机名为RAC1,location为F:\vmware\RAC1,网卡接口选择桥接网络方式(Usebridgednetworking),适配器选择LSILogic,虚拟硬盘选择SCSI,硬盘容量选择10G,然后选择每次扩充扩充2G(Splitdiskinto2GBfiles),不选择立即分配。然后按Add添加硬盘,先添加一个100M的硬盘,选择立即分配方式(Allocatealldiskspacenow),该盘作为VotingDisk盘,目录存放位置为F:\vmware\sharedisk\Votingdisk,虚拟设备结点选择SCSI1:1HardDisk2,模式选择一致即:independent-persistent。然后再添加一个100M的硬盘,选择立即分配,该盘作为OCRdisk盘,目录存放位置为:F:\vmware\sharedisk\OCRdisk,硬盘选择SCSI1:2,模式为一致。再添加一个2G的硬盘用作ASM的数据文件的空间,选择立即分配和2G扩充一个文件,目录位置为F:\vmware\sharedisk\ASMdisk,硬盘选择SCSI1:3,模式选择一致。再添加一个1.3G的硬盘用作ASM的闪回区,选择立即分配,目录位置为F:\vmware\sharedisk\ASMdisk2,硬盘选择SCSI1:4,模式选择一致性。再添加一块网卡,用作两台虚拟机之间的通信,连接方式选择Host-only模式并选择(connectatpoweron)。2.开启该虚拟机,安装RHEL5.4,注意事项:交换分区分2G,主机名为node1,eth0为192.168.100.101,eth1为19.168.100.101作为node1-priv,自定义安装包时,选择开发、服务器以及基本系统的全部,防火墙关闭,selinux设为enabled禁用。安装好之后,编辑F:\vmware\RAC1\RedHatLinux.vmx,添加如下一段(可以使那四个磁盘真正的作为共享盘):disk.locking=“false”disklib.dataCacheMaxSize=“0”disklib.dataCacheMaxReadAheadSize=“0”disklib.dataCacheMinReadAheadSize=“0”disklib.dataCachePageSize=“4096”disklib.maxUnsyncedWrites=“0”scsi1:1.deviceType=“disk”scsi1:2.deviceType=“disk”scsi1:3.deviceType=“disk”scsi1:4.deviceType=“disk”4.RHEL系统配置#uname–r2.6.128-164.el5#vim/etc/hosts(加上如下一段)192.168.100.101node1192.168.100.102node2192.168.100.201node1-vip192.168.100.202node2-vip19.168.100.101node1-priv19.168.100.102node2-priv#vim/etc/sysctl.conf(加上如下一段)Kernel.shmall=2097152Kernel.shmmax=536870912Kernel.shmmni=4096Kernel.sem=25032000100128Fs.file-max=65536Net.ipv4.ip_local_port_range=102465000Net.core.rmem_default=1048576Net.core.rmem_max=1048576Net.core.wmem_default=262144Net.core.wmem_max=262144#sysctl–p(是该文件生效)#vim/etc/security/limits.conf(加上如下一段)Oraclesoftnproc2047Oraclehardnproc16384Oraclesoftnofile1024Oraclehardnofile65536#vim/etc/pam.d/login(加上如下一段)Sessionrequired/lib/security/pam_limits.so#vim/etc/rc.loal(挂起检测时间定时器,检测对方有没有宕机)Modprobehangcheck-timerhangcheck-tick=30hangcheck_margin=20#groupaddoinstall#groupadddba#useradd–m–goinstall–Gdba#passwdoracle#vim/home/oracle/.bash_profileExportTMPDIR=/tmpExportORACLE_BASE=/u01/app/oracleExportORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1ExportORACLE_SID=RACDB1ExportORACLE_TERM=xtermExportPATH=$ORACLE_HOME/bin:/usr/bin:$PATHExportLD_LIBRARY_PATH=$ORACLE_HOME/bin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/binExportCLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlibUlimit–u16384–n65536Umask022#mkdir–p/u01/app/oracle#chown–Roracle:oinstall/u01#chmod–R775/u01#fdisk/dev/sdb#fdisk/dev/sdc#fdisk/dev/sdd#fdisk/dev/sde#partprobe#rpm–ivhoracleasm-support-*#rpm–ivhoracleasm-2.6.18-164.el5.*#rpm–ivhoracleasmlib*#rpm–ivhcompat-gcc-7.3.2-2.96.128.i386.rpm#rpm–Uvhcompat-libstdc++-7*--force#rpm–ivhcompat-libstdc---devel-7.3.2#rpm–ivhcompat-gcc-c++*#serviceoracleasmconfigureOracleOinstallYY#vim/etc/udev/rules.d/60-raw.rules(加上如下一段)ACTION==”add”,KERNEL==”/dev/sdb1”,RUN+=”/bin/raw/dev/raw1%N”ACTION==”add”,ENV{MAJOR}==”8”,ENV{MINOR}==”17”,RUN+=”/bin/raw/dev/raw/raw1%M%m”(其中的主设备号可以通过ls–l/dev/sd*查看)ACTION==”add”,KERNEL==”/dev/sdc1”,RUN+=”/bin/raw/dev/raw2%N”ACTION==”add”,ENV{MAJOR}==”8”,ENV{MINOR}==”33”,RUN+=”/bin/raw/dev/raw/raw2%M%m”KERNEL==”raw[1-2]”,OWNER=”oracle”,GROUP=”oinstall”,MODE=”640”#start_udev#ls–l/dev/raw/*#shutdown–hnow三.复制出第二台虚拟机1.将复制之后的名称为RAC1的改为RAC2,另外编辑RedHatLinux.vmx查找文件中的RAC1将它改为RAC2,然后编辑RAC2.vmdk将文件中的RAC1改为RAC2(如下所示):RW4192256SPARSE“RAC2-s001.vmdk”RW4192256SPARSE“RAC2-s002.vmdk”RW4192256SPARSE“RAC2-s003.vmdk”RW4192256SPARSE“RAC2-s004.vmdk”RW4192256SPARSE“RAC2-s005.vmdk”RW10240SPARSE“RAC2-s006.vmdk”2.打开RAC2,选择Create3.配置node2操作系统#hostnamenode2#vim/etc/sysconfig/networkHOSTNAME=node2#vim/etc/hosts127.0.0.1node2localhost.localdomainlocalhost#cd/etc/sysconfig/network-scripts/#catifcfg-eth0.bak#catifcfg-eth0#catifcfg-eth1.bak#catifcfg-eth1#mvifcfg-eth0.bakifcfg-eth0#mvifcfg-eth1.bakifcfg-eth1#ifconfigeth0|grepHWaddr#catifcfg-eth0|grepADDR#ifconfigeth1|grepHwaddr#catifcfg-eth1|grepADDR#cat/home/oracle/.bash_profile|grepORACLE_SIDExportORACLE_SID=RACDB2#pingnode1#pingnode2#pingnode1-priv#pingnode2-priv4.时间同步Node2]#sshnode1Node1]#servicexinetdstartNode1]#chkconfigtime-streamonNode1]#chkconfigxinetdonNode1]#chkconfigntpdonNode1]#servicentpdrestartNode1]#exitNode2]#crontab–e0-59/1****rdate–s192.168.100.1010-59/1****ntpdate192.168.100.101Node2]#/etc/resolv.confNode2]#sshnode1Node1]#/etc/resolv.conf四.配置双机信任关系Node1]#su–oracleNode1]$mkdir.sshNode1]$chmod700.sshNode1]$ssh-keygen–trsaNode1]$ssh-keygen-tdsaNode2]#su–oracleNode2]$mkdir.sshNode2]$chmod700.sshNode2]$ssh-keygen-trsaNode2]$ssh-keygen-tdsaNode1]$cat/home/oracle/.ssh/id_rsa.pub/h
本文标题:Linux+Oracle10g+RAC
链接地址:https://www.777doc.com/doc-8242 .html