ORACLE RAC用DNS服务器的配置
一、搭建本地YUM源
二、安装DNS全部组建
yum -y install bind*
三、规划您RAC集群所有IP
#public
192.168.16.111 rac1.ntt.com rac1
192.168.16.112 rac2.ntt.com rac2
192.168.16.121 rac3.ntt.com rac3
192.168.16.122 rac4.ntt.com rac4
#private
10.10.10.111 rac1-priv.ntt.com rac1-priv
10.10.10.112 rac2-priv.ntt.com rac2-priv
10.10.10.121 rac3-priv.ntt.com rac3-priv
10.10.10.122 rac4-priv.ntt.com rac4-priv
#vip
192.168.16.113 rac1-vip.ntt.com rac1-vip
192.168.16.114 rac2-vip.ntt.com rac2-vip
192.168.16.123 rac3-vip.ntt.com rac3-vip
192.168.16.124 rac4-vip.ntt.com rac4-vip
#scan
192.168.16.115 rac11-scan.ntt.com rac11-scan
192.168.16.116 rac11-scan.ntt.com rac11-scan
192.168.16.117 rac11-scan.ntt.com rac11-scan
192.168.16.125 rac12-scan.ntt.com rac12-scan
192.168.16.126 rac12-scan.ntt.com rac12-scan
192.168.16.127 rac12-scan.ntt.com rac12-scan
#storge
192.168.16.188 storge.ntt.com storge
#database
192.168.16.100 hadoop.ntt.com hadoop
四、DNS配置文件
[root@oracle ~]# vi /etc/named.conf
//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
options {
listen-on port 53 { any; }; #默认监听IP是127.0.0.1,any或者注释掉就是允许所有IP
listen-on-v6 port 53 { any; }; #ip6监听地址
directory "/var/named"; #存放区域配置文件的目录
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
allow-query { any; }; #只允许本地主机localhost,any或者注释掉就是允许所有主机查询
recursion yes; #是否开启迭代查询功能
dnssec-enable yes;
dnssec-validation yes;
/* Path to ISC DLV key */
bindkeys-file "/etc/named.iscdlv.key";
managed-keys-directory "/var/named/dynamic";
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
zone "." IN {
type hint;
file "named.ca";
//file "/dev/null";
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
vim /etc/named.rfc1912.zones,
// named.rfc1912.zones:
//
// Provided by Red Hat caching-nameserver package
//
// ISC BIND named zone configuration for zones recommended by
// RFC 1912 section 4.1 : localhost TLDs and address zones
// and http://www.ietf.org/internet-drafts/draft-ietf-dnsop-default-local-zones-02.txt
// (c)2007 R W Franks
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
//配置正向解析Zone
zone "ntt.com" IN {
type master;
file "ntt.com.zone";
allow-update { none; };
};
//注意,这个域名要和后面配置的一致
//配置反向解析Zone
zone "16.168.192.in-addr.arpa" IN {
type master;
file "16.168.192.local";
allow-update { none; };
};
vi /var/named/ntt.com.zone
$TTL 86400
@ IN SOA dns.ntt.com. root.ntt.com. (
42 ; serial (d.adams)
3H ; refresh
15M ; retry
1W ; expiry
1D) ; minimum
IN NS oracle.ntt.com.
dns IN A 192.168.16.166
rac11-scan IN A 192.168.16.115
rac11-scan IN A 192.168.16.116
rac11-scan IN A 192.168.16.117
rac12-scan IN A 192.168.16.125
rac12-scan IN A 192.168.16.126
rac12-scan IN A 192.168.16.127
rac1 IN A 192.168.16.111
rac2 IN A 192.168.16.112
rac3 IN A 192.168.16.121
rac4 IN A 192.168.16.122
rac1-vip IN A 192.168.16.113
rac2-vip IN A 192.168.16.114
rac3-vip IN A 192.168.16.123
rac4-vip IN A 192.168.16.124
storge IN A 192.168.16.188
hadoop IN A 192.168.16.100
vim /var/named/16.168.192.local
$TTL 86400
@ IN SOA dns.ntt.com. root.ntt.com. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400) ; Minimum
IN NS dns.ntt.com.
115 IN PTR rac11-scan.ntt.com.
116 IN PTR rac11-scan.ntt.com.
117 IN PTR rac11-scan.ntt.com.
125 IN PTR rac12-scan.ntt.com.
126 IN PTR rac12-scan.ntt.com.
127 IN PTR rac12-scan.ntt.com.
111 IN PTR rac1.ntt.com
112 IN PTR rac2.ntt.com
121 IN PTR rac3.ntt.com
122 IN PTR rac4.ntt.com
113 IN PTR rac1-vip.ntt.com
114 IN PTR rac2-vip.ntt.com
123 IN PTR rac3-vip.ntt.com
124 IN PTR rac4-vip.ntt.com
188 IN PTR storge.ntt.com
100 IN PTR hadoop.ntt.com
[root@oracle ~]# chkconfig named on
[root@oracle ~]# service named restart
vi /etc/resolv.conf
domain ntt.com
nameserver 192.168.16.166
options rotate
options timeout:2
options attempts:5
五、测试结果:
[root@dns named]# nslookup 192.168.16.111
Server: 192.168.16.166
Address: 192.168.16.166#53
111.16.168.192.in-addr.arpa name = rac1.ntt.com.16.168.192.in-addr.arpa.
[root@dns named]# nslookup 192.168.16.112
Server: 192.168.16.166
Address: 192.168.16.166#53
112.16.168.192.in-addr.arpa name = rac2.ntt.com.16.168.192.in-addr.arpa.
[root@dns named]# nslookup 192.168.16.113
Server: 192.168.16.166
Address: 192.168.16.166#53
113.16.168.192.in-addr.arpa name = rac1-vip.ntt.com.16.168.192.in-addr.arpa.
[root@dns named]# nslookup 192.168.16.114
Server: 192.168.16.166
Address: 192.168.16.166#53
114.16.168.192.in-addr.arpa name = rac2-vip.ntt.com.16.168.192.in-addr.arpa.
[root@dns named]# nslookup 192.168.16.121
Server: 192.168.16.166
Address: 192.168.16.166#53
121.16.168.192.in-addr.arpa name = rac3.ntt.com.16.168.192.in-addr.arpa.
[root@dns named]# nslookup 192.168.16.122
Server: 192.168.16.166
Address: 192.168.16.166#53
122.16.168.192.in-addr.arpa name = rac4.ntt.com.16.168.192.in-addr.arpa.
[root@dns named]# nslookup 192.168.16.123
Server: 192.168.16.166
Address: 192.168.16.166#53
123.16.168.192.in-addr.arpa name = rac3-vip.ntt.com.16.168.192.in-addr.arpa.
[root@dns named]# nslookup 192.168.16.124
Server: 192.168.16.166
Address: 192.168.16.166#53
124.16.168.192.in-addr.arpa name = rac4-vip.ntt.com.16.168.192.in-addr.arpa.
[root@dns named]# nslookup 192.168.16.115
Server: 192.168.16.166
Address: 192.168.16.166#53
115.16.168.192.in-addr.arpa name = rac11-scan.ntt.com.
[root@dns named]# nslookup 192.168.16.116
Server: 192.168.16.166
Address: 192.168.16.166#53
116.16.168.192.in-addr.arpa name = rac11-scan.ntt.com.
[root@dns named]# nslookup 192.168.16.117
Server: 192.168.16.166
Address: 192.168.16.166#53
117.16.168.192.in-addr.arpa name = rac11-scan.ntt.com.
[root@dns named]# nslookup 192.168.16.125
Server: 192.168.16.166
Address: 192.168.16.166#53
125.16.168.192.in-addr.arpa name = rac12-scan.ntt.com.
[root@dns named]# nslookup 192.168.16.126
Server: 192.168.16.166
Address: 192.168.16.166#53
126.16.168.192.in-addr.arpa name = rac12-scan.ntt.com.
[root@dns named]# nslookup 192.168.16.127
Server: 192.168.16.166
Address: 192.168.16.166#53
127.16.168.192.in-addr.arpa name = rac12-scan.ntt.com.
[root@dns named]# nslookup dns
Server: 192.168.16.166
Address: 192.168.16.166#53
Name: dns.ntt.com
Address: 192.168.16.166
[root@dns named]# nslookup dns.ntt.com
Server: 192.168.16.166
Address: 192.168.16.166#53
Name: dns.ntt.com
Address: 192.168.16.166
[root@dns named]# nslookup rac1
Server: 192.168.16.166
Address: 192.168.16.166#53
Name: rac1.ntt.com
Address: 192.168.16.111
[root@dns named]# nslookup rac2
Server: 192.168.16.166
Address: 192.168.16.166#53
Name: rac2.ntt.com
Address: 192.168.16.112
[root@dns named]# nslookup rac3
Server: 192.168.16.166
Address: 192.168.16.166#53
Name: rac3.ntt.com
Address: 192.168.16.121
[root@dns named]# nslookup rac4
Server: 192.168.16.166
Address: 192.168.16.166#53
Name: rac4.ntt.com
Address: 192.168.16.122
[root@dns named]# nslookup rac1-vip
Server: 192.168.16.166
Address: 192.168.16.166#53
Name: rac1-vip.ntt.com
Address: 192.168.16.113
[root@dns named]# nslookup rac2-vip
Server: 192.168.16.166
Address: 192.168.16.166#53
Name: rac2-vip.ntt.com
Address: 192.168.16.114
[root@dns named]# nslookup rac3-vip
Server: 192.168.16.166
Address: 192.168.16.166#53
Name: rac3-vip.ntt.com
Address: 192.168.16.123
[root@dns named]# nslookup rac4-vip
Server: 192.168.16.166
Address: 192.168.16.166#53
Name: rac4-vip.ntt.com
Address: 192.168.16.124
[root@dns named]# nslookup rac11-scan
Server: 192.168.16.166
Address: 192.168.16.166#53
Name: rac11-scan.ntt.com
Address: 192.168.16.117
Name: rac11-scan.ntt.com
Address: 192.168.16.115
Name: rac11-scan.ntt.com
Address: 192.168.16.116
[root@dns named]# nslookup rac12-scan
Server: 192.168.16.166
Address: 192.168.16.166#53
Name: rac12-scan.ntt.com
Address: 192.168.16.125
Name: rac12-scan.ntt.com
Address: 192.168.16.126
Name: rac12-scan.ntt.com
Address: 192.168.16.127
[root@dns named]# nslookup rac1.ntt.com
Server: 192.168.16.166
Address: 192.168.16.166#53
Name: rac1.ntt.com
Address: 192.168.16.111
[root@dns named]# nslookup rac1-vip.ntt.com
Server: 192.168.16.166
Address: 192.168.16.166#53
Name: rac1-vip.ntt.com
Address: 192.168.16.113
[root@dns named]# nslookup rac2.ntt.com
Server: 192.168.16.166
Address: 192.168.16.166#53
Name: rac2.ntt.com
Address: 192.168.16.112
[root@dns named]# nslookup rac2-vip.ntt.com
Server: 192.168.16.166
Address: 192.168.16.166#53
Name: rac2-vip.ntt.com
Address: 192.168.16.114
[root@dns named]# nslookup rac3.ntt.com
Server: 192.168.16.166
Address: 192.168.16.166#53
Name: rac3.ntt.com
Address: 192.168.16.121
[root@dns named]# nslookup rac3-vip.ntt.com
Server: 192.168.16.166
Address: 192.168.16.166#53
Name: rac3-vip.ntt.com
Address: 192.168.16.123
[root@dns named]# nslookup rac4.ntt.com
Server: 192.168.16.166
Address: 192.168.16.166#53
Name: rac4.ntt.com
Address: 192.168.16.122
[root@dns named]# nslookup rac4-vip.ntt.com
Server: 192.168.16.166
Address: 192.168.16.166#53
Name: rac4-vip.ntt.com
Address: 192.168.16.124
[root@dns named]# nslookup rac11-scan.ntt.com
Server: 192.168.16.166
Address: 192.168.16.166#53
Name: rac11-scan.ntt.com
Address: 192.168.16.117
Name: rac11-scan.ntt.com
Address: 192.168.16.115
Name: rac11-scan.ntt.com
Address: 192.168.16.116
[root@dns named]# nslookup rac12-scan.ntt.com
Server: 192.168.16.166
Address: 192.168.16.166#53
Name: rac12-scan.ntt.com
Address: 192.168.16.126
Name: rac12-scan.ntt.com
Address: 192.168.16.127
Name: rac12-scan.ntt.com
Address: 192.168.16.125