您好,登錄后才能下訂單哦!
Oracle 11gR2構(gòu)建RAC之(1)--配置系統(tǒng)環(huán)境
系統(tǒng)環(huán)境:
操作系統(tǒng):RedHat EL5
Cluster: Oracle GI(Grid Infrastructure)
Oracle: Oracle 11.2.0.1.0
如圖所示:RAC 系統(tǒng)架構(gòu)
對于Oracle 11G構(gòu)建RAC首先需要構(gòu)建GI(Grid Infrastructure)的架構(gòu)
一、配置系統(tǒng)環(huán)境
1、網(wǎng)絡(luò)環(huán)境(all nodes) [root@node1 ~]# cat /etc/hosts # Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1 localhost 192.168.8.21 node1 192.168.8.23 node1-vip 10.10.10.21 node1-priv 192.168.8.22 node2 192.168.8.24 node2-vip 10.10.10.22 node2-priv 192.168.8.25 rac_scan --對于11g的RAC可以通過DNS服務(wù)器配置SCAN IP的解析,通過客戶端連接時,實現(xiàn)負載均衡;如果沒有配置DNS服務(wù)器,需在hosts文件解析SCAN IP,但不能實現(xiàn)負載均衡效果。 --對于DNS的配置,見另一博文: http://tiany.blog.51cto.com/513694/1421917 Oracle 11g RAC SCAN ip的原理及配置 2、建立用戶和組(all nodes) [root@node1 ~]# cat user.sh groupadd -g 200 oinstall groupadd -g 201 dba groupadd -g 202 oper groupadd -g 203 asmadmin groupadd -g 204 asmoper groupadd -g 205 asmdba useradd -u 200 -g oinstall -G dba,asmdba,oper oracle useradd -u 201 -g oinstall -G asmadmin,asmdba,asmoper,oper,dba grid --盡量保證每個node上oracle和grid用戶的UID一致。 3、配置oracle和grid用戶的環(huán)境變量(all nodes) oracle用戶: [grid@node1 ~]$ cat .bash_profile export EDITOR=vi export ORACLE_SID=prod1 //node2 為prod2 export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1 export LD_LIBRARY_PATH=$ORACLE_HOME/lib export PATH=$ORACLE_HOME/bin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin umask 022 grid用戶: [grid@node1 ~]$ cat .bash_profile export EDITOR=vi export ORACLE_SID=+ASM1 //node2 為+ASM2 export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=/u01/11.2.0/grid export GRID_HOME=/u01/11.2.0/grid export LD_LIBRARY_PATH=$ORACLE_HOME/lib export THREADS_FLAG=native export PATH=$ORACLE_HOME/bin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin umask 022 4、建立CRS和Oracle軟件主目錄(all nodes) [root@node1 ~]# cat mkdir.sh mkdir -p /u01/app/oraInventory chown -R grid:oinstall /u01/app/oraInventory/ chmod -R 775 /u01/app/oraInventory/ mkdir -p /u01/11.2.0/grid chown -R grid:oinstall /u01/11.2.0/grid/ chmod -R 775 /u01/11.2.0/grid/ mkdir -p /u01/app/oracle mkdir -p /u01/app/oracle/cfgtoollogs mkdir -p /u01/app/oracle/product/11.2.0/db_1 chown -R oracle:oinstall /u01/app/oracle chmod -R 775 /u01/app/oracle 5、配置系統(tǒng)內(nèi)核參數(shù)(all nodes) [root@node1 ~]# cat /etc/sysctl.conf fs.aio-max-nr = 1048576 fs.file-max = 6815744 kernel.shmall = 2097152 kernel.shmmax = 536870912 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 = 1048586 內(nèi)核參數(shù)修改生效: [root@node1 ~]# sysctl -p net.ipv4.ip_forward = 0 net.ipv4.conf.default.rp_filter = 1 net.ipv4.conf.default.accept_source_route = 0 kernel.sysrq = 0 kernel.core_uses_pid = 1 net.ipv4.tcp_syncookies = 1 kernel.msgmnb = 65536 kernel.msgmax = 65536 kernel.shmmax = 4294967295 kernel.shmall = 268435456 fs.aio-max-nr = 1048576 fs.file-max = 6815744 kernel.shmall = 2097152 kernel.shmmax = 536870912 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 = 1048586 6、建立oracle和grid用戶訪問系統(tǒng)資源的限制(all nodes) [root@node1 ~]# cat /etc/security/limits.conf oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536 oracle soft stack 10240 grid soft nproc 2047 grid hard nproc 16384 grid soft nofile 1024 grid hard nofile 65536 grid soft stack 10240 7、配置用戶會話訪問資源的限制(all nodes) [root@node1 ~]# cat /etc/pam.d/login session required /lib/security/pam_limits.so 8、配置全局shell訪問限制 [root@node1 ~]#cat /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 fi 9、配置時間同步(all nodes) 在11g的RAC中GI自帶了,時間同步的功能,所以不再需要操作系統(tǒng)同步的ntp service,在所有node關(guān)閉ntp service。 [root@node1 ~]# chkconfig ntpd off [root@node1 ~]# mv /etc/ntp.conf /etc/ntp.conf.bak
--未完待續(xù)
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。