Oracle 12cR1 RAC 在VMware Workstation上安裝(上)—OS環境配置
轉載:http://blog.itpub.net/26736162/viewspace-2132768/
1.1 整體規劃部分
1.1.1 所需軟體介紹
Oracle RAC不支援異構平臺。在同一個叢集中,可以支援具有速度和規模不同的機器,但所有節點必須執行在相同的作業系統。Oracle RAC不支援具有不同的晶片架構的機器。
序號 |
型別 |
內容 |
1 |
資料庫 |
p17694377_121020_Linux-x86-64_1of8.zip p17694377_121020_Linux-x86-64_2of8.zip |
2 |
叢集軟體 |
p17694377_121020_Linux-x86-64_3of8.zip p17694377_121020_Linux-x86-64_4of8.zip |
3 |
作業系統 |
RHEL 6.5 2.6.32-431.el6.x86_64 硬體相容性:workstation 9.0 |
4 |
虛擬機器軟體 |
VMware Workstation 12 Pro 12.5.2 build-4638234 |
5 |
Xmanager Enterprise 4 |
Xmanager Enterprise 4,用於開啟圖形介面 |
6 |
rlwrap-0.36 |
rlwrap-0.36,用於記錄sqlplus、rman等命令的歷史記錄 |
7 |
SecureCRTPortable.exe |
Version 7.0.0 (build 326),帶有SecureCRT和SecureFX,用於SSH連線 |
注:這些軟體小麥苗已上傳到騰訊微雲(http://blog.itpub.net/26736162/viewspace-1624453/
1.1.2 IP地址規劃
從Oracle 11g開始,共7個IP地址,2塊網絡卡,其中public、vip和scan都在同一個網段,private在另一個網段,主機名不要包含下橫線,如:RAC_01是不允許的;通過執行ifconfig -a檢查2個節點的網路裝置名字是否一致。另外,在安裝之前,公網、私網共4個IP可以ping通,其它3個不能ping通才是正常的。
節點/主機名 |
Interface Name |
地址型別 |
IP Address |
註冊位置 |
raclhr-12cR1-N1 |
raclhr-12cR1-N1 |
Public |
192.168.59.160 |
/etc/hosts |
raclhr-12cR1-N1 |
raclhr-12cR1-N1-vip |
Virtual |
192.168.59.162 |
/etc/hosts |
raclhr-12cR1-N1 |
raclhr-12cR1-N1-priv |
Private |
192.168.2.100 |
/etc/hosts |
raclhr-12cR1-N2 |
raclhr-12cR1-N2 |
Public |
192.168.59.161 |
/etc/hosts |
raclhr-12cR1-N2 |
raclhr-12cR1-N2-vip |
Virtual |
192.168.59.163 |
/etc/hosts |
raclhr-12cR1-N2 |
raclhr-12cR1-N2-priv |
Private |
192.168.2.101 |
/etc/hosts |
|
raclhr-12cR1-scan |
SCAN |
192.168.59.164 |
/etc/hosts |
1.1.3 作業系統本地磁碟分割槽規劃
除了/boot分割槽外,其它分割槽均採用邏輯卷的方式,這樣有利於檔案系統的擴充套件。
序號 |
分割槽名稱 |
大小 |
邏輯卷 |
用途說明 |
1 |
/boot |
200MB |
/dev/sda1 |
引導分割槽 |
2 |
/ |
10G |
/dev/mapper/vg_rootlhr-Vol00 |
根分割槽 |
3 |
swap |
2G |
/dev/mapper/vg_rootlhr-Vol02 |
交換分割槽 |
4 |
/tmp |
3G |
/dev/mapper/vg_rootlhr-Vol01 |
臨時空間 |
5 |
/home |
3G |
/dev/mapper/vg_rootlhr-Vol03 |
所有使用者的home目錄 |
6 |
/u01 |
20G |
/dev/mapper/vg_orasoft-lv_orasoft_u01 |
oracle和grid的安裝目錄 |
[[email protected] ~]# fdisk -l | grep dev Disk /dev/sda: 21.5 GB, 21474836480 bytes /dev/sda1 * 1 26 204800 83 Linux /dev/sda2 26 1332 10485760 8e Linux LVM /dev/sda3 1332 2611 10279936 8e Linux LVM Disk /dev/sdb: 107.4 GB, 107374182400 bytes /dev/sdb1 1 1306 10485760 8e Linux LVM /dev/sdb2 1306 2611 10485760 8e Linux LVM /dev/sdb3 2611 3917 10485760 8e Linux LVM /dev/sdb4 3917 13055 73399296 5 Extended /dev/sdb5 3917 5222 10485760 8e Linux LVM /dev/sdb6 5223 6528 10485760 8e Linux LVM /dev/sdb7 6528 7834 10485760 8e Linux LVM /dev/sdb8 7834 9139 10485760 8e Linux LVM /dev/sdb9 9139 10445 10485760 8e Linux LVM /dev/sdb10 10445 11750 10485760 8e Linux LVM /dev/sdb11 11750 13055 10477568 8e Linux LVM
|
1.1.4 共享儲存與ASM磁碟組規劃
序號 |
磁碟名稱 |
ASM磁碟名稱 |
磁碟組名稱 |
大小 |
用途 |
1 |
sdc1 |
asm-diskc |
OCR |
6G |
OCR+VOTINGDISK |
2 |
sdd1 |
asm_diskd |
DATA |
10G |
data |
3 |
sde1 |
asm_diske |
FRA |
10G |
快速恢復區 |
注意,12c R1的OCR磁碟組最少需要5501MB磁碟空間。
1.2 作業系統配置部分
1.2.1 安裝主機或虛擬機器
安裝步驟略。安裝一臺虛擬機器,然後複製改名,如下:
也可以下載小麥苗已經安裝好的虛擬機器環境。
1.2.2 修改主機名
修改2個節點的主機名為raclhr-12cR1-N1和raclhr-12cR1-N2:
vi /etc/sysconfig/network HOSTNAME=raclhr-12cR1-N1 hostname raclhr-12cR1-N1
|
1.2.3 網路配置
1.2.3.1 新增虛擬網絡卡
新增2塊網絡卡,VMnet8為公有網絡卡,VMnet2位私有網絡卡,如下所示:
1.2.3.2 配置IP地址
chkconfig NetworkManager off chkconfig network on service NetworkManager stop service network start |
在2個節點上分別執行如下的操作,在節點2上配置IP的時候注意將IP地址修改掉。
第一步,配置公網和私網的IP地址:
配置公網:vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0 IPADDR=192.168.59.160 NETMASK=255.255.255.0 NETWORK=192.168.59.0 BROADCAST=192.168.59.255 GATEWAY=192.168.59.2 ONBOOT=yes USERCTL=no BOOTPROTO=static TYPE=Ethernet IPV6INIT=no |
配置私網:vi /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1 IPADDR=192.168.2.100 NETMASK=255.255.255.0 NETWORK=192.168.2.0 BROADCAST=192.168.2.255 GATEWAY=192.168.2.1 ONBOOT=yes USERCTL=no BOOTPROTO=static TYPE=Ethernet IPV6INIT=no |
第二步,將/etc/udev/rules.d/70-persistent-net.rules中的內容清空,
第三步,重啟主機。
[[email protected] ~]# ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000 link/ether 00:0c:29:d9:43:a7 brd ff:ff:ff:ff:ff:ff inet 192.168.59.160/24 brd 192.168.59.255 scope global eth0 inet6 fe80::20c:29ff:fed9:43a7/64 scope link valid_lft forever preferred_lft forever 3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000 link/ether 00:0c:29:d9:43:b1 brd ff:ff:ff:ff:ff:ff inet 192.168.2.100/24 brd 192.168.2.255 scope global eth1 inet6 fe80::20c:29ff:fed9:43b1/64 scope link valid_lft forever preferred_lft forever 4: virbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN link/ether 52:54:00:68:da:bb brd ff:ff:ff:ff:ff:ff inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0 5: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 500 link/ether 52:54:00:68:da:bb brd ff:ff:ff:ff:ff:ff
|
1.2.3.3 關閉防火牆
在2個節點上分別執行如下語句:
service iptables stop service ip6tables stop chkconfig iptables off chkconfig ip6tables off
chkconfig iptables --list |
chkconfig iptables off ---永久
service iptables stop ---臨時
/etc/init.d/iptables status ----會得到一系列資訊,說明防火牆開著。
/etc/rc.d/init.d/iptables stop ----------關閉防火牆
LANG=en_US setup ----------圖形介面 |
1.2.3.4 禁用selinux
修改/etc/selinux/config
編輯文字中的SELINUX=enforcing為SELINUX=disabled
[[email protected] ~]# more /etc/selinux/config
# This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. SELINUX=disabled # SELINUXTYPE= can take one of these two values: # targeted - Targeted processes are protected, # mls - Multi Level Security protection. SELINUXTYPE=targeted [[email protected] ~]# 臨時關閉(不用重啟機器): setenforce 0
|
檢視SELinux狀態:
1、/usr/sbin/sestatus -v ##如果SELinux status引數為enabled即為開啟狀態
SELinux status: enabled
2、getenforce ##也可以用這個命令檢查
[[email protected] ~] /usr/sbin/sestatus -v SELinux status: disabled [[email protected] ~] getenforce Disabled
|
1.2.3.5 修改/etc/hosts檔案
2個節點均配置相同,如下:
[[email protected] ~]# more /etc/hosts # Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
#Public IP 192.168.59.160 raclhr-12cR1-N1 192.168.59.161 raclhr-12cR1-N2
#Private IP 192.168.2.100 raclhr-12cR1-N1-priv 192.168.2.101 raclhr-12cR1-N2-priv
#Virtual IP 192.168.59.162 raclhr-12cR1-N1-vip 192.168.59.163 raclhr-12cR1-N2-vip
#Scan IP 192.168.59.164 raclhr-12cR1-scan [[email protected] ~]# [[email protected] ~]# ping raclhr-12cR1-N1 PING raclhr-12cR1-N1 (192.168.59.160) 56(84) bytes of data. 64 bytes from raclhr-12cR1-N1 (192.168.59.160): icmp_seq=1 ttl=64 time=0.018 ms 64 bytes from raclhr-12cR1-N1 (192.168.59.160): icmp_seq=2 ttl=64 time=0.052 ms ^C --- raclhr-12cR1-N1 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1573ms rtt min/avg/max/mdev = 0.018/0.035/0.052/0.017 ms [[email protected] ~]# ping raclhr-12cR1-N2 PING raclhr-12cR1-N2 (192.168.59.161) 56(84) bytes of data. 64 bytes from raclhr-12cR1-N2 (192.168.59.161): icmp_seq=1 ttl=64 time=1.07 ms 64 bytes from raclhr-12cR1-N2 (192.168.59.161): icmp_seq=2 ttl=64 time=0.674 ms ^C --- raclhr-12cR1-N2 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1543ms rtt min/avg/max/mdev = 0.674/0.876/1.079/0.204 ms [[email protected] ~]# ping raclhr-12cR1-N1-priv PING raclhr-12cR1-N1-priv (192.168.2.100) 56(84) bytes of data. 64 bytes from raclhr-12cR1-N1-priv (192.168.2.100): icmp_seq=1 ttl=64 time=0.015 ms 64 bytes from raclhr-12cR1-N1-priv (192.168.2.100): icmp_seq=2 ttl=64 time=0.056 ms ^C --- raclhr-12cR1-N1-priv ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1297ms rtt min/avg/max/mdev = 0.015/0.035/0.056/0.021 ms [[email protected] ~]# ping raclhr-12cR1-N2-priv PING raclhr-12cR1-N2-priv (192.168.2.101) 56(84) bytes of data. 64 bytes from raclhr-12cR1-N2-priv (192.168.2.101): icmp_seq=1 ttl=64 time=1.10 ms 64 bytes from raclhr-12cR1-N2-priv (192.168.2.101): icmp_seq=2 ttl=64 time=0.364 ms ^C --- raclhr-12cR1-N2-priv ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1421ms rtt min/avg/max/mdev = 0.364/0.733/1.102/0.369 ms [[email protected] ~]# ping raclhr-12cR1-N1-vip PING raclhr-12cR1-N1-vip (192.168.59.162) 56(84) bytes of data. From raclhr-12cR1-N1 (192.168.59.160) icmp_seq=2 Destination Host Unreachable From raclhr-12cR1-N1 (192.168.59.160) icmp_seq=3 Destination Host Unreachable From raclhr-12cR1-N1 (192.168.59.160) icmp_seq=4 Destination Host Unreachable ^C --- raclhr-12cR1-N1-vip ping statistics --- 4 packets transmitted, 0 received, +3 errors, 100% packet loss, time 3901ms pipe 3 [[email protected] ~]# ping raclhr-12cR1-N2-vip PING raclhr-12cR1-N2-vip (192.168.59.163) 56(84) bytes of data. From raclhr-12cR1-N1 (192.168.59.160) icmp_seq=1 Destination Host Unreachable From raclhr-12cR1-N1 (192.168.59.160) icmp_seq=2 Destination Host Unreachable From raclhr-12cR1-N1 (192.168.59.160) icmp_seq=3 Destination Host Unreachable ^C --- raclhr-12cR1-N2-vip ping statistics --- 5 packets transmitted, 0 received, +3 errors, 100% packet loss, time 4026ms pipe 3 [[email protected] ~]# ping raclhr-12cR1-scan PING raclhr-12cR1-scan (192.168.59.164) 56(84) bytes of data. From raclhr-12cR1-N1 (192.168.59.160) icmp_seq=2 Destination Host Unreachable From raclhr-12cR1-N1 (192.168.59.160) icmp_seq=3 Destination Host Unreachable From raclhr-12cR1-N1 (192.168.59.160) icmp_seq=4 Destination Host Unreachable ^C --- raclhr-12cR1-scan ping statistics --- 5 packets transmitted, 0 received, +3 errors, 100% packet loss, time 4501ms pipe 3 [[email protected] ~]#
|
1.2.3.6 配置NOZEROCONF
vi /etc/sysconfig/network增加以下內容
NOZEROCONF=yes |
1.2.4 硬體要求
1.2.4.1 記憶體
使用命令檢視:# grep MemTotal /proc/meminfo
[[email protected] ~]# grep MemTotal /proc/meminfo MemTotal: 2046592 kB [[email protected] ~]# |
1.2.4.2 Swap空間
RAM |
Swap 空間 |
1 GB ~ 2 GB |
1.5倍RAM大小 |
2 GB ~ 16 GB |
RAM大小 |
> 32 GB |
16 GB |
使用命令檢視:# grep SwapTotal /proc/meminfo
[[email protected] ~]# grep SwapTotal /proc/meminfo SwapTotal: 2097144 kB [[email protected] ~]# |
1.2.4.3 /tmp空間
建議單獨建立/tmp檔案系統,小麥苗這裡用的是邏輯卷,所以比較好擴充套件。
[[email protected] ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg_rootlhr-Vol00 9.9G 4.9G 4.6G 52% / tmpfs 1000M 72K 1000M 1% /dev/shm /dev/sda1 194M 35M 150M 19% /boot /dev/mapper/vg_rootlhr-Vol01 3.0G 70M 2.8G 3% /tmp /dev/mapper/vg_rootlhr-Vol03 3.0G 69M 2.8G 3% /home .host:/ 331G 229G 102G 70% /mnt/hgfs |
1.2.4.4 Oracle安裝將佔用的磁碟空間
本地磁碟:/u01作為下列軟體的安裝位置
ü Oracle Grid Infrastructure software: 6.8GB
ü Oracle Enterprise Edition software: 5.3GB
vgcreate vg_orasoft /dev/sdb1 /dev/sdb2 /dev/sdb3 lvcreate -n lv_orasoft_u01 -L 20G vg_orasoft mkfs.ext4 /dev/vg_orasoft/lv_orasoft_u01 mkdir /u01 mount /dev/vg_orasoft/lv_orasoft_u01 /u01
cp /etc/fstab /etc/fstab.`date +%Y%m%d` echo "/dev/vg_orasoft/lv_orasoft_u01 /u01 ext4 defaults 0 0" >> /etc/fstab cat /etc/fstab
|
[[email protected] ~]# vgcreate vg_orasoft /dev/sdb1 /dev/sdb2 /dev/sdb3 Volume group "vg_orasoft" successfully created [[email protected] ~]# lvcreate -n lv_orasoft_u01 -L 20G vg_orasoft Logical volume "lv_orasoft_u01" created [[email protected] ~]# mkfs.ext4 /dev/vg_orasoft/lv_orasoft_u01 mke2fs 1.41.12 (17-May-2010) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks 1310720 inodes, 5242880 blocks 262144 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=4294967296 160 block groups 32768 blocks per group, 32768 fragments per group 8192 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000
Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 39 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override. [[email protected] ~]# mkdir /u01 mount /dev/vg_orasoft/lv_orasoft_u01 /u01 [[email protected] ~]# mount /dev/vg_orasoft/lv_orasoft_u01 /u01 [[email protected] ~]# cp /etc/fstab /etc/fstab.`date +%Y%m%d` echo "/dev/vg_orasoft/lv_orasoft_u01 /u01 ext4 defaults 0 0" >> /etc/fstab [[email protected] ~]# echo "/dev/vg_orasoft/lv_orasoft_u01 /u01 ext4 defaults 0 0" >> /etc/fstab [[email protected] ~]# cat /etc/fstab # # /etc/fstab # Created by anaconda on Sat Jan 14 18:56:24 2017 # # Accessible filesystems, by reference, are maintained under '/dev/disk' # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info # /dev/mapper/vg_rootlhr-Vol00 / ext4 defaults 1 1 UUID=fccf51c1-2d2f-4152-baac-99ead8cfbc1a /boot ext4 defaults 1 2 /dev/mapper/vg_rootlhr-Vol01 /tmp ext4 defaults 1 2 /dev/mapper/vg_rootlhr-Vol02 swap swap defaults &nbs |