RAC安裝之一 安裝前準備
RAC安裝之一 安裝前準備 2011-06-20 19:57:42
版權宣告:原創作品,謝絕轉載!否則將追究法律責任。
Oracle中的RAC技術是一門很高深的藝術,RAC是real application cluster的英文縮寫,中文翻譯為真實應用叢集。oracle的叢集為多個資料庫例項對應一個資料庫,因而需要使用到共享儲存,也就是所謂的盤陣(一盤多機),在本文中使用ISCSI共享儲存實現;RAC的安裝是個繁瑣的過程,需要一定的linux或者unix系統基礎,因而筆者將會整理一個RAC在centos4.8的上安裝系列教程,本節為教程的第一講 ———— 安裝前的環境準備。
本節總的內容包括以下幾個要點:
1:安裝linux作業系統,配置IP和主機名
2:調整系統引數
3:配置共享儲存
4:配置raw裝置
5:配置ASM
環境介紹:
作業系統:Centos4.8 64位(節點)
節點1主機名:rac1.766.com
節點1IP地址:192.168.50.191/192.168.122.191
節點2主機名:rac2.766.com
節點2IP地址:192.168.50.192/192.168.122.192
一:安裝作業系統
- 1:這裡採取PXE自動方式進行push安裝,安裝所有的軟體包,可參考:http://ylw6006.blog.51cto.com/470441/587303
- 2:配置hosts檔案,兩個節點應當一致,rac1-vip所對應的ip可以不存在
- [root@rac1 ~]# cat /etc/hosts
- # Do not remove the following line, or various programs
- # that require network functionality will fail.
- 127.0.0.1 localhost.localdomain localhost
- 192.168.50.191 rac1.766.com rac1
- 192.168.122.191 rac1-priv.766.com rac1-priv
- 10.0.0.1 rac1-vip.766.com rac1-vip
- 192.168.50.192 rac2.766.com rac2
- 192.168.122.192 rac2-priv.766.com rac2-priv
- 10.0.0.2 rac2-vip.766.com rac2-vip
- 3:關閉selinux
- [root@rac1 ~]# getenforce
- Disabled
- 4:建立 Oracle 組和使用者帳戶,兩個節點的oracle使用者的uid,gid應當保持一致
- [root@rac1 ~]# groupadd oinstall
- [root@rac1 ~]# groupadd dba
- [root@rac1 ~]# useradd -g oinstall -G dba oracle
- [root@rac1 ~]# echo "oracle" |passwd --stdin oracle
- Changing password for user oracle.
- passwd: all authentication tokens updated successfully.
- [root@rac1 ~]# id oracle
- uid=500(oracle) gid=500(oinstall) groups=500(oinstall),501(dba)
二:調整系統引數
- 1:修改核心和系統引數
- [root@rac2 ~]# id oracle
- uid=500(oracle) gid=500(oinstall) groups=500(oinstall),501(dba)
- [root@rac1 ~]# cat >> /etc/sysctl.conf <<EOF
- > 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 = 262144
- > net.core.rmem_max = 262144
- > net.core.wmem_default = 262144
- > net.core.wmem_max = 262144
- > EOF
- [root@rac1 ~]# sysctl -p
- [root@rac1 ~]# cat >> /etc/security/limits.conf <<EOF
- > oracle soft nproc 2047
- > oracle hard nproc 16384
- > oracle soft nofile 1024
- > oracle hard nofile 65536
- > EOF
- [root@rac1 ~]# cat >> /etc/pam.d/login <<EOF
- > session required /lib/security/pam_limits.so
- > EOF
- [root@rac1 ~]# cat >> /etc/modprobe.conf <<EOF
- > options hangcheck-timer hangcheck_tick=30 hangcheck_margin=180
- > EOF
- [root@rac1 ~]# modprobe -v hangcheck-timer
- insmod /lib/modules/2.6.18-164.el5/kernel/drivers/char/hangcheck-timer.ko hangcheck_tick=30 hangcheck_margin=180
- 2:修改oracle使用者環境變數,節點2的ORACLE_SID變數需要改成racdb2
- [root@rac1 ~]# su - oracle
- [oracle@rac1 ~]$ cat .bash_profile
- # .bash_profile
- # Get the aliases and functions
- if [ -f ~/.bashrc ]; then
- . ~/.bashrc
- fi
- # User specific environment and startup programs
- PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin:/root/bin
- export EDITOR=vim
- export ORACLE_SID=racdb1
- export ORACLE_BASE=/u01/app/oracle
- export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
- export ORA_CRS_HOME=$ORACLE_BASE/product/10.2.0/crs_1
- export LD_LIBRARY_PATH=/lib
- alias sqlplus='/usr/local/rlwrap/bin/rlwrap sqlplus'
- alias rman='/usr/local/rlwrap/bin/rlwrap rman'
- export NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'
- export NLS_LANG=american_america.UTF8
- export PATH=$ORACLE_HOME/bin:$ORA_CRS_HOME/bin:$PATH
- umask 022
- 3:建立相關目錄
- [oracle@rac1 ~]$ mkdir -p $ORACLE_BASE/admin
- [oracle@rac1 ~]$ mkdir -p $ORACLE_HOME
- [oracle@rac1 ~]$ mkdir -p $ORA_CRS_HOME
- 4:配置oracle使用者等效性
- [oracle@rac1 ~]$ ssh-keygen -t rsa
- Generating public/private rsa key pair.
- Enter file in which to save the key (/home/oracle/.ssh/id_rsa):
- Created directory '/home/oracle/.ssh'.
- Enter passphrase (empty for no passphrase):
- Enter same passphrase again:
- Your identification has been saved in /home/oracle/.ssh/id_rsa.
- Your public key has been saved in /home/oracle/.ssh/id_rsa.pub.
- The key fingerprint is:
- 99:4c:75:0b:3a:81:11:6a:e8:71:74:9e:94:89:00:d4 oracle@rac1.766.com
- [oracle@rac1 ~]$ ssh-keygen -t dsa
- Generating public/private dsa key pair.
- Enter file in which to save the key (/home/oracle/.ssh/id_dsa):
- Enter passphrase (empty for no passphrase):
- Enter same passphrase again:
- Your identification has been saved in /home/oracle/.ssh/id_dsa.
- Your public key has been saved in /home/oracle/.ssh/id_dsa.pub.
- The key fingerprint is:
- df:f6:c0:ab:7f:84:91:af:d8:d8:e0:fd:76:77:74:f2 oracle@rac1.766.com
- [oracle@rac1 ~]$ cat .ssh/id_dsa.pub >> .ssh/authorized_keys
- [oracle@rac1 ~]$ cat .ssh/id_rsa.pub >> .ssh/authorized_keys
- [oracle@rac1 ~]$ scp /home/oracle/.ssh/authorized_keys oracle@rac2.766.com:/home/oracle/.ssh/
- 驗證:不需要密碼登入
- 在rac1節點上面分別ssh rac1;ssh rac1.766.com ; ssh rac2; ssh rac2.766.com
- 在rac2節點上面分別ssh rac1;ssh rac1.766.com ; ssh rac2; ssh rac2.766.com
三:配置共享儲存
- 伺服器IP:192.168.50.4
- 作業系統:RHEL6 64位
- 1:伺服器端,詳細配置步驟可參考http://ylw6006.blog.51cto.com/470441/580568
- [root@rhel6 ~]# lvcreate -n sharedisk -L 80G VolGroup00
- Logical volume "sharedisk" created
- [root@rhel6 ~]# yum -y install scsi-target-utils.x86_64
- [root@rhel6 ~]# service tgtd start
- [root@rhel6 ~]# service tgtd restart
- Stopping SCSI target daemon: [ OK ]
- Starting SCSI target daemon: [ OK ]
- [root@rhel6 ~]# chkconfig --add tgtdrules
- [root@rhel6 ~]# service tgtdrules start
- Starting Tgtdrules Server:
- [root@rhel6 ~]# service tgtdrules status
- Target 1: iqn.2011-06-01.com.766.rac:shareddisk
- System information:
- Driver: iscsi
- State: ready
- I_T nexus information:
- LUN information:
- LUN: 0
- Type: controller
- SCSI ID: IET 00010000
- SCSI SN: beaf10
- Size: 0 MB
- Online: Yes
- Removable media: No
- Backing store type: rdwr
- Backing store path: None
- LUN: 1
- Type: disk
- SCSI ID: IET 00010001
- SCSI SN: beaf11
- Size: 85899 MB
- Online: Yes
- Removable media: No
- Backing store type: rdwr
- Backing store path: /dev/VolGroup00/sharedisk
- Account information:
- ACL information:
- 192.168.50.191
- 192.168.50.192
- 2:配置共享儲存客戶端,centos4和rhel5以及rhel6的配置略微有點不同
- [root@rac1 ~]# wget ftp://ftp.is.co.za/mirror/centos/4.8/os/x86_64/CentOS/RPMS/iscsi-initiator-utils-4.0.3.0-8.x86_64.rpm
- [root@rac1 ~]# rpm -ivh iscsi-initiator-utils-4.0.3.0-8.x86_64.rpm
- warning: iscsi-initiator-utils-4.0.3.0-8.x86_64.rpm: V3 DSA signature: NOKEY, key ID 443e1821
- Preparing... ########################################### [100%]
- 1:iscsi-initiator-utils ########################################### [100%]
- [root@rac1 ~]# grep -v '^#' /etc/iscsi.conf |grep -v '^$'
- DiscoveryAddress=192.168.50.4
- TargetName=iqn.2011-06-01.com.766.rac:shareddisk
- Enabled=yes
- [root@rac1 ~]# service iscsi start
- Checking iscsi config: [ OK ]
- Loading iscsi driver: [ OK ]
- Starting iscsid: [ OK ]
- [root@rac1 ~]# iscsi-ls
- *******************************************************************************
- SFNet iSCSI Driver Version ...4:0.1.11-7(14-Apr-2008)
- *******************************************************************************
- TARGET NAME : iqn.2011-06-01.com.766.rac:shareddisk
- TARGET ALIAS :
- HOST ID : 0
- BUS ID : 0
- TARGET ID : 0
- TARGET ADDRESS : 192.168.50.4:3260,1
- SESSION STATUS : ESTABLISHED AT Sun Jun 19 07:23:36 CST 2011
- SESSION ID : ISID 00023d000001 TSIH 100
- *******************************************************************************
- [root@rac1 ~]# fdisk -l
- Disk /dev/sda: 85.8 GB, 85899345920 bytes
- 255 heads, 63 sectors/track, 10443 cylinders
- Units = cylinders of 16065 * 512 = 8225280 bytes
- Disk /dev/sda doesn't contain a valid partition table
四:配置raw裝置
- 1:將共享儲存/dev/sda分成8個分割槽,前5個分割槽sda5-9分別為2G,sda10-12分別為20G
- [root@rac1 ~]# fdisk -l
- Disk /dev/sda: 85.8 GB, 85899345920 bytes
- 255 heads, 63 sectors/track, 10443 cylinders
- Units = cylinders of 16065 * 512 = 8225280 bytes
- Device Boot Start End Blocks Id System
- /dev/sda1 1 10443 83883366 5 Extended
- /dev/sda5 1 244 1959867 83 Linux
- /dev/sda6 245 488 1959898+ 83 Linux
- /dev/sda7 489 732 1959898+ 83 Linux
- /dev/sda8 733 976 1959898+ 83 Linux
- /dev/sda9 977 1220 1959898+ 83 Linux
- /dev/sda10 1221 3653 19543041 83 Linux
- /dev/sda11 3654 6086 19543041 83 Linux
- /dev/sda12 6087 8519 19543041 83 Linux
- [root@rac1 ~]#
- 2:將sda5-9繫結為裸裝置,節點2上需要做相同的配置
- [root@rac1 ~]# cat /etc/sysconfig/rawdevices
- # This file and interface are deprecated.
- # Applications needing raw device access should open regular
- # block devices with O_DIRECT.
- # raw device bindings
- # format: <rawdev> <major> <minor>
- # <rawdev> <blockdev>
- # example: /dev/raw/raw1 /dev/sda1
- # /dev/raw/raw2 8 5
- /dev/raw/raw5 /dev/sda5
- /dev/raw/raw6 /dev/sda6
- /dev/raw/raw7 /dev/sda7
- /dev/raw/raw8 /dev/sda8
- /dev/raw/raw9 /dev/sda9
- [root@rac1 ~]# service rawdevices restart
- [root@rac1 ~]# raw -qa
- /dev/raw/raw5: bound to major 8, minor 5
- /dev/raw/raw6: bound to major 8, minor 6
- /dev/raw/raw7: bound to major 8, minor 7
- /dev/raw/raw8: bound to major 8, minor 8
- /dev/raw/raw9: bound to major 8, minor 9
- [root@rac1 ~]# ll /dev/raw/raw*
- crw-rw---- 1 oracle oinstall 162, 5 Jun 19 08:10 /dev/raw/raw5
- crw-rw---- 1 oracle oinstall 162, 6 Jun 19 08:10 /dev/raw/raw6
- crw-rw---- 1 oracle oinstall 162, 7 Jun 19 08:10 /dev/raw/raw7
- crw-rw---- 1 oracle oinstall 162, 8 Jun 19 08:10 /dev/raw/raw8
- crw-rw---- 1 oracle oinstall 162, 9 Jun 19 08:10 /dev/raw/raw9
- [root@rac1 ~]# chkconfig rawdevices on
五:配置ASM
- 1:從oracle網站下載並安裝相應的包,節點2上需要做相同的配置
- [root@rac1 ~]# cat down.txt
- http://oss.oracle.com/projects/oracleasm-support/dist/files/RPMS/rhel4/amd64/2.1.3/oracleasm-support-2.1.3-1.el4.x86_64.rpm
- http://download.oracle.com/otn_software/asmlib/oracleasmlib-2.0.4-1.el4.x86_64.rpm
- http://oss.oracle.com/projects/oracleasm/dist/files/RPMS/rhel4/amd64/2.0.5/2.6.9-89.EL/oracleasm-2.6.9-89.EL-debuginfo-2.0.5-1.el4.x86_64.rpm
- http://oss.oracle.com/projects/oracleasm/dist/files/RPMS/rhel4/amd64/2.0.5/2.6.9-89.EL/oracleasm-2.6.9-89.EL-2.0.5-1.el4.x86_64.rpm
- [root@rac1 ~]# wget -i down.txt
- [root@rac1 ~]# rpm -ivh *.rpm
- warning: oracleasm-2.6.9-89.EL-2.0.5-1.el4.x86_64.rpm: V3 DSA signature: NOKEY, key ID b38a8516
- Preparing... ########################################### [100%]
- 1:oracleasm-support ########################################### [ 25%]
- 2:oracleasm-2.6.9-89.EL ########################################### [ 50%]
- 3:oracleasm-2.6.9-89.EL-d########################################### [ 75%]
- 4:oracleasmlib ########################################### [100%]
- 2:配置asm,節點2上需要做相同的配置
- [root@rac1 ~]# /etc/init.d/oracleasm configure
- Configuring the Oracle ASM library driver.
- This will configure the on-boot properties of the Oracle ASM library
- driver. The following questions will determine whether the driver is
- loaded on boot and what permissions it will have. The current values
- will be shown in brackets ('[]'). Hitting <ENTER> without typing an
- answer will keep that current value. Ctrl-C will abort.
- Default user to own the driver interface []: oracle
- Default group to own the driver interface []: oinstall
- Start Oracle ASM library driver on boot (y/n) [n]: y
- Scan for Oracle ASM disks on boot (y/n) [y]: y
- Writing Oracle ASM library driver configuration: done
- Initializing the Oracle ASMLib driver: [ OK ]
- Scanning the system for Oracle ASMLib disks: [ OK ]
- 3:建立ASM磁碟
- [root@rac1 ~]# /etc/init.d/oracleasm createdisk VOL1 /dev/sda10
- Marking disk "VOL1" as an ASM disk: [ OK ]
- [root@rac1 ~]# /etc/init.d/oracleasm createdisk VOL2 /dev/sda11
- Marking disk "VOL2" as an ASM disk: [ OK ]
- [root@rac1 ~]# /etc/init.d/oracleasm createdisk VOL3 /dev/sda12
- Marking disk "VOL3" as an ASM disk: [ OK ]
- [root@rac1 ~]# /etc/init.d/oracleasm listdisks
- VOL1
- VOL2
- VOL3
- 3:在節點2上應該可以看到同樣的結果
- [root@rac2 ~]# /etc/init.d/oracleasm enable
- Writing Oracle ASM library driver configuration: done
- Initializing the Oracle ASMLib driver: [ OK ]
- Scanning the system for Oracle ASMLib disks: [ OK ]
- [root@rac2 ~]# /etc/init.d/oracleasm listdisks
- VOL1
- VOL2
- VOL3
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/15187685/viewspace-741101/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle 11g RAC 安裝前準備指令碼Oracle指令碼
- Oracle 11G RAC叢集安裝(1)——安裝前的準備Oracle
- mysql01_安裝前準備MySql
- Openfire安裝準備-MySQL資料庫準備MySql資料庫
- MySQL Galera Cluster全解析 Part 4 Galera Cluster 安裝前準備MySql
- rac靜默安裝
- SharePoint 2019 離線安裝準備工具
- MySQL全面瓦解:安裝部署與準備MySql
- MySQL安裝之一_安裝配置順利版MySql
- 2節點RAC安裝
- 安裝RAC 19C
- CentOS 7.6 安裝11.2.0.4 RACCentOS
- DKHadoop安裝的環境準備介紹Hadoop
- RAC安裝【AIX 7 + 11.2.0.4 + ASM】AIASM
- Python準備環境,Linux、Anaconda3安裝PythonLinux
- laradock 安裝備註
- Windows 11.2.0.4 RAC安裝配置以及RAC新增節點Windows
- oracle rac資料庫的安裝Oracle資料庫
- vgant 安裝oracle資料庫racOracle資料庫
- centos7 安裝ORACLE 11.2.0.4.0 RACCentOSOracle
- Solaris下Oracle RAC 11.2.0.4 安裝方法Oracle
- Oracle 11G RAC叢集安裝(2)——安裝gridOracle
- Oracle 11G RAC叢集安裝(3)——安裝OracleOracle
- rhel7 安裝11g rac
- Oracle RAC叢集解除安裝步驟Oracle
- Linux下Oracle 11.2.0.1 RAC安裝筆記LinuxOracle筆記
- RAC之資料庫軟體安裝資料庫
- 基於Linux的oracle 12cR2 RAC 標準化安裝(一)LinuxOracle
- 基於Linux的oracle 12cR2 RAC 標準化安裝(二)LinuxOracle
- 基於Linux的oracle 12cR2 RAC 標準化安裝(三)LinuxOracle
- 基於Linux的oracle 12cR2 RAC 標準化安裝(四)LinuxOracle
- Oracle for Windows安裝和配置之一OracleWindows
- springBoot部署阿里雲之一(安裝JDK)Spring Boot阿里JDK
- Linux安裝MySQL標準教程LinuxMySql
- 安裝npm 解除安裝npm 安裝apidocNPMAPI
- 安裝rac時需要注意的問題
- redhat7.6安裝Oracle11G RACRedhatOracle
- requirements.txt 快速備份與安裝專案所需安裝包UIREM
- 【Elasticsearch系列之一】windows下Elasticsearch的安裝ElasticsearchWindows