10gRAC安裝-系統配置
環境說明
本次安裝過程是在vmware workstation 9的基礎上虛擬2臺主機做的RAC測試
作業系統 RHEL5.7 32位
資料庫 10.2.0.1
CRS 10.2.0.1
作業系統的配置
虛擬機器配置
記憶體2G
磁碟60G
兩塊網路卡,一塊NET,一塊hostonly
IP分配,NET 192.168.152.10 255.255.255.0
hostonly 192.168.40.10 255.255.255.0
系統安裝
本地磁碟劃分
/boot 200M
/swap 4096M #該空間為記憶體空間的2倍
其餘磁碟使用lvm管理,vgname is rootvg
/ 10240M
/s01 剩餘全部磁碟空間
網路規劃
節點1
public ip 192.168.152.11/255.255.255.0
private ip 192.168.40.11/255.255.255.0
vip 192.168.152.13
節點2
public ip 192.168.152.12/255.255.255.0
private ip 192.168.40.12/255.255.255.0
vip 192.168.152.14
關閉不需要的服務
chkconfig sendmail off
chkconfig cups off
chkconfig isdn off
chkconfig smartd off
chkconfig iptables off
安裝虛擬機器的vmware-tools工具,確保虛擬機器時間與主機時間同步
./vmware-install.pl
然後一直回車,即可
檢查並安裝RAC所需的系統包
1)配置本地yum
mkdir -p /mnt/cdrom
mount /dev/hdc /mnt/cdrom
cd /etc/yum.repos.d/
vi rhel-debuginfo.repo
將baseurl修改為如下形式
baseurl=file:///mnt/cdrom/Server
enabled=1
儲存,yum配置完成
2)檢查以下系統包,如果沒有使用yum安裝。
使用rpm -q 包名 來檢查系統包是否安裝,使用yum install 包名,來安裝所需的系統包
binutils-2.17.50.0.6
compat-libstdc++-33-3.2.3
elfutils-libelf-0.125
elfutils-libelf-devel-0.125
elfutils-libelf-devel-static-0.125
gcc-4.1.2
gcc-c++-4.1.2
glibc-2.5-24
glibc-common-2.5
glibc-devel-2.5
glibc-headers-2.5
kernel-headers-2.6.18
ksh-20060214
libaio-0.3.106
libaio-devel-0.3.106
libgcc-4.1.2
libgomp-4.1.2
libstdc++-4.1.2
libstdc++-devel-4.1.2
make-3.81
sysstat-7.0.2
ibgomp-4.1.1-52.el5.i386.rpm
libXp-1.0.0-8.i386.rpm
compat-gcc-34-3.4.6-4.i386rpm
compat-gcc-c++-34-3.4.6-4.i386rpm
compat-libstdc++-33-3.2.3-61.i386.rpm
unixODBC-2.2.11 (32-bit) or later
unixODBC-devel-2.2.11 (32-bit) or later
注意ibgomp和compat-gcc-c++-34沒有安裝包
建立相關的使用者和組
[root@rac1 ~]# /usr/sbin/groupadd oinstall
[root@rac1 ~]# /usr/sbin/groupadd dba
[root@rac1 ~]# /usr/sbin/useradd -g oinstall -G dba oracle
[root@rac1 ~]#
[root@rac1 ~]# id oracle
uid=500(oracle) gid=500(oinstall) groups=500(oinstall),501(dba)
配置共享儲存
1)建立共享磁碟
使用vmware-vdiskmanager.exe 命令來建立共享磁碟
C:\Program Files (x86)\VMware\VMware Workstation>vmware-vdiskmanager.exe -c -s 600M -a lsilogic -t 2 F:\vmhome\sharedisk
\ocr.vmdk
C:\Program Files (x86)\VMware\VMware Workstation>vmware-vdiskmanager.exe -c -s 600M -a lsilogic -t 2 F:\vmhome\sharedisk
\votedisk.vmdk
C:\Program Files (x86)\VMware\VMware Workstation>vmware-vdiskmanager.exe -c -s 8192M -a lsilogic -t 2 F:\vmhome\sharedis
k\data1.vmdk
C:\Program Files (x86)\VMware\VMware Workstation>vmware-vdiskmanager.exe -c -s 8192M -a lsilogic -t 2 F:\vmhome\sharedis
k\data2.vmdk
C:\Program Files (x86)\VMware\VMware Workstation>vmware-vdiskmanager.exe -c -s 8192M -a lsilogic -t 2 F:\vmhome\sharedis
k\data3.vmdk
C:\Program Files (x86)\VMware\VMware Workstation>vmware-vdiskmanager.exe -c -s 8192M -a lsilogic -t 2 F:\vmhome\sharedis
k\data4.vmdk
2)到虛擬機器的相關路徑目錄,開啟rac1.vmx , 在最後空白處新增這幾段內容(一定要最後)
scsi1.present = "TRUE"
scsi1.virtualDev = "lsilogic"
scsi1.sharedBus = "virtual"
-- 這段是開啟 scsi1上的使用,並且設定成virtual, controller設定成lsilogic, 然後依次新增
scsi1:1.present = "TRUE"
scsi1:1.mode = "independent-persistent"
scsi1:1.filename = "F:\vmhome\sharedisk\ocr.vmdk"
scsi1:1.deviceType = "plainDisk"
scsi1:2.present = "TRUE"
scsi1:2.mode = "independent-persistent"
scsi1:2.filename = "F:\vmhome\sharedisk\votedisk.vmdk"
scsi1:2.deviceType = "plainDisk"
scsi1:3.present = "TRUE"
scsi1:3.mode = "independent-persistent"
scsi1:3.filename = "F:\vmhome\sharedisk\data1.vmdk"
scsi1:3.deviceType = "plainDisk"
scsi1:4.present = "TRUE"
scsi1:4.mode = "independent-persistent"
scsi1:4.filename = "F:\vmhome\sharedisk\data2.vmdk"
scsi1:4.deviceType = "plainDisk"
scsi1:5.present = "TRUE"
scsi1:5.mode = "independent-persistent"
scsi1:5.filename = "F:\vmhome\sharedisk\data3.vmdk"
scsi1:5.deviceType = "plainDisk"
scsi1:6.present = "TRUE"
scsi1:6.mode = "independent-persistent"
scsi1:6.filename = "F:\vmhome\sharedisk\data4.vmdk"
scsi1:6.deviceType = "plainDisk"
--最後新增這個,這段是對vmware使用共享硬碟的方式進行定義,必須新增
disk.locking = "false"
diskLib.dataCacheMaxSize = "0"
diskLib.dataCacheMaxReadAheadSize = "0"
diskLib.DataCacheMinReadAheadSize = "0"
diskLib.dataCachePageSize = "4096"
diskLib.maxUnsyncedWrites = "0"
3)使用udev繫結共享儲存
[root@rac1 ~]# fdisk -l
Disk /dev/sda: 64.4 GB, 64424509440 bytes
255 heads, 63 sectors/track, 7832 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 25 200781 83 Linux
/dev/sda2 26 547 4192965 82 Linux swap / Solaris
/dev/sda3 548 7832 58516762+ 8e Linux LVM
Disk /dev/sdb: 629 MB, 629145600 bytes
64 heads, 32 sectors/track, 600 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Disk /dev/sdb doesn't contain a valid partition table
Disk /dev/sdc: 629 MB, 629145600 bytes
64 heads, 32 sectors/track, 600 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Disk /dev/sdc doesn't contain a valid partition table
Disk /dev/sdd: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdd doesn't contain a valid partition table
Disk /dev/sde: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sde doesn't contain a valid partition table
Disk /dev/sdf: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdf doesn't contain a valid partition table
Disk /dev/sdg: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdg doesn't contain a valid partition table
指令碼
for i in b c d e f g;
do
echo "KERNEL==\"sd*\", BUS==\"scsi\", PROGRAM==\"/sbin/scsi_id -g -u -s %p\", RESULT==\"`scsi_id -g -u -s /block/sd$i`\", NAME=\"asm-disk$i\", OWNER=\"oracle\", GROUP=\"oinstall\", MODE=\"0660\""
done
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s %p", RESULT=="36000c2963e5b57f8d31423979046356e", NAME="asm-diskb", OWNER="oracle", GROUP="oinstall", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s %p", RESULT=="36000c2977bd806fafbe4c9dbd79e7e03", NAME="asm-diskc", OWNER="oracle", GROUP="oinstall", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s %p", RESULT=="36000c2965b85a7a1b6f59eef8d33c563", NAME="asm-diskd", OWNER="oracle", GROUP="oinstall", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s %p", RESULT=="36000c29ee9b530b8d8c04d8681eacde5", NAME="asm-diske", OWNER="oracle", GROUP="oinstall", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s %p", RESULT=="36000c29811db03c1042d8633bd69bac4", NAME="asm-diskf", OWNER="oracle", GROUP="oinstall", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s %p", RESULT=="36000c290cdb14a47be59f9b9a1250db2", NAME="asm-diskg", OWNER="oracle", GROUP="oinstall", MODE="0660"
[root@rac1 ~]# cd /etc/udev/rules.d/
[root@rac1 rules.d]# vi 99-oracle-asmdisk.rules
將指令碼輸出結果拷貝進去
重啟udev
[root@rac1 rules.d]# /sbin/udevcontrol reload_rules
[root@rac1 rules.d]# /sbin/start_udev
Starting udev: [ OK ]
檢查
[root@rac1 rules.d]# ls -l /dev/asm*
brw-rw---- 1 oracle oinstall 8, 16 Feb 17 15:52 /dev/asm-diskb
brw-rw---- 1 oracle oinstall 8, 32 Feb 17 15:52 /dev/asm-diskc
brw-rw---- 1 oracle oinstall 8, 48 Feb 17 15:52 /dev/asm-diskd
brw-rw---- 1 oracle oinstall 8, 64 Feb 17 15:52 /dev/asm-diske
brw-rw---- 1 oracle oinstall 8, 80 Feb 17 15:52 /dev/asm-diskf
brw-rw---- 1 oracle oinstall 8, 96 Feb 17 15:52 /dev/asm-diskg
設定時間同步
[root@rac1 ~]# chkconfig time-stream on
在rac2節點新增時鐘同步
[root@rac2 ~]# crontab -l
*/1 * * * * rdate -s 192.168.152.11
修改/etc/hosts檔案
127.0.0.1 localhost
#public ip
192.168.152.11 rac1
192.168.152.12 rac2
#private ip
192.168.40.11 rac1-priv
192.168.40.12 rac2-priv
#vip
192.168.152.13 rac1-vip
192.168.152.14 rac2-vip
配置 hangcheck-timer 模組,2個節點都要執行
Hangcheck-timer 是Linux 提供的一個核心級的IO-Fencing 模組, 這個模組會監控Linux 核心執行狀態, 如
果長時間掛起, 這個模組會自動重啟系統。 這個模組在Linux 核心空間執行, 不會受系統負載的影響。 這個模組會
使用CPU的Time Stamp Counter(TSC) 暫存器,這個暫存器的值會在每個時鐘週期自動增加, 因此使用的是硬體時間
,所以精度更高。
配置這個模組需要2個引數: hangcheck_tick 和 hangcheck_margin。
hangcheck_tick用於定義多長時間檢查一次,預設值是30秒。 有可能核心本身很忙, 導致這個檢查被推遲, 該
模組還允許定義一個延遲上限,就是hangcheck_margin, 它的預設值是180秒。
Hangcheck-timer 模組會根據hangcheck_tick 的設定,定時檢查核心。只要2次檢查的時間間隔小於 hangcheck
_tick + hangchec_margin, 都會認為核心執行正常,否則就意味著執行異常,這個模組會自動重啟系統。
CRS本身還有一個MissCount 引數,可以通過crsctl get css miscount 命令檢視。
當RAC結點間的心跳資訊丟失時, Clusterware 必須確保在進行重構時,故障結點確實是Dead 狀態,否則結點僅
是臨時負載過高導致心跳丟失,然後其他結點開始重構,但是結點沒有重啟,這樣會損壞資料庫。 因此MissCount 必須
大於 hangcheck_tick+hangcheck_margin的和。
1) 檢視模組位置:
[root@rac1 ~]# find /lib/modules -name "hangcheck-timer.ko"
/lib/modules/2.6.18-274.el5/kernel/drivers/char/hangcheck-timer.ko
2) 配置系統啟動時自動載入模組,在/etc/rc.d/rc.local 中新增如下內容
[root@rac1 ~]# modprobe hangcheck-timer
[root@rac1 ~]# vi /etc/rc.d/rc.local
modprobe hangcheck-timer
3) 配置hangcheck-timer引數, 在/etc/modprobe.conf 中新增如下內容:
[root@rac1 ~]# vi /etc/modprobe.conf
options hangcheck-timer hangcheck_tick=30 hangcheck_margin=180
4) 確認模組載入成功:
[root@rac1 ~]# grep Hangcheck /var/log/messages | tail -2
Feb 17 15:00:00 rac1 kernel: Hangcheck: starting hangcheck timer 0.9.0 (tick is 180 seconds, margin is 60 seconds).
Feb 17 15:00:00 rac1 kernel: Hangcheck: Using get_cycles().
建立使用者的有效性
Rac1:
mkdir ~/.ssh
chmod 700 ~/.ssh
ssh-keygen -t rsa
ssh-keygen -t dsa
Rac2:
mkdir ~/.ssh
chmod 700 ~/.ssh
ssh-keygen -t rsa
ssh-keygen -t dsa
Rac1:
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
scp ~/.ssh/authorized_keys rac2:~/.ssh/authorized_keys
Rac2:
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
scp ~/.ssh/authorized_keys rac1:~/.ssh/authorized_keys
等效性驗證
date;ssh rac1 date
配置系統引數
vi /etc/sysctl.conf
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144
vi /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
vi /etc/pam.d/login
session required /lib/security/pam_limits.so
session required pam_limits.so
vi /etc/profile
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
建立相關安裝路徑
[root@rac2 ~]# mkdir -p /s01/app/oracle
[root@rac2 ~]# mkdir -p /s01/crs
[root@rac2 ~]# chown -R oracle:oinstall /s01
配置環境變數
export ORACLE_BASE=/s01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export CRS_HOME=/s01/crs
export ORACLE_SID=rac1
export PATH=$ORACLE_HOME/bin:$CRS_HOME/bin:$PATH
export ORACLE_TERM=xterm
export TNS_ADMIN=$ORACLE_HOME/network/admin
export ORA_NLS10=$ORACLE_HOME/nls/data
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
export CLASSPATH=$ORACLE_HOME/JRE
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib
export THREADS_FLAG=native
export TEMP=/tmp
export TMPDIR=/tmp
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/11590946/viewspace-1082695/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Linux上安裝配置GFS檔案系統的10gRACLinux
- CentOS 6.5系統安裝配置CentOS
- powerlinux下安裝10grac(四)Linux
- powerlinux下安裝10grac(一)Linux
- powerlinux下安裝10grac(三)Linux
- CentOS 6 安裝MAVEN及系統配置CentOSMaven
- 安裝Centos6.7的系統配置CentOS
- 安裝win10系統的配置要求是什麼 win10系統安裝最低配置要求Win10
- ubuntu系統samba服務的安裝配置UbuntuSamba
- Linux系統Tomcat安裝與配置。LinuxTomcat
- Ubuntu系統-FFmpeg安裝及環境配置Ubuntu
- zabbix監控系統的安裝與配置
- Zabbix-2.4.3監控系統安裝配置
- windows系統下GCC的安裝與配置WindowsGC
- 分散式檔案系統(FastDFS)安裝 配置分散式AST
- VMware 中解除安裝安裝Ubuntu 20.04.1 ——Ubuntu系統配置(一)Ubuntu
- Linux系統下安裝配置 OpenLDAP + phpLDAPadminLinuxLDAPHP
- Nexus windows安裝,配置為系統服務Windows
- Oracle研究專題:Oracle系統安裝與配置Oracle
- Twitter Storm安裝配置(Ubuntu系統)單機版ORMUbuntu
- HP MC/SG雙機系統安裝和配置
- MC/SG雙機系統安裝和配置[轉]
- 系統安裝
- Win10系統怎麼安裝和配置MongoDBWin10MongoDB
- 天兔(Lepus)監控作業系統(OS)安裝配置作業系統
- linux系統安裝jdk,配置環境變數LinuxJDK變數
- window系統jdk安裝與環境變數配置JDK變數
- Seay原始碼審計系統的配置和安裝原始碼
- Qmail系統的安裝、簡單配置及使用(轉)AI
- Linux系統安裝01-centos7系統安裝LinuxCentOS
- CentOS 7.3怎麼安裝?CentOS 7.3.1611系統安裝配置圖文教程CentOS
- 10gRAC 安裝遇到Invalid node name "RACTEST1” entered
- 安裝clearos系統ROS
- 安裝 MAC 系統Mac
- [轉]在Mac系統中安裝配置Tomcat及和Eclipse 配置MacTomcatEclipse
- CentOS7.5安裝PostgreSQL作業系統配置指令碼CentOSSQL作業系統指令碼
- CentOS 7.0系統安裝配置圖解教程——我是新手CentOS圖解
- Ubuntu 20.04.1 安裝軟體和系統配置指令碼Ubuntu指令碼