CentOS7 安装 Oracle 11g rac(1) —— 配置安装环境
一、Oracle 11g rac 安装规划
在虚拟机环境中安装包含两个节点的 Oracle 11g rac 集群,节点名称分别为 rac1 和 rac2,每台虚拟机使用一块本地磁盘(容量 20GB)和一块共享磁盘(容量 30GB)。具体配置如下:
(1)虚拟机:VMware Workstation12;
(2)操作系统:CentOS7.3、64位系统;
(3)IP 地址:
主机名 | 网卡 | IP地址 | 子网掩码 | 网关 | DNS |
---|
节点1(rac1) | | | | | | | bond1(Public IP) | 192.168.1.101 | 24 | 192.168.1.1 | 192.168.1.1 | | bond2(Private IP) | 10.1.1.101 | 24 | | | 节点2(rac2) | | | | | | | bond1(Public IP) | 192.168.1.102 | 24 | 192.168.1.1 | 192.168.1.1 | | bond2(Private IP) | 10.1.1.102 | 24 | | | | Virtual IP(VIP) | 192.168.1.201 192.168.1.202 192.168.1.203 | | | |
说明:每台服务器配置 4 块网卡,分别为 ens33、ens34、ens35、ens39,其中 ens33 和 ens34 绑定为 bond1,ens35 和 ens39 绑定为 bond2。
二、查看操作系统版本与网卡配置
1、查看操作系统版本
[root@localhost ~]
Linux localhost.localdomain 3.10.0-514.el7.x86_64
[root@localhost ~]
Linux localhost.localdomain 3.10.0-514.el7.x86_64
2、查看网卡配置
[root@localhost ~]
bond1: flags=5187<UP,BROADCAST,RUNNING,MASTER,MULTICAST> mtu 1500
inet 192.168.1.101 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::20c:29ff:fec5:d46a prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:c5:d4:6a txqueuelen 1000 (Ethernet)
RX packets 1088 bytes 185601 (181.2 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 442 bytes 48040 (46.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
bond2: flags=5187<UP,BROADCAST,RUNNING,MASTER,MULTICAST> mtu 1500
inet 10.1.1.101 netmask 255.255.255.0 broadcast 10.1.1.255
inet6 fe80::20c:29ff:fec5:d47e prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:c5:d4:7e txqueuelen 1000 (Ethernet)
RX packets 957 bytes 1326060 (1.2 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 15 bytes 1094 (1.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ens33: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1500
ether 00:0c:29:c5:d4:6a txqueuelen 1000 (Ethernet)
RX packets 762 bytes 111440 (108.8 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 442 bytes 48040 (46.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ens34: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1500
ether 00:0c:29:c5:d4:6a txqueuelen 1000 (Ethernet)
RX packets 326 bytes 74161 (72.4 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ens35: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1500
ether 00:0c:29:c5:d4:7e txqueuelen 1000 (Ethernet)
RX packets 475 bytes 662807 (647.2 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 15 bytes 1094 (1.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ens39: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1500
ether 00:0c:29:c5:d4:7e txqueuelen 1000 (Ethernet)
RX packets 482 bytes 663253 (647.7 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1 (Local Loopback)
RX packets 64 bytes 5568 (5.4 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 64 bytes 5568 (5.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@localhost ~]
bond1: flags=5187<UP,BROADCAST,RUNNING,MASTER,MULTICAST> mtu 1500
inet 192.168.1.102 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::20c:29ff:fe88:a653 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:88:a6:53 txqueuelen 1000 (Ethernet)
RX packets 944 bytes 167727 (163.7 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 391 bytes 38046 (37.1 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
bond2: flags=5187<UP,BROADCAST,RUNNING,MASTER,MULTICAST> mtu 1500
inet 10.1.1.102 netmask 255.255.255.0 broadcast 10.1.1.255
inet6 fe80::20c:29ff:fe88:a667 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:88:a6:67 txqueuelen 1000 (Ethernet)
RX packets 925 bytes 1298492 (1.2 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 15 bytes 1094 (1.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ens33: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1500
ether 00:0c:29:88:a6:53 txqueuelen 1000 (Ethernet)
RX packets 640 bytes 97928 (95.6 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 391 bytes 38046 (37.1 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ens34: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1500
ether 00:0c:29:88:a6:53 txqueuelen 1000 (Ethernet)
RX packets 304 bytes 69799 (68.1 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ens35: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1500
ether 00:0c:29:88:a6:67 txqueuelen 1000 (Ethernet)
RX packets 459 bytes 649023 (633.8 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 15 bytes 1094 (1.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ens39: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1500
ether 00:0c:29:88:a6:67 txqueuelen 1000 (Ethernet)
RX packets 466 bytes 649469 (634.2 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
三、修改主机名
1、临时修改主机名
[root@localhost ~]
[root@localhost ~]
2、永久修改主机名
vi /etc/hostname
rac1
vi /etc/hostname
rac2
四、关闭防火墙和 selinux(两个节点同时操作)
1、关闭防火墙
[root@rac1 ~]
[root@rac1 ~]
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.
[root@rac2 ~]
[root@rac2 ~]
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.
2、关闭 selinux
修改文件 /etc/selinux/config,设置 SELINUX=disabled:
[root@rac2 ~]
SELINUX=disabled
SELINUXTYPE=targeted
[root@rac2 ~]
五、修改主机的 shell 限制(两个节点同时操作)
修改 /etc/security/limits.conf 文件,在文件的结尾添加以下内容:
[root@rac2 ~]
...............
grid soft nofile 65536
grid hard nofile 65536
grid soft nproc 16384
grid hard nproc 16384
oracle soft nofile 65536
oracle hard nofile 65536
oracle soft nproc 16384
oracle hard nproc 16384
六、修改主机的内核参数(两个节点同时操作)
修改 /etc/sysctl.conf 文件,在文件的结尾添加以下内容:
[root@rac2 ~]
kernel.shmmax = 4294967296
kernel.shmmni = 4096
kernel.shmall = 2097152
kernel.sem = 250 32000 100 128
fs.file-max = 6815744
fs.aio-max-nr = 1048576
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 = 1048576
执行以下命令使内核参数生效:
[root@rac1 ~]
kernel.shmmax = 4294967296
kernel.shmmni = 4096
kernel.shmall = 2097152
kernel.sem = 250 32000 100 128
fs.file-max = 6815744
fs.aio-max-nr = 1048576
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 = 1048576
七、修改 /etc/pam.d/login(两个节点同时操作)
修改 /etc/pam.d/login 文件,在文件的结尾添加以下内容:
[root@rac1 ~]
......
session required /lib/security/pam_limits.so
session required pam_limits.so
八、禁用 NTP 服务(两个节点同时操作)
[root@rac1 ~]
Failed to stop ntpd.service: Unit ntpd.service not loaded.
[root@rac2 ~]
Failed to stop ntpd.service: Unit ntpd.service not loaded.
|