`

配置11gR2 RAC SCAN

阅读更多

11G RAC scan即用DNA解析的IP地址,oracle推荐配置3个,这样可以起到均衡负载和冗余的作用.
系统情况: rac01,rac02
操作系统平台:red hat enterprise 5.4 2台虚拟机
这里 我们需要配置一个scan为 rac-scan的域名解析
配置步骤如下:
1. 我们设置rac01为DNS服务器
[root@rac01 etc]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:29:B5:38:5E 
          inet addr:192.168.0.18  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:feb5:385e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2332291 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1535201 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2347536563 (2.1 GiB)  TX bytes:1079658292 (1.0 GiB)
          Interrupt:185 Base address:0x1480

eth0:1    Link encap:Ethernet  HWaddr 00:0C:29:B5:38:5E 
          inet addr:192.168.0.101  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:185 Base address:0x1480

eth1      Link encap:Ethernet  HWaddr 00:0C:29:B5:38:68 
          inet addr:10.10.10.1  Bcast:10.10.10.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:feb5:3868/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:39950 errors:0 dropped:0 overruns:0 frame:0
          TX packets:61611 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:15381230 (14.6 MiB)  TX bytes:46112067 (43.9 MiB)
          Interrupt:193 Base address:0x1800

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:54304 errors:0 dropped:0 overruns:0 frame:0
          TX packets:54304 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:10332630 (9.8 MiB)  TX bytes:10332630 (9.8 MiB)

 

从以上可以看出rac01的IP地址为:192.168.0.1

然后 配置 DNS named.conf 文件 
[root@rac01 named]# vi /var/named/chroot/etc/named.conf

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";
     query-source port 53;
     query-source-v6 port 53;
     allow-query { any; };
};

zone "." IN {
    type hint;
    file "named.ca";
};

zone "testenv.com" IN {
      type master;
      file "testenv.com.zone";
      allow-update { none; };
};

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


"/var/named/chroot/etc/named.conf" 29L, 697C

[root@rac01 etc]# dig  -t NS .

; <<>> DiG 9.3.6-P1-RedHat-9.3.6-4.P1.el5 <<>> -t NS .
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 14850
;; flags: qr rd ra; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 14

;; QUESTION SECTION:
;.                              IN      NS

;; ANSWER SECTION:
.                       513716  IN      NS      e.root-servers.net.
.                       513716  IN      NS      f.root-servers.net.
.                       513716  IN      NS      g.root-servers.net.
.                       513716  IN      NS      h.root-servers.net.
.                       513716  IN      NS      i.root-servers.net.
.                       513716  IN      NS      j.root-servers.net.
.                       513716  IN      NS      k.root-servers.net.
.                       513716  IN      NS      l.root-servers.net.
.                       513716  IN      NS      m.root-servers.net.
.                       513716  IN      NS      a.root-servers.net.
.                       513716  IN      NS      b.root-servers.net.
.                       513716  IN      NS      c.root-servers.net.
.                       513716  IN      NS      d.root-servers.net.

;; ADDITIONAL SECTION:
a.root-servers.net.     600116  IN      A       198.41.0.4
a.root-servers.net.     600116  IN      AAAA    2001:503:ba3e::2:30
b.root-servers.net.     600116  IN      A       192.228.79.201
c.root-servers.net.     600116  IN      A       192.33.4.12
d.root-servers.net.     600116  IN      A       128.8.10.90
e.root-servers.net.     600116  IN      A       192.203.230.10
f.root-servers.net.     600116  IN      A       192.5.5.241
f.root-servers.net.     600116  IN      AAAA    2001:500:2f::f
g.root-servers.net.     600116  IN      A       192.112.36.4
h.root-servers.net.     600116  IN      A       128.63.2.53
h.root-servers.net.     600116  IN      AAAA    2001:500:1::803f:235
i.root-servers.net.     600116  IN      A       192.36.148.17
i.root-servers.net.     600116  IN      AAAA    2001:7fe::53
j.root-servers.net.     600116  IN      A       192.58.128.30

;; Query time: 7 msec
;; SERVER: 192.168.0.18#53(192.168.0.18)
;; WHEN: Sun Jan  2 09:09:56 2011
;; MSG SIZE  rcvd: 500
[root@rac01 etc]# dig  -t NS . >/var/named/named.ca

配置正解析文件 
[root@rac01 etc]#  vi /var/named/chroot/var/named/testenv.com.zone

$TTL 86400
@        IN      SOA     dns.testenv.com.        root.dns.testenv.com. (
                         20110102
                         1H
                         15M
                         1W
                         1D)
testenv.com.   IN NS  dns.testenv.com.
dns              IN A 192.168.0.18
www            IN A 192.168.0.199
vip-rac01      IN A 192.168.0.100
vip-rac02      IN A 192.168.0.101
rac-scan       IN A 192.168.0.55
rac-scan       IN A 192.168.0.56
rac-scan       IN A 192.168.0.57
news           IN CNAME www
~
~
~
~
"/var/named/chroot/var/named/testenv.com.zone" 18L, 595C written
配置反解析文件
[root@rac01 etc]# vi /var/named/chroot/var/named/0.168.192.in-addr.arpa.zone

$TTL 86400
@    IN SOA dns.testenv.com. root.dns.testenv.com. (
                  20111102
                  3H
                  1H
                  1W
                  1H )
     IN NS      dns.testenv.com.
18   IN PTR     dns.testenv.com.
199  IN PTR     www.testenv.com.
100  IN PTR     vip-rac01.testenv.com.
101  IN PTR     vip-rac02.testenv.com.
55   IN PTR     rac-scan.testenv.com.
56   IN PTR     rac-scan.testenv.com.
57   IN PTR     rac-scan.testenv.com.
~
~
~
~
"/var/named/chroot/var/named/0.168.192.in-addr.arpa.zone" 15L, 468C

 

配置DNS服务器所在地址:其中192.168.0.1为总的解析服务器,这里我们添加192.168.0.18为解析服务器


[root@rac01 etc]# vi /etc/resolv.conf

nameserver 192.168.0.18
nameserver 192.168.0.1
search localdomain testenv.com
~
~
"/etc/resolv.conf" 3L, 78C

配置hosts解析顺序:

[root@rac01 etc]# vi /etc/nsswitch.conf

#
# /etc/nsswitch.conf
#
# An example Name Service Switch config file. This file should be
# sorted with the most-used services at the beginning.
#
# The entry '[NOTFOUND=return]' means that the search for an
# entry should stop if the search in the previous entry turned
# up nothing. Note that if the search failed due to some other reason
# (like no NIS server responding) then the search continues with the
# next entry.
#
# Legal entries are:
#
#       nisplus or nis+         Use NIS+ (NIS version 3)
#       nis or yp               Use NIS (NIS version 2), also called YP
#       dns                     Use DNS (Domain Name Service)
#       files                   Use the local files
#       db                      Use the local database (.db) files
#       compat                  Use NIS on compat mode
#       hesiod                  Use Hesiod for user lookups
#       [NOTFOUND=return]       Stop searching if not found so far
#

# To use db, put the "db" in front of "files" for entries you want to be
# looked up first in the databases
#
# Example:
#passwd:    db files nisplus nis
#shadow:    db files nisplus nis
#group:     db files nisplus nis

passwd:     files
shadow:     files
group:      files

#hosts:     db files nisplus nis dns
#hosts:      files dns
hosts:       dns files nis

# Example - obey only what nisplus tells us...
#services:   nisplus [NOTFOUND=return] files
"/etc/nsswitch.conf" 64L, 1724C

 

然后重新启动DNS服务


[root@rac01 etc]# service named restart
Stopping named: [  OK  ]
Starting named: [  OK  ]
[root@rac01 etc]# tail /var/log/messages
Jan  2 09:14:02 rac01 named[29179]: listening on IPv4 interface eth0:1, 192.168.0.101#53
Jan  2 09:14:02 rac01 named[29179]: listening on IPv4 interface eth1, 10.10.10.1#53
Jan  2 09:14:02 rac01 named[29179]: /etc/named.conf:8: using specific query-source port suppresses port randomization and can be insecure.
Jan  2 09:14:02 rac01 named[29179]: /etc/named.conf:9: using specific query-source port suppresses port randomization and can be insecure.
Jan  2 09:14:02 rac01 named[29179]: command channel listening on 127.0.0.1#953
Jan  2 09:14:02 rac01 named[29179]: command channel listening on ::1#953
Jan  2 09:14:02 rac01 named[29179]: the working directory is not writable
Jan  2 09:14:02 rac01 named[29179]: zone 0.168.192.in-addr.arpa/IN: loaded serial 20111102
Jan  2 09:14:02 rac01 named[29179]: zone testenv.com/IN: loaded serial 20110102
Jan  2 09:14:02 rac01 named[29179]: running

 

检查配置是否成功:试着解析rac-scan域名
[root@rac01 etc]# nslookup rac-scan
Server:         192.168.0.18
Address:        192.168.0.18#53

Name:   rac-scan.testenv.com
Address: 192.168.0.55
Name:   rac-scan.testenv.com
Address: 192.168.0.56
Name:   rac-scan.testenv.com
Address: 192.168.0.57

[root@rac01 etc]# nslookup vip-rac01
Server:         192.168.0.18
Address:        192.168.0.18#53

Name:   vip-rac01.testenv.com
Address: 192.168.0.100

[root@rac01 etc]# nslookup vip-rac02
Server:         192.168.0.18
Address:        192.168.0.18#53

Name:   vip-rac02.testenv.com
Address: 192.168.0.101
反解析:
[root@rac01 etc]# nslookup 192.168.0.56
Server:         192.168.0.18
Address:        192.168.0.18#53

56.0.168.192.in-addr.arpa       name = rac-scan.testenv.com.

[root@rac01 etc]#
看来配置成功!

然后再在rac02上做相关配置:
[root@rac02 ~]# vi /etc/nsswitch.conf

#
# /etc/nsswitch.conf
#
# An example Name Service Switch config file. This file should be
# sorted with the most-used services at the beginning.
#
# The entry '[NOTFOUND=return]' means that the search for an
# entry should stop if the search in the previous entry turned
# up nothing. Note that if the search failed due to some other reason
# (like no NIS server responding) then the search continues with the
# next entry.
#
# Legal entries are:
#
#       nisplus or nis+         Use NIS+ (NIS version 3)
#       nis or yp               Use NIS (NIS version 2), also called YP
#       dns                     Use DNS (Domain Name Service)
#       files                   Use the local files
#       db                      Use the local database (.db) files
#       compat                  Use NIS on compat mode
#       hesiod                  Use Hesiod for user lookups
#       [NOTFOUND=return]       Stop searching if not found so far
#

# To use db, put the "db" in front of "files" for entries you want to be
# looked up first in the databases
#
# Example:
#passwd:    db files nisplus nis
#shadow:    db files nisplus nis
#group:     db files nisplus nis

passwd:     files
shadow:     files
group:      files

#hosts:     db files nisplus nis dns
#hosts:     files dns
hosts:      dns files nis

# Example - obey only what nisplus tells us...
#services:   nisplus [NOTFOUND=return] files
"/etc/nsswitch.conf" 64L, 1722C
[root@rac02 ~]# vi /etc/resolv.conf

; generated by /sbin/dhclient-script
nameserver 192.168.0.18
nameserver 192.168.0.1
search localdomain testenv.com
~
~
"/etc/resolv.conf" 4L, 115C

 

[root@rac02 ~]# nslookup rac-scan
Server:         192.168.0.18
Address:        192.168.0.18#53

Name:   rac-scan.testenv.com
Address: 192.168.0.56
Name:   rac-scan.testenv.com
Address: 192.168.0.57
Name:   rac-scan.testenv.com
Address: 192.168.0.55

[root@rac02 ~]#
[root@rac02 ~]# nslookup vip-rac01
Server:         192.168.0.18
Address:        192.168.0.18#53

Name:   vip-rac01.testenv.com
Address: 192.168.0.100

[root@rac02 ~]# nslookup vip-rac02
Server:         192.168.0.18
Address:        192.168.0.18#53

Name:   vip-rac02.testenv.com
Address: 192.168.0.101

[root@rac02 ~]# nslookup 192.168.0.56
Server:         192.168.0.18
Address:        192.168.0.18#53

56.0.168.192.in-addr.arpa       name = rac-scan.testenv.com.

[root@rac02 ~]#

 

rac02也可以正确解析SCAN域名!

这样一个正反解析的SCAN域名就配置成功了.......

 

注意:在安装11Gr2 RAC集群时,配置其中的一个节点作为DNS服务器是不被支持的,安装过程中会出错

 

分享到:
评论

相关推荐

    一步一步在Linux上升级 Oracle 10gR2 RAC到11gR2 RAC

    某客户需要将一套Oracle 10gR2 双节点RAC 生产数据库升级至Oracle 11gR2 RAC,所以便有了本系列实战的教程。 为更贴切还原生产过程中的实际操作,本系列教程一个分两大部分: 第一部分已发 一步一步在Linux上部署...

    构建最高可用Oracle数据库系统 Oracle 11gR2 RAC管理、维护与性能优化

    第2章 搭建类似生产环境的RAC 2.1搭建环境 2.1.1 RAC的物理结构 2.1.硬件环境 2.1.3软件环境 2.2搭建存储服务器 2.2.1安装Openfiler操作系统 2.2.2Openfiler主界面 2.2.3配置iSCSI磁盘 2.3搭建数据库服务器...

    Oracle11gR2 RAC guides On Lunix

    本文档提供了 Oracle 11gR2 RAC 在 Linux 环境下的安装指导,旨在帮助数据库管理员顺利安装配置该版本的 RAC 系统。文档详细介绍了 11gR2 Grid Infrastructure 的新特性,并提供了必要的系统要求和技术准备步骤。 #...

    RedHat 5 下安装 Oracle 11gR2 RAC 环境

    在RedHat 5下安装Oracle 11gR2 RAC环境是一项复杂而细致的任务,涉及到多方面的系统配置与软件部署。以下是对该任务中关键知识点的深入解析: ### 安装环境概述 #### 主机操作系统 主机操作系统选择了Win7,这表明...

    deploying-oracle-11gr2-rac-on-rhel6_1

    2. **安装 Oracle 11g R2 RAC**: - 解压 Oracle 11g R2 RAC 软件包到指定目录。 - 运行安装脚本,按照提示完成配置。 - 在每个节点上重复此过程,确保一致性和兼容性。 3. **配置集群参数**: - 配置集群节点...

    Oracle 11gR2 SCAN详解

    综上所述,Oracle 11gR2中的SCAN特性,通过引入虚拟服务层,极大地简化了RAC架构的配置和维护,同时增强了系统的灵活性和安全性。无论是通过DNS定义还是GNS机制实现,SCAN都为数据库管理和运维人员提供了一个更为...

    RedHat5 下 11gr2 Rac 安装文档

    根据给定的文件信息,以下是对RedHat5环境下11gr2 RAC安装文档的关键知识点进行的详细解析: ### 一、安装环境 在搭建Oracle RAC 11gr2集群之前,首先需要确保所有必要的组件都已就绪。安装环境包括: - **主机...

    DNS SCAN Oracle RAC 11gR2

    在Oracle RAC 11gR2中,DNS配置对于SCAN至关重要。以下是一些关键步骤: 1. **创建SCAN IP地址**:在DNS服务器上,为每个集群创建三个SCAN IP地址,这些地址应属于同一子网但未被其他服务使用。 2. **配置A记录**:...

    oracle 11gR2 RAC installation test guide

    Oracle 11gR2 RAC (Real Application Clusters) 安装测试指南是一个详细的步骤...这个安装测试指南详细地涵盖了从硬件准备到软件安装,再到网络配置和DNS服务的每一个步骤,是部署Oracle 11gR2 RAC环境的实用参考资料。

    install_Oracle_11gR2_RAC_on_HP-UX

    3. **SCAN(Single Client Access Name)**:Oracle 11gR2引入SCAN,允许客户端通过单一的名称连接到集群,极大地简化了客户端配置。每个SCAN VIP对应一个SCAN监听器,客户端请求被转发到适当的本地监听器,以提供...

    11gr2 rac实施

    在本文中,我们将深入探讨在 AIX 6.1 操作系统上实施 Oracle 11g Release 2 (11g R2) RAC 的关键步骤和注意事项。 **一、系统规划** 在部署 RAC 环境之前,必须进行详细的系统规划。这包括确定节点名称、实例名称...

    Oracle 11gR2 RAC 安装配置

    ### Oracle 11gR2 RAC 安装配置知识点详解 #### 一、Oracle RAC 11gR2 安装环境规划 **1. BLOCK大小:** - 设置为8KB,这是为了更好地匹配数据库块大小,提高数据库性能。 **2. 并发用户数:** - 设置为2000个...

    Linux Oracle 11g R2 RAC 安装配置详细过程

    Linux Oracle 11g R2 RAC(Real Application Clusters)安装配置涉及的技术内容相当广泛,涵盖操作系统配置、网络设置、用户和组管理、磁盘规划、软件安装以及集群配置等众多步骤。本文档旨在提供一个详细过程,以便...

    Oracle+11gR2+RAC安装详解(HP-UX+11.31+ia64平台).pdf

    2. `hpia64_11gR2_database_2of2.zip` 3. `hpia64_11gR2_grid.zip`(该文件下载较难,请确保使用合适的工具和方法进行下载。) 这些文件可以从 Oracle 的官方网站下载,但需要拥有 Oracle 的注册账户才能访问下载...

    oracle11gr2 rac安装步骤

    ### Oracle 11g R2 RAC 安装步骤之 DNS 配置详解 #### 一、概述 Oracle 11g R2 RAC(Real Application Clusters)是一种高可用性和可扩展性的数据库集群解决方案。在搭建Oracle 11g R2 RAC环境时,正确配置DNS...

    Oracle 11gR2 RAC安装.docx

    Oracle 11gR2 Real Application Clusters (RAC) 是一种高可用性解决方案,允许数据库在多台服务器之间共享,从而提高系统的容错性和性能。在安装Oracle 11gR2 RAC的过程中,需要关注以下几个关键知识点: 1. **网络...

    Oracle 11gR2 RAC(ASM) on RHEL6.4安装流程

    ### Oracle 11gR2 RAC (ASM) on RHEL6.4 安装流程详解 #### 环境概述 本文档旨在详细介绍Oracle 11gR2 RAC (ASM) 在Red Hat Enterprise Linux Server 6.4 (Santiago) 上的安装流程。RAC (Real Application ...

    Windows_2008_r2_+_Oracle11gR2_RAC

    Oracle 11g R2 RAC 中引入了 SCAN(single client access name),即简单客户端连接名,一个方便客户端连接的接口。 SCAN 简化了客户端连接,客户端连接的时候只需要知道这个名称,并连接即可。 三、Windows 2008 ...

Global site tag (gtag.js) - Google Analytics