虛擬機器安裝rac傻瓜教程

peng163fj發表於2015-04-13

1.建立虛擬磁碟

E:\oavm\vmware-vdiskmanager.exe -c -s 2g -a lsilogic -t 2  D:\20150209\ocr_vote.vmdk

E:\oavm\vmware-vdiskmanager.exe -c -s 5g -a lsilogic -t 2  D:\20150209\data.vmdk

E:\oavm\vmware-vdiskmanager.exe -c -s 5g -a lsilogic -t 2  D:\20150209\fra.vmdk

2.修改虛擬機器配置檔案

#shared disks configure

disk.locking = "FALSE"

diskLib.dataCacheMaxSize = "0"

diskLib.dataCacheMaxReadAheadSize = "0"

diskLib.dataCacheMinReadAheadSize = "0"

diskLib.maxUnsyncedWrites = "0"

scsi1.present = "TRUE"

scsi1.virtualDev = "lsilogic"

scsil.sharedBus = "VIRTUAL"

scsi1:0.present = "TRUE"

scsi1:0.mode = "independent-persistent"

scsi1:0.fileName = "D:\20150209\ocr_vote.vmdk"

scsi1:0.deviceType = "disk"

scsi1:0.redo = ""

scsi1:1.present = "TRUE"

scsi1:1.mode = "independent-persistent"

scsi1:1.fileName = "D:\20150209\data.vmdk"

scsi1:1.deviceType = "disk"

scsi1:1.redo = ""

scsi1:2.present = "TRUE"

scsi1:2.mode = "independent-persistent"

scsi1:2.fileName = "D:\20150205\fra.vmdk"

scsi1:2.deviceType = "disk"

scsi1:2.redo = "" 

3.新增yum

/etc/yum.repos.d

yum clean all

yum makecache

3.修改IP地址

先將priv對應的網路卡設定好

#eth0 public 

192.168.17.246 rac1 

192.168.17.247 rac2 

#virtual 

192.168.17.250 rac1-vip

192.168.17.251 rac2-vip

#eth1 private 

192.168.1.1 rac1-priv

192.168.1.2 rac2-priv

#scan 

192.168.17.240 rac-scan

4.新增使用者組,目錄,許可權

groupadd    oinstall

groupadd    dba

groupadd    oper

groupadd    asmadmin

groupadd    asmdba

groupadd    asmoper

useradd -g oinstall -G dba,asmdba,asmadmin,asmoper grid

useradd -g oinstall -G dba,oper,asmdba oracle 

echo -n oracle|passwd --stdin grid

echo -n oracle|passwd --stdin oracle

mkdir -p /u01/app/11.2.0/grid

mkdir -p /u01/app/grid

mkdir -p /u01/app/oracle

chown grid:oinstall /u01/app/11.2.0/grid

chown grid:oinstall /u01/app/grid

chown -R oracle:oinstall /u01/app/oracle

chmod -R 775 /u01/

chown -R grid:oinstall /u01

5.修改核心引數

sed -i 's/kernel.shmmax/#kernel.shmmax/g'    /etc/sysctl.conf

sed -i 's/kernel.shmall/#kernel.shmall/g'    /etc/sysctl.conf


cat >>    /etc/sysctl.conf    << EOF

fs.aio-max-nr = 1048576

fs.file-max = 6815744

kernel.shmall = 2097152

kernel.shmmax = 1073741824

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

EOF


6.配置limits

cat >>    /etc/security/limits.conf    << EOF

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 

EOF


7.配置profile

cat >>    /etc/profile    << EOF

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

#############################

export PATH=\$PATH:/u01/app/11.2.0/grid/bin

#color of grep

alias grep='grep --color=auto'

EOF


8.節點1-grid

cat >> /home/grid/.bash_profile <

export TMP=/tmp;

export TMPDIR=\$TMP;

export ORACLE_HOSTNAME=rac1;

export ORACLE_SID=prod;

export ORACLE_BASE=/u01/app/grid;

export ORACLE_HOME=/u01/app/11.2.0/grid;

export NLS_DATE_FORMAT="yy-mm-dd HH24:MI:SS";

export PATH=\$ORACLE_HOME/bin:\$PATH;

export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK;

EOF


8。節點1-oracle

cat >> /home/oracle/.bash_profile <

export TMP=/tmp;

export TMPDIR=\$TMP; 

export ORACLE_HOSTNAME=rac1;

