DNS Configuration for the SCAN used with Oracle RAC Database 11g Release 2

This article provides the basic DNS configuration steps necessary to use the Single Client Access Name (SCAN) introduced in Oracle 11g Release 2 RAC. Please consider the following caveats before following the instructions here:

I‘m not an network guy and don‘t claim to know much about DNS.
The article only discusses the use of BIND as the DNS server on Oracle Linux (a RHEL clone).
This represents the minimum you can do to make a SCAN work. This should not be considered a best practice guide as it contains nothing about DNS redundancy or security.
With respect to VMware/VirtualBox RAC installations, this DNS configuration should be done on the host machine, or another virtual machine separate to the RAC cluster if possible. It could be placed on one of the RAC nodes, but this would mean all name resolution would be lost if that RAC node goes offline.
The server used in this article is called "maggie.localdomain" and as an IP address of "192.168.0.4".
With those caveats in mind, here‘s what you need to do.

DNS Installation
"/etc/named.conf" File
"/var/named/" Files
Start the DNS Service
"/etc/resolv.conf" File
Test It
DNS Installation

If you are using a free Linux distribution, like Fedora, then you probably already have a YUM repository configured. If you are using Oracle Linux, then follow the configuration instructions on public-yum.oracle.com.

Installation of the DNS server (BIND) could not be simpler. From the command line issue the following command.

# yum install bind-libs bind bind-utils
If you want a GUI DNS editor, you can also install the following package. Personally, I find the GUI editor more confusing than using the configuration files directly.

# yum install system-config-bind
Note. If the config files are not present (as is the case in Oracle Linux 5), it is worth installing the "system-config-bind" utility and starting it up. This will generate a default setup of all the dependent config files for you to amend. It is much easier than trying to build them manually.

"/etc/named.conf" File

Next we must edit the contents of the "/etc/named.conf" file. Depending on the setup you require, you may need to make lots of changes, or none at all. For my home network I use "localdomain" as my domain and the IP range "192.168.0.*", so this is what I will show here.

We need to make sure the DNS is listening on the correct port for both the local and external IP address. This is done by the "listen-on" setting. This DNS server is only resolving the names of the servers on my network, so I need to make sure that servers on external networks, like the internet, are resolved properly. To do this you add a "forwarder" entry to the end of the "options" section.

options {
// Set IP address correctly.
listen-on port 53 { 127.0.0.1; 192.168.0.4; };

//
// Leave the rest of the config as it is.
//

// My Additions
// Forwarder: Anything this DNS can‘t resolve gets forwarded to my ISPs DNS.
forwarders { 194.168.4.100; 194.168.8.100; };
// End My Additions
};
In this case I‘m using the DNS information provided by my ISP, but you could list your ADSL Router if it manages the DNS for you.

Since I‘m using "localdomain" as my internal domain, I need to add a zone if one isn‘t already present.

zone "localdomain." IN {
type master;
file "localdomain.zone";
allow-update { none; };
};
If you plan to use a different domain simply copy this entry and adjust it to match your domain. For example, if this were an entry for "oracle-base.com" I would create a zone as follows.

zone "oracle-base.com" IN {
type master;
file "oracle-base.com.zone";
allow-update { none; };
};
The "file" parameter specifies the name of the file in the "/var/named/" directory that contains the configuration for this zone.

If you only care about forward lookups then you are now finished with the "/etc/named.conf" file. If you want to also cope with reverse lookups you will need to add an extra zone to cope with those. In the case of a RAC installation, I want to create reverse lookups for my public (192.169.0.*) network, so I must add the following zone entry.

zone "0.168.192.in-addr.arpa." IN {
type master;
file "0.168.192.in-addr.arpa";
allow-update { none; };
};
Examples of the amended default "/etc/named.conf" files can be seen below.

Fedora16
Oracle Linux 5
Oracle Linux 6
"/var/named/" Files

In the zone definitions we defined the file containing the zone configuration. These files are located in the "/var/named/" directory. If you are using the "chroot" version of BIND, the location of the following files will be "/var/named/chroot/var/named".

For a RAC installation create/edit the file associated with your zone (in my case "/var/named/localdomain.zone") to look like the one below.

$TTL 86400
@ IN SOA localhost root.localhost (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS localhost
localhost IN A 127.0.0.1
rac1 IN A 192.168.0.101
rac2 IN A 192.168.0.102
rac1-priv IN A 192.168.1.101
rac2-priv IN A 192.168.1.102
rac1-vip IN A 192.168.0.111
rac2-vip IN A 192.168.0.112
rac-scan IN A 192.168.0.121
rac-scan IN A 192.168.0.122
rac-scan IN A 192.168.0.123
I‘ve kept all the default configuration, but added in my forward lookup information. Notice the three entries for the SCAN.

Next I need to create the "/var/named/0.168.192.in-addr.arpa" file for my public network reverse lookups. This file has the following contents, where "maggie.localdomain" is the name of the DNS server.

$ORIGIN 0.168.192.in-addr.arpa.
$TTL 1H
@ IN SOA maggie.localdomain. root.maggie.localdomain. ( 2
3H
1H
1W
1H )
0.168.192.in-addr.arpa. IN NS maggie.localdomain.

101 IN PTR rac1.localdomain.
102 IN PTR rac2.localdomain.
111 IN PTR rac1-vip.localdomain.
112 IN PTR rac2-vip.localdomain.
121 IN PTR rac-scan.localdomain.
122 IN PTR rac-scan.localdomain.
123 IN PTR rac-scan.localdomain.
Start the DNS Service

With the configuration in place we can start the DNS service, called "named".

# service named start
Starting named: [ OK ]
#
If there are any problems with your configuration the service will fail to start and the errors should be displayed on screen immediately. If they don‘t appear check the "/var/log/messages" file.

Issue the following command to make sure the "named" service starts automatically after reboots.

# chkconfig named on
"/etc/resolv.conf" File

The DNS server is now running, but each server must be told to use it. This is done by editing the "/etc/resolv.conf" file on each server, including the RAC nodes. Make sure the file contains the following entries, where the IP address and domain match those of your DNS server and the domain you have configured.

nameserver 192.168.0.4
search localdomain
Test It

You should now be able to test the forward and reverse lookups using the "nslookup" command. The output below shows the forward and reverse lookups of the SCAN address.

# nslookup rac-scan.localdomain
Server: 192.168.0.4
Address: 192.168.0.4#53

Name: rac-scan.localdomain
Address: 192.168.0.121
Name: rac-scan.localdomain
Address: 192.168.0.122
Name: rac-scan.localdomain
Address: 192.168.0.123

# nslookup 192.168.0.121
Server: 192.168.0.4
Address: 192.168.0.4#53

121.0.168.192.in-addr.arpa name = rac-scan.localdomain.

# nslookup 192.168.0.122
Server: 192.168.0.4
Address: 192.168.0.4#53

122.0.168.192.in-addr.arpa name = rac-scan.localdomain.

# nslookup 192.168.0.123
Server: 192.168.0.4
Address: 192.168.0.4#53

123.0.168.192.in-addr.arpa name = rac-scan.localdomain.

-- The END--

时间: 2024-10-10 05:39:01

DNS Configuration for the SCAN used with Oracle RAC Database 11g Release 2的相关文章

GitHub: Oracle RAC Database on Docker 未测试 改天试试

https://github.com/oracle/docker-images/blob/master/OracleDatabase/RAC/OracleRealApplicationClusters/README.md Oracle RAC Database on Docker Oracle Real Application Clusters (RAC) is an option to the award-winning Oracle Database Enterprise Edition.

在redhat6.4下安装 Oracle® Database 11g Release 2

OS版本: 安装过程的相关信息: pdksh 安装好后根据需要设置oracle开机自启动http://www.cnblogs.com/softidea/p/3761671.html 设置环境变量NLS_LANG,ORACLE_SID 配置tnsnames.ora http://blog.itpub.net/21162451/viewspace-721930/ 在redhat6.4下安装 Oracle® Database 11g Release 2

Oracle - 安装 Oracle Database 11g Release 2

写在前面:工作中,一般安装 Oracle 11g 客户端,配置 Net Manager(安装好客户端或者服务端才会有),远程连接 Oracle 数据库即可满足连接数据库的需求了.若希望本机可以操作 Oracle,则需要安装 Oracle 11g 服务端. Oracle Database 11g Release 2 Client (11.2.0.1.0) Oracle Database 11g Release 2 Client (11.2.0.1.0) for Microsoft Windows

centos 7 安装Oracle Database 11g Release 2 (11.2.0.4)

参考文章: http://www.cnblogs.com/lightnear/archive/2012/10/07/2714247.html http://www.cnblogs.com/xqzt/p/5456401.html http://www.cnblogs.com/anzerong2012/p/7528311.html 一.安装环境 CentOS Linux release 7.2.1511 (Core) Oracle Database 11g Release 2 (11.2.0.4)

Oracle Database 11g Release 2(11.2.0.3.0) RAC On Redhat Linux 5.8 Using Vmware Workstation 9.0

一,简介 二,配置虚拟机 1,创建虚拟机 (1)添加三块儿网卡: 主节点 二节点 eth0:    公网  192.168.1.20/24   NAT eth0:    公网  192.168.1.21/24   NAT eth1:私网  192.168.2.20/24     host-only eth1:      私网  192.168.2.21/24   host-only eth2:    DHCP    Bridged eth2:     DHCP    Bridged 主机名: t

Oracle Database 11g Release 2 Standard Edition and Enterprise Edition Software Downloads

Oracle 数据库 11g 第 2 版 标准版.企业版 软件下载 Microsoft Windows(32 位) 光盘 1.光盘 2 (2GB) 1 Microsoft Windows (x64) 光盘 1.光盘 2 (2GB) 2 Linux x86 光盘 1.光盘 2 (2GB) 3 Linux x86-64 光盘 1.光盘 2 (2GB) 3 Solaris (SPARC)(64 位) 光盘 1.光盘 2 (2GB) 4 Solaris (x86-64) 光盘 1.光盘 2 (2GB)

Oracle Database 11g Release 2 installation On CentOS 6.6(x64 platform)

(Note: the current user is "tdtc100") 1. down install files (1) linux.x64_11gR2_database_1of2.zip (2) linux.x64_11gR2_database_2of2.zip 2. unzip files (1) $> unzip linux.x64_11gR2_database_1of2.zip (2) $> unzip linux.x64_11gR2_database_2of

Oracle RAC 环境下的连接管理(转) --- 防止原文连接失效

崔华老师的文章!!! 这篇文章详细介绍了Oracle RAC环境下的连接管理,分别介绍了什么是 Connect Time Load Balancing.Runtime Connection Load Balancing.Connect Time Connection Failover 和 Runtime Connection Failover,以及里面所涉及到的 TAF.ONS.FCF.FAN.LBA 等诸多知识点.本文主要是针对 Oracle RAC 11gR2 环境下的连接管理,但同时也会对

Install Oracle 11G Release 2 (11.2) on Centos Linux 7

Install Oracle 11G Release 2 (11.2) on Centos Linux 7 This article presents how to install Oracle 11G on Centos Linux 7. Read following article how to install Centos Linux 7: Install Centos Linux 7 (for comfort set 2G memory for your virtual machine