近期准备搭建oracle 12C RAC环境,搭建集群的第一步就是建立网络环境,预计使用三台服务器主机名分别为host01、host02、host03。其中host01、houst02为RAC集群,host03为DNS服务器。搭建过程将分4篇章进行图解。
本章是DNS服务器搭建,这里host03是我的的DNS服务器。
一、虚拟机安装Redhat 6.7配置YUM。
服务器创建略过。要求如下
主机 | 硬件要求 | 软件要求 | |||||
类型 | 内存 | 网卡 | 硬盘 | GI版本 | DB版本 | 操作系统 | |
host01 | RAC | ≥2G | 三张网卡 | ≥40G,8个2G磁盘 | 12.1.0.2 | 12.1.0.2 | Redhat 6.7 |
host02 | RAC | ≥2G | 三张网卡 | ≥40G,8个2G磁盘 | 12.1.0.2 | 12.1.0.2 | Redhat 6.7 |
host03 | DNS | 768M | 一张网卡 | 20G | 无 | 无 | Redhat 6.7 |
网络配置 | |||||
主机名称 | 网卡名称 | 地址类型 | IP地址 | DNS服务器 | 搜索域 |
host01 | eth0 | 公网 | 10.0.1.101 | 10.0.1.3 | example.com |
eth1 | 私网 | 192.168.56.101 | 无 | 无 | |
eth2 | 私网 | 192.168.56.102 | 无 | 无 | |
host02 | eth0 | 公网 | 10.0.1.102 | 10.0.1.3 | example.com |
eth1 | 私网 | 192.168.56.103 | 无 | 无 | |
eth2 | 私网 | 192.168.56.104 | 无 | 无 | |
host03 | eth0 | 私网 | 10.0.1.3 | 10.0.1.3 | example.com |
二、准备服务器,安装DNS组件
yum install -y bind bind-chroot bind-utils
三、修改配置文件
1、修改/etc/host 文件,增加以下IP地址,后面的三台主机的IP将会按照如下配置。
10.0.1.3 host03.example.com host03
10.0.1.101 host01.example.com host01
10.0.1.102 host02.example.com host02
192.168.56.101 host01-priv
192.168.56.102 host02-priv
2、/etc/named.conf,填写你DNS服务器的IP,注释掉IP-V6,填写DNS允许访问的IP,这里方便起见我修改为any
3、/etc/named.rfc1912.zones,增加配置文件,这里的zone 可以复制
4、进入/var/named/创建解析文件,正向解析,编辑解析的地址映射
cp named.localhost example.com.zone
vi example.com.zone
5、编辑反向解析映射
cp named.loopback 1.0.10.in-addr.arpa
vi 1.0.10.in-addr.arpa
四、测试DNS服务器是否搭建成功
[root@host03 named]# service named restart
停止 named: [确定]
启动 named: [确定]
[root@host03 named]# nslookup host03
Server: 10.0.1.3
Address: 10.0.1.3#53
Name: host03.example.com
Address: 127.0.0.1
[root@host03 named]# nslookup host02
Server: 10.0.1.3
Address: 10.0.1.3#53
Name: host02.example.com
Address: 10.0.1.102
[root@host03 named]# nslookup host01
Server: 10.0.1.3
Address: 10.0.1.3#53
Name: host01.example.com
Address: 10.0.1.101
[root@host03 named]# nslookup cluster01-scan
Server: 10.0.1.3
Address: 10.0.1.3#53
Name: cluster01-scan.example.com
Address: 10.0.1.201
Name: cluster01-scan.example.com
Address: 10.0.1.202
Name: cluster01-scan.example.com
Address: 10.0.1.203
解析成功,DNS服务器配置完成。