export ORACLE_BASE=/u01/app/oracle;

export ORACLE_HOME=\$ORACLE_BASE/product/11.2.0/db_1;

export ORACLE_UNQNAME=prod;

export ORACLE_SID=prod;

export ORACLE_TERM=xterm;

export PATH=/usr/sbin:\$PATH;

export PATH=\$ORACLE_HOME/bin:\$PATH;

export LD_LIBRARY_PATH=\$ORACLE_HOME/lib:/lib:/usr/lib;

export CLASSPATH=\$ORACLE_HOME/JRE:\$ORACLE_HOME/jlib:\$ORACLE_HOME/rdbms/jlib; 

export NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS";

export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK;

EOF


9.節點2-grid

cat >> /home/grid/.bash_profile <

export TMP=/tmp;

export TMPDIR=\$TMP;

export ORACLE_HOSTNAME=rac2;

export ORACLE_SID=standby;

export ORACLE_BASE=/u01/app/grid;

export ORACLE_HOME=/u01/app/11.2.0/grid;

export NLS_DATE_FORMAT="yy-mm-dd HH24:MI:SS";

export PATH=\$ORACLE_HOME/bin:\$PATH;

export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK;

EOF


9.節點2-oracle

cat >> /home/oracle/.bash_profile <

export TMP=/tmp;

export TMPDIR=\$TMP;

export ORACLE_HOSTNAME=rac2;

export ORACLE_BASE=/u01/app/oracle;

export ORACLE_HOME=\$ORACLE_BASE/product/11.2.0/db_1;

export ORACLE_UNQNAME=standby;

export ORACLE_SID=standby;

export ORACLE_TERM=xterm;

export PATH=/usr/sbin:\$PATH;

export PATH=\$ORACLE_HOME/bin:\$PATH;

export LD_LIBRARY_PATH=\$ORACLE_HOME/lib:/lib:/usr/lib; 

export CLASSPATH=\$ORACLE_HOME/JRE:\$ORACLE_HOME/jlib:\$ORACLE_HOME/rdbms/jlib; 

export NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS";

export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK;

EOF


10.時間服務-所有節點

date 

hwclock

clock --systohc


vi /etc/sysconfig/ntpd  

SYNC_HWCLOCK=yes  

OPTIONS="-x -u ntp:ntp -p /var/run/ntpd.pid"  


vi /etc/ntp/ntpservers

新增rac1ip


10.時間服務-節點1

vi /etc/ntp.conf  

restrict default kod nomodify notrap nopeer noquery  

restrict -6 default kod nomodify notrap nopeer noquery  

restrict 127.0.0.1   

restrict -6 ::1  

server  127.127.1.0     #local clock  

fudge   127.127.1.0 stratum 10  

driftfile /var/lib/ntp/drift  

keys /etc/ntp/keys  

restrict rac1ip  mask 255.255.255.255 nomodify notrap noquery  


10.時間服務-節點2

vi /etc/ntp.conf 

server rac1ip 


10.時間服務-雙節點

service ntpd stop

service ntpd start 

chkconfig ntpd on

ntpstat


11.asmlib 雙節點

oracleasm-support、oracleasm、oracleasmlib

rpm -ivh oracleasm*.rpm


12.建立

oracleasm configure -i

oracleasm init


13.分割槽

fdisk -l

fdisk /dev/sdb 注意不要預設,要打數字


12.歸屬盤

A.

oracleasm createdisk OCR_VOTE /dev/sdb1

oracleasm createdisk DATA /dev/sdc1

oracleasm createdisk FRA /dev/sdd1


oracleasm scandisks 

oracleasm listdisks


13.cvuq

export CVUQDISK_GRP=oinstall

rpm -ivh cvuqdisk-1.0.7-1.rpm 


14. 預先檢查

./runcluvfy.sh stage -post hwos -n rac1,rac2 -verbose >1.log


15.如果掃描不到,則要給磁碟加上讀寫許可權

cd /dev

chmod 777 sdb*


16.解除安裝配置失敗節點

cd /u01/app/11.2.0/grid/crs/install

 ./roothas.pl -delete -force -verbose

 /u01/app/11.2.0/grid/root.sh


oifcfg setif -global bond0/192.168.0.0:cluster_interconnect


17.驗證節點

./runcluvfy.sh  stage -post crsinst -n rac1,rac2

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/21302630/viewspace-1571507/,如需轉載,請註明出處,否則將追究法律責任。

相關文章