这篇文章将为大家详细讲解有关Oracle RAC如何搭建,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。RAC搭建一、准备工作.
11.规划.
12.网络配适器准备(rac1& rac2).
23.关闭防火墙和SElinux(rac1& rac2)
24.修改主机名(rac1& rac2).
35.修改host文件–网络配置(rac1& rac2).
36.软件包准备.
3二、修改参数.
41.修改系统参数(rac1&rac2)
42.修改limits文件(rac1&rac2)
4三、添加组、用户、目录.
41.添加组(rac1&rac2)
42.添加用户(rac1&rac2)
53.创建目录(rac1&rac2)
5四、配置环境变量(RAC1&RAC2).
6五、共享磁盘准备.
71.Openfile使用.
72.对磁盘进行分区(rac1).
153.准备裸设备规则列表(rac1& rac2).
16六、解压grid,配置ssh互信.
171.解压grid(rac1)
172.配置互信(rac1)
173.检查互信(rac1&rac2)
174.安装grid解压后的cvuqdisk包(rac1 & rac2)
18七、配置本地yum源,安装软件包(rac1&rac2)
18八、关闭没有必要的服务(rac1&rac2).
18九、安装GI软件(rac1)
19十、创建ASM磁盘组.
30十一、安装数据库软件.
32十二、DBCA建库.
40十三、安装后检查.
481.查看监听.
482.查看实例.
48rac1rac2IP192.168.131.100/rac1192.168.131.101/rac2privary IP10.0.0.100/rac1-priv10.0.0.101/rac2-privVIP192.168.131.123/rac1-vip192.168.131.124/rac2-vipscanIP192.168.131.125/racscan-iphostnamerac1rac2OS版本RHEL 6.4RHEL 6.4DB版本11.2.0.411.2.0.4Cluster softwareGI 11.2.0.4GI 11.2.0.4存储Openfile/192.168.131.191在虚拟机设置界面添加两个网络配适器,一个用于公网(选择NET模式),另一个用于节点间通信(选择host only模式)。配置网卡信息如下IP192.168.131.100/rac1192.168.131.101/rac2privary IP10.0.0.100/rac1-priv10.0.0.101/rac2-priv[root@rac01 ~]#chkconfig iptables off[root@rac01 ~]#service iptables stop关闭selinux[root@rac01 ~]# vi /etc/selinux/configSELINUX=disabledvi /etc/sysconfig/networkHOSTNAME=rac1GATEWAY=192.168.131.1vi /etc/hosts添加以下内容192.168.131.100 rac1192.168.131.101 rac210.0.0.102 rac1-priv10.0.0.103 rac2-priv192.168.131.123 rac1-vip192.168.131.124 rac2-vip## vip一定是不能ping通192.168.131.125 racscan-ip(rac1)GI目录:/u01/setup/gridDB目录:/u01/setup/dbOS目录:/u01/setup/os(rac2)OS目录:/u01/setup/osvi /etc/sysctl.conffs.aio-max-nr = 1048576fs.file-max = 6815744kernel.shmmax = 4294967296 ##该值为内存的75%,单位为字节kernel.shmmni = 4096kernel.shmall = 2097152kernel.sem = 250 32000 100 128net.ipv4.ip_local_port_range = 9000 65500net.cor免费主机域名e.rmem_default = 262144net.core.rmem_max = 4194304net.core.wmem_default = 262144net.core.wmem_max = 1048576使参数立即生效:[root@rac01 ~]# /sbin/sysctl -p[root@rac01 ~]# vi /etc/security/limits.confgrid soft nproc 2047grid hard nproc 16384grid soft nofile 1024grid hard nofile 65536oracle soft nproc 2047oracle hard nproc 16384seoracle soft nofile 1024oracle hard nofile 65536groupadd -g 501 oinstallgroupadd -g 502 dbagroupadd -g 503 opergroupadd -g 504 asmadmingroupadd -g 505 asmopergroupadd -g 506 asmdba(1)
添加用户useradd -g oinstall -G dba,asmdba,oper,oinstall oracleuseradd -g oinstall -G asmadmin,asmdba,asmoper,oper,dba,oinstall grid(2)为grid和oracle用户设置密码[root@rac01 ~]# passwd oracle[root@rac01 ~]# passwd grid(3)检查[root@ora1 ~]# id oracleuid=501(oracle) gid=501(oinstall)groups=501(oinstall),502(dba),503(oper),506(asmdba)[root@ora1 ~]# id griduid=502(grid) gid=501(oinstall)groups=501(oinstall),502(dba),503(oper),504(asmadmin),505(asmoper),506(asmdba)(root用户)mkdir -p /u01/app/oraclemkdir -p /u01/app/gridmkdir -p /u01/app/11.2.0/gridchown -R grid:oinstall /u01/app/gridchown -R grid:oinstall /u01/app/11.2.0chown -R oracle:oinstall /u01/app/oraclechmod -R 775 /u01mkdir -p /u01/app/oraInventorychown -R grid:oinstall /u01/setup/gridchown -R oracle:oinstall /u01/setup/dbchown -R grid:oinstall /u01/app/oraInventorychmod -R 775 /u01/app/oraInventory—–切换到grid用户下—–rac1[grid@rhel_linux_asm ~]$ vim .bash_profileexport ORACLE_SID=+ASM1export ORACLE_BASE=/u01/app/gridexport ORACLE_HOME=/u01/app/11.2.0/gridexport LD_LIBRARY_PATH=$ORACLE_HOME/libexport PATH=$ORACLE_HOME/bin:$PATHrac2[grid@rhel_linux_asm ~]$ vim .bash_profileexport ORACLE_SID=+ASM2export ORACLE_BASE=/u01/app/gridexport ORACLE_HOME=/u01/app/11.2.0/gridexport LD_LIBRARY_PATH=$ORACLE_HOME/libexport PATH=$ORACLE_HOME/bin:$PATH—-切换到Oracle用户下——rac1# su – oracle$ vi /home/oracle/.bash_profileexport ORACLE_SID=orcl1export ORACLE_BASE=/u01/app/oracleexport ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1export LD_LIBRARY_PATH=$ORACLE_HOME/libexport PATH=$PATH:$ORACLE_HOME/binrac2# su – oracle$ vi /home/oracle/.bash_profileexport ORACLE_SID=orcl2export ORACLE_BASE=/u01/app/oracleexport ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1export LD_LIBRARY_PATH=$ORACLE_HOME/libexport PATH=$PATH:$ORACLE_HOME/bin(1)Openfile的下载安装Openfile iso文件下载地址http://www.openfiler.com/commun免费主机域名ity/download(2)访问Openfile管理系统创建一个新的虚拟机,配置如下
硬盘说明:硬盘1是用于Openfile系统,硬盘2、3用于OCR盘,硬盘4-6用于DATA盘a)
在浏览器中按照上面的ip地址进入openfile管理系统b)
输入账号openfiler,密码password(界面很Q)c)
进入管理系统主界面(3)
使用Openfile添加磁盘a)
进入services标签,启动iscsi服务开启iscsi服务b)
进入system标签页增加一个允许访问的网段查看访问网段c)
进入volumes
创建物理卷此时,物理卷已经创建好d)
创建卷组此时,myvg卷组已经创建好了e)
创建逻辑卷同理,将/dev/sdc、/dev/sdd、/dev/sde、/dev/sdf做成lv步骤略………最后结果如图
f)
添加一个IQNg)
做一个磁盘映射此时逻辑卷添加完成,要使用的话,需要对逻辑卷进行扫描(4)
客户机端对openfile服务器进行扫描(rac1& rac2)命令
# iscsiadm -m discovery -t sendtargets -p 192.168.131.191 -l如果iscsiadm命令不可用,则需要安装iscsi-initiator
rpm包# iscsiadm -m discovery -t st -p 192.168.0.10-bash: iscsiadm: command not found# mount /u01/setup/os /mnt –加载光盘
mount: block device /dev/cdrom is write-protected, mounting read-only
# cd /mnt/# cd Server/
# ls -l *iscsi*
-r–r–r– 55 root root 579386 Dec 17 2008 iscsi-initiator-utils-6.2.0.868-0.18.el5.i386.rpm
# rpm -ivh iscsi-initiator-xxxxxxxxxxx.rpmOK,重试iscsiadm命令(执行命令)#
for i in `cat /proc/partitions | awk {‘print $4’} |grep sd`; do echo “### $i: `/lib/udev/scsi_id –whitelist –replace-whitespace /dev/$i`”; done上面红框里的内容就是我们需要的wwid(通过磁盘的wwid进行绑定)# vi /etc/udev/rules.d/99-oracle-asmdevices.rulesKERNEL==”sd*”,BUS==”scsi”,PROGRAM==”/sbin/scsi_id –whitelisted –replace-whitespace –device=/dev/$name”,RESULT==”14f504e46494c455234524b33457a2d493449682d6c555746″,NAME=”asm_ocr1″, OWNER=”grid”,GROUP=”oinstall”,MODE=”0660″KERNEL==”sd*”,BUS==”scsi”,PROGRAM==”/sbin/scsi_id –whitelisted –replace-whitespace –device=/dev/$name”,RESULT==”14f504e46494c45524644775047362d445155342d33315251″,NAME=”asm_ocr2″, OWNER=”grid”,GROUP=”oinstall”,MODE=”0660″KERNEL==”sd*”,BUS==”scsi”,PROGRAM==”/sbin/scsi_id –whitelisted –replace-whitespace –device=/dev/$name”,RESULT==”14f504e46494c4552457a786c38542d656c6c412d30547753″,NAME=”asm_data1″, OWNER=”grid”,GROUP=”oinstall”,MODE=”0660″KERNEL==”sd*”,BUS==”scsi”,PROGRAM==”/sbin/scsi_id –whitelisted –replace-whitespace –device=/dev/$name”,RESULT==”14f504e46494c45526377784361742d525865332d48357a36″,NAME=”asm_data2″, OWNER=”grid”,GROUP=”oinstall”,MODE=”0660″KERNEL==”sd*”,BUS==”scsi”,PROGRAM==”/sbin/scsi_id –whitelisted –replace-whitespace –device=/dev/$name”,RESULT==”14f504e46494c455271325a4a66662d5a6959672d4a337961″,NAME=”asm_data3″, OWNER=”grid”,GROUP=”oinstall”,MODE=”0660″启动设备# start_udev查看设备[root@rac1 ~]#
cd /dev[root@rac1 ~]#
ll asm*# su – grid $ cd /u01/setup/grid $ unzip p*.zip(root用户执行)# /u01/setup/grid/grid/sshsetup/sshUserSetup.sh -user oracle -hosts “rac1 rac2” -advanced -noPromptPassphrase# /u01/setup/grid/grid/sshsetup/sshUserSetup.sh -user grid -hosts “rac1 rac2” -advanced -noPromptPassphrase(记得每个用户要输入4次密码)su – gridssh rac1 datessh rac2 datessh rac1-priv datessh rac2-priv datesu – oraclessh rac1 datessh rac2 datessh rac1-priv datessh rac2-priv date(验证互相访问不需要密码)[root@rac1 grid]# cd rpm/# rpm -ivh cvuqdisk-1.0.9-1.rpm(root用户)# mount -o loop /u01/setup/os/* /mnt# yum-config-manager –add-repo file:///mntvi /etc/yum.repos.d/mnt.repo[mnt]name=Yum Sourcebaseurl=file:///mntenabled=1gpgcheck=0# yum makecache安装如下包:[root@rac01 opt]#yum install
-y binutils compat* elfutils-libelf elfutils-libelf-devel glibc glibc-common glibc-devel gcc gcc-c++ libaio libgcc libstdc++ libstdc++-devel make sysstat unixODBC-devel libaio-devel kshchkconfig autofs offchkconfig acpid offchkconfig sendmail offchkconfig cups-config-daemon offchkconfig cpus offchkconfig xfs offchkconfig lm_sensors offchkconfig gpm offchkconfig openibd offchkconfig pcmcia offchkconfig cpuspeed offchkconfig nfslock offchkconfig ip6tables offchkconfig rpcidmapd offchkconfig apmd offchkconfig sendmail offchkconfig arptables_jf offchkconifg microcode_ctl offchkconfig rpcgssd offchkconfig ntpd off1.可行性校验(执行以下脚本)[grid@rac1 grid]$ ./runcluvfy.sh stage -pre crsinst -n rac1,rac2 -fixup -verbose2.安装GI$ unzip /u01/setup/grid/p*$ cd /u01/setup/grid/grid运行
./run
查看集群状态[root@rac1 ~]# cd /u01/app/11.2.0/grid/bin/[root@rac1 bin]# ./crs_stat -t[grid@rac1 ~]$ export DISPLAY=192.168.131.1:0.0[grid@rac1 ~]$ asmcaDATA盘选择asm_data1/asm_data2/asm_data3解压
unzip /u01/setup/db/p* cd /u01/setup/db/database运行
./run
[oracle@rac1~]dbca
集群的监听由系统自动创建,直接查看就可以了关于“Oracle RAC如何搭建”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,使各位可以学到更多知识,如果觉得文章不错,请把它分享出去让更多的人看到。
相关推荐: MySQL 5.7从库报错exceeds of slave_pending_jobs_size_max. Error_code: 1864怎么办
这篇文章主要介绍了MySQL 5.7从库报错exceeds of slave_pending_jobs_size_max. Error_code: 1864怎么办,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家…