The concept of SCAN (Single Client Access Name) is introduced in the Oracle 11g RAC cluster, that is, the Single Client Access Name of the cluster. SCAN provides a single host name for the client to access the Oracle database running in the cluster. If you add or delete nodes in a cluster, you do not need to change the TNS configuration of the client that uses SCAN. No matter which nodes are contained in the cluster, SCAN resources and their associated IP addresses provide a stable name for clients to connect. When installing Oracle 11g grid, you must configure the DNS resolution mode or GNS resolution mode for this feature. This article describes the DNS configuration when installing Oracle 11g grid.
1. installation environment
# Configure DNS. You can use an independent DNS server or use a node of RAC to provide DNS resolution.
# When a node is directly used, it is easy to see that if the node is down, SCAN cannot be parsed, and the client cannot connect to the database.
# This article only demonstrates using the public ip address of Node 1 as the dns, regardless of the situation described above and DNS Security.
[Root @ node1 ~] # Cat/etc/issue
Enterprise Linux Server release 5.5 (Carthage)
Kernel \ r on an \ m
2. host information of the host Node
[Root @ node1 ~] # More/etc/hosts
# Do not remove the following line, or various programs
# That require network functionality will fail.
#127.0.0.1 localhost. localdomain localhost
#: 1 localhost6.localdomain6 localhost6
127.0.0.1 localhost.szdb.com localhost
# Public eth0
192.168.7.71 node1.szdb.com node1 # use this address as the DNS server address
192.168.7.72 node2.szdb.com node2
# Private eth1
10.10.7.71 node1-priv.szdb.com node1-priv
10.10.7.72 node2-priv.szdb.com node2-priv
# Virtual
192.168.7.81 node1-vip.szdb.com node1-vip
192.168.7.82 node2-vip.szdb.com node2-vip
# Scan
192.168.7.91 scan-cluster1.szdb.com scan-cluster1
3. Configure the installation package required for dns
[Root @ node1 dns_rpm] # ls-hltr
Total 1.1 M
-Rw-r -- 1 root 45 K Dec 7 18:04 bind-chroot-9.3.6-4.P1.el5_4.2.i386.rpm
-Rw-r -- 1 root 985 K Dec 7 bind-9.3.6-4.P1.el5_4.2.i386.rpm
-Rw-r -- 1 root 61 K Dec 7 caching-nameserver-9.3.6-4.P1.el5_4.2.i386.rpm
# Install the rpm package below
[Root @ node1 dns_rpm] # rpm-Uvh bind-9.3.6-4.P1.el5_4.2.i386.rpm
Warning: bind-9.3.6-4.P1.el5_4.2.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ######################################## ### [100%]
1: bind ####################################### #### [100%]
[Root @ node1 dns_rpm] # rpm-Uvh bind-chroot-9.3.6-4.P1.el5_4.2.i386.rpm
Warning: bind-chroot-9.3.6-4.P1.el5_4.2.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ######################################## ### [100%]
1: bind-chroot ##################################### ###### [100%]
[Root @ node1 dns_rpm] # rpm-Uvh caching-nameserver-9.3.6-4.P1.el5_4.2.i386.rpm
Warning: caching-nameserver-9.3.6-4.P1.el5_4.2.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ######################################## ### [100%]
1: caching-nameserver ##################################### ###### [100%]
4. Configure DNS
# The DNS configuration can be divided into the following steps:
# A. Install the required rpm package
# B. Configure the named. conf file
# C. Configure the zone file, including forward and reverse zone files
# D. Configure the parsing file resolv. conf
# E. Start the dns Service
[Root @ node1 ~] # Cd/var/named/chroot/etc/
# Use the following method to copy and modify two new copies. The parameter-p indicates that the two copies are copied together with the permission and owner and the group. Do not ignore the parameter-p
[Root @ node1 etc] # cp-p named. caching-nameserver.conf named. conf
[Root @ node1 etc] # cp-p named. rfc1912.zones named. zones
# Modify the named. conf file and change all localhost and 127.0.0.1 in the source file to any. Note that any is left with spaces
# This file is mainly used to configure the dns listening ports and IP addresses and specify the corresponding name to resolve the zone file name named. zones
# The modified named. conf file is as follows:
[Root @ node1 ~] # Cat/var/named/chroot/etc/named. conf
//
// Named. caching-nameserver.conf
//
// Provided by Red Hat caching-nameserver package to configure
// 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.
//
// Do not edit this file-use system-config-bind or an editor
// To create named. conf-edits to this file will be lost on
// Caching-nameserver package upgrade.
//
Options {
Listen-on port 53 {any ;};
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 ";
// Those options shocould be used carefully because they disable port
// Randomization
// Query-source port 53;
// Query-source-v6 port 53;
Allow-query {any ;};
Allow-query-cache {any ;};
};
Logging {
Channel default_debug {
File "data/named. run ";
Severity dynamic;
};
};
View localhost_resolver {
Match-clients {any ;};
Match-destinations {any ;};
Recursion yes;
Include "/etc/named. zones ";
};
# Modify the named. zones file, which is used to specify the search range of the zone, including forward and reverse. The last two zones at the end of the file are newly added
# Note that each zone file is used to point to the real zone file, which will be used later
# Author: Robinson
# The modified named. zones file is as follows:
[Root @ node1 ~] # Cat/var/named/chroot/etc/named. zones
// Named. rfc1912.zones:
//
// Provided by Red Hat caching-nameserver package
//
// Isc bind named zone configuration for zones recommended
// RFC 1912 section 4.1: localhost TLDs and address zones
//
// See/usr/share/doc/bind */sample/for example named configuration files.
//
Zone "." IN {
Type hint;
File "named. ca ";
};
Zone "localdomain" IN {
Type master;
File "localdomain. zone ";
Allow-update {none ;};
};
Zone "localhost" IN {
Type master;
File "localhost. zone ";
Allow-update {none ;};
};
Zone "0.0.127.in-addr. arpa" IN {
Type master;
File "named. local ";
Allow-update {none ;};
};
Zone "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN {
Type master;
File "named. ip6.local ";
Allow-update {none ;};
};
Zone "255. in-addr.arpa" IN {
Type master;
File "named. broadcast ";
Allow-update {none ;};
};
Zone "0. in-addr.arpa" IN {
Type master;
File "named. zero ";
Allow-update {none ;};
};
# Add new zone added by Robinson
# The following two zones are newly added, including forward and reverse zones.
Zone "szdb.com" IN {
Type master;
File "node1.szdb. zero ";
Allow-update {none ;};
};
Zone "7.168.192.in-addr. arpa" IN {
Type master;
File "7.168.192.local ";
Allow-update {none ;};
};
# Configure forward and reverse search for database parsing files
[Root @ node1 etc] # pwd
/Var/named/chroot/etc
[Root @ node1 etc] # cd ../var/named/
# Copy a file to a new forward and reverse file using the cp-p method.
[Root @ node1 named] # cp-p named. zero node1.szdb. zero
[Root @ node1 named] # cp-p named. local 7.168.192.local
# The following is a modified forward search file. You can also edit other ip addresses of the host file to the forward search file for resolution.
# The following example adds the reference relationship of the vip to the resolution file.
[Root @ node1 named] # cat node1.szdb. zero
$ TTL 86400
@ In soa node1.szdb.com. root.szdb.com .(
42; serial (d. adams)
3 H; refresh
15 M; retry
1 W; expiry
1D); minimum
In ns node1.szdb.com.
Scan-cluster1 in a 192.168.7.91
Scan-cluster1 in a 192.168.7.92
Scan-cluster1.szdb.com in a 192.168.7.91
Scan-cluster1.szdb.com in a 192.168.7.92
Node1-vip in a 192.168.7.81
Node2-vip in a 192.168.7.82
Node1-vip.szdb.com in a 192.168.7.81
Node2-vip.szdb.com in a 192.168.7.82
# The following is the modified reverse search file.
[Root @ node1 named] # cat 7.168.192.local
$ TTL 86400
@ In soa node1.szdb.com. root.szdb.com .(
1997022700; Serial
28800; Refresh
14400; Retry
3600000; Expire
86400); Minimum
In ns node1.szdb.com.
1 in ptr node1.szdb.com.
91 in ptr scan-cluster1.szdb.com.
92 in ptr scan-cluster1.szdb.com.
91 in ptr scan-cluster1.
92 in ptr scan-cluster1.
81 in ptr node1-vip.
82 in ptr node2-vip.
81 in ptr node1-vip.szdb.com.
82 in ptr node2-vip.szdb.com.
# Configure the resolv. conf file on each node
# The modified content is as follows:
[Root @ node1 named] # more/etc/resolv. conf
; Generated by/sbin/dhclient-script
# The following item removed by Robinson
# Search SSG-140
# Nameserver 192.168.7.10
# Nameserver 192.168.7.11
# The following item added by Robinson
Search szdb.com
Nameserver 192.168.7.71
# Resolv. conf file on node 2
[Root @ node2 ~] # More/etc/resolv. conf
; Generated by/sbin/dhclient-script
# Search SSG-140
# Nameserver 192.168.7.10
# Nameserver 192.168.7.11
Search szdb.com
Nameserver 192.168.7.71
# Start the dns Service
[Root @ node1 named] # service named restart
Stopping named: [OK]
Starting named: [OK]
[Root @ node1 named] # chkconfig named on
# Test dns resolution
[Root @ node1 named] # cd ~
[Root @ node1 ~] # Nslookup 192.168.7.91
Server: 192.168.7.71
Address: 192.168.7.71 #53
91.7.168.192.in-addr. arpa name = scan-cluster1.
91.7.168.192.in-addr. arpa name = scan-cluster1.szdb.com.
[Root @ node1 ~] # Nslookup 192.168.7.92
Server: 192.168.7.71
Address: 192.168.7.71 #53
92.7.168.192.in-addr. arpa name = scan-cluster1.szdb.com.
92.7.168.192.in-addr. arpa name = scan-cluster1.
[Root @ node1 ~] # Nslookup scan-cluster1
Server: 192.168.7.71
Address: 192.168.7.71 #53
Name: scan-cluster1.szdb.com
Address: 192.168.7.92
Name: scan-cluster1.szdb.com
Address: 192.168.7.91
[Root @ node1 ~] # Nslookup scan-cluster1.szdb.com.
Server: 192.168.7.71
Address: 192.168.7.71 #53
Name: scan-cluster1.szdb.com
Address: 192.168.7.91
Name: scan-cluster1.szdb.com
Address: 192.168.7.92
Oracle video tutorial follow: http://u.youku.com/user_video/id_UMzAzMjkxMjE2.html