Configuring SCAN for Oracle RAC Database 12.1.0.2

This blog is only for Oracle RAC Setup, I am not a network expert but I used my skills to collect knowledge from different blogs and compiled it in a easy way here. I found it bit difficult initially when i did not know anything about DNS and SCAN IP.

For this Setup I will be using my RAC Node 1 to be working as a DNS Server. Configuration of Node 1 is like below:

IP: 192.168.0.151

Step 1 – Install Bind Packages, we will be using the chroot part for SCAN configuration here

Bind packages are available under default yum repositories. To install packages simple execute below command.

# yum install bind bind-chroot

If you don’t have yum repository installed, like I did not have it. So you can use the rpm repository also which is there with the ISO Image file for your Operating system.

Mount it in your RAC Node 1 VM:, select the VM, go to stetting and browse the iso image for OS and click Open. Make Sure Device Status is Connected on Top.

1

 

Device Status is checked as connected, else you wont see this ISO file in the OS.

2

 

Now you can see iso image has been mounted in /media. Go to packages folder in the media folder.

3

Install bind and bind-chroot:

4

Step 2 – Edit Main Configuration File

Default bind main configuration file is located under /etc directory. But using chroot environment, this file is located under /var/named/chroot/etc directory. Now edit main configuration file and update content as below.

=====================================================================

[root@node1 ~]# cat /var/named/chroot/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 { 127.0.0.1; 192.168.0.151; };
listen-on-v6 port 53 { ::1; };
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; };
allow-query-cache { localhost; };
recursion yes;

dnssec-enable yes;
dnssec-validation yes;
dnssec-lookaside auto;

/* 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”;
};

zone “DNS-Search” IN {
type master;
file “node1.zone”;
allow-update { none; };
};

zone “0.168.192.in-addr.arpa.” IN {
type master;
file “0.168.192.in-addr.arpa”;
allow-update { none; };
};

[root@node1 ~]#

 

=====================================================================

I have kept the important configuration in Bold.

Step 3 – Create Zone Files for Your Domain

After creating bind main configuration file, create a zone file for you domain as per configuration:

We have to make sure the names of the files must match with the names we configured in named.conf file. Name could be anything but meaningful.

node1.zone file:

5

localdomain.zone file:

6

Finally for the Reverse Resolution:

7

Step 5 : Configure /etc/resolve.conf

On Node 1: /etc/resolve.conf file must have this configuration. Remember our named.conf file has this entry – DNS-Search, so this value will be picked up from here and accordingly it will go to search for a file node1.zone to get the configuration.

10

And on Node 2 – you only have to make this change on Node 2, rest anything you don’t have to do on Node 2. Only /etc/resolve.conf must be edited to have the DNS Server Setting:

11

Step 6: Start Bind Service

Start named (bind) service using the below command:

[root@node1 ~]# service named restart
Enable auto start on system boot.

[root@node1 ~]# chkconfig named on

Step 6: Test the Scan Configuration

Check the /etc/hosts file for our setup from node 1 and node 2:

1213

Notice that SCAN IP in /etc/hosts is commented because we are using DNS Configuration to resolve this.

Now we can nslookup all our Node’s IPs – Public, Private, Virtual and SCAN IP:

Below is the example for SCAN IP, you can notice every time it picks up a different IP.

8

We can also check for other nodes too to verify the configuration.

9

We are good with this configuration.

Let me know if any question.

Thanks!

 

 

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s