标签:sky eve 声明 include service 编辑 target default access
原文地址:http://tiany.blog.51cto.com/513694/1421917/
Oracle 11g RAC SCAN ip的原理及配置
Oracle 11g RAC网格即插即用(GPnP)工作原理:
SCAN概念:
先介绍一下什么叫SCAN,SCAN(Single Client Access Name)是Oracle从11g R2开始推出的,客户端可以通过SCAN特性负载均衡地连接到RAC数据库。SCAN提供一个域名来访问RAC,域名可以解析1个到3个(注意,最多3个)SCAN IP,我们可以通过DNS或者GNS来解析实现。其中DNS大家都很熟悉,这里不多说。GNS(Grid Naming Service)则是Oracle 11g R2的新功能,可以通过DHCP服务为节点和SCAN分配VIP和SCAN IP。另外还有个优点是,对于新加入集群的节点,它会自动分配VIP地址,更新集群资源,客户端依然通过SCAN特性负载均衡地连接到新增集群节点上。DNS和GNS配置与解析相关内容在下面还有说明。
除了DNS和GNS解析方法外,SCAN也可以使用hosts文件来解析,但用过的人都知道,此方法不仅在安装RAC的时候产生问题,后期使用也是存在问题的,比如SCAN域名只能定义一个SCAN IP。所以这种方法也是Oracle不推荐使用的。但尽管如此,很多生产上依然这样使用,也就是废弃了11g的新特性SCAN,而是依然采用VIP连接方式。
SCAN ip 工作原理:
通过DNS配置SCAN IP:
以下案例是在Linux环境下配置DNS服务器:
步骤:
1、 安装必要软件
[root@Dns_master/]# yum install bind bind-chroot caching-nameserver –y
….
Installed:
bind.i38630:9.3.6-4.P1.el5_4.2
bind-chroot.i386 30:9.3.6-4.P1.el5_4.2 (可以不安装)
caching-nameserver.i386 30:9.3.6-4.P1.el5_4.2
2、 配置
1)修改主配置文件
[root@Dns_master /]# cd/var/named/chroot/
[root@Dns_masterchroot]# pwd
/var/named/chroot
[root@Dns_masterchroot]# ls
dev etc var
[root@Dns_masterchroot]# cd etc/
[root@Dns_masteretc]# ls
localtime named.caching-nameserver.conf named.rfc1912.zones rndc.key
[root@Dns_master etc]# vi named.caching-nameserver.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";
// Those options should be used carefully because they disable port
// randomization
// query-source port 53;
// query-source-v6 port 53;
allow-query { any; }; #查询地址
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
view any_resolver {
match-clients { any; }; #客户端
match-destinations { any; }; #查询目的地址
recursion yes;
include "/etc/named.rfc1912.zones";
};
2)声明一个域
[root@Dns_masteretc]# pwd
/var/named/chroot/etc
[root@Dns_masteretc]# ls
localtime named.caching-nameserver.conf named.rfc1912.zones rndc.key
[root@Dns_master etc]# vi named.rfc1912.zones
zone "." IN {
type hint;
file "named.ca";
};
zone "localdomain" IN {
type master;
file "localdomain.zone";
allow-update { none; };
};
zone "cuug.net" IN {
type master;
file "cuug.zone";
notify no;
};
zone "8.168.192.in-addr.arpa" IN {
type slave;
file "192.zone";
notify no;
};
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; };
};
3)建立对应的正解和反向区域文件
[root@Dns_masteretc]# cd ../var/named/
[root@Dns_masternamed]# pwd
/var/named/chroot/var/named
[root@Dns_masternamed]# ls
data localhost.zone named.ca named.local slaves
localdomain.zone named.broadcast named.ip6.local named.zero
正向解析文件:
[root@Dns_master named]# cat cuug.zone
$TTL 86400
@ IN SOA dns.cuug.net. root.mail.cuug.net. (
1997022700 ; Serial
28800 ; Refresh - 3 hours
14400 ; Retry - 1 hour
3600000 ; Expire - 1 week
86400) ; Minimum - 1 day
IN NS dns.cuug.net.
IN MX 10 mail.cuug.net.
dns IN A 192.168.8.240
scan IN A 192.168.8.100
scan IN A 192.168.8.101
scan IN A 192.168.8.102
反向解析文件:
[root@Dns_master named]# cat 192.zone
$TTL 86400
@ IN SOA dns.cuug.net. root.mail.cuug.net. (
1997022700 ; Serial
28800 ; Refresh - 3 hours
14400 ; Retry - 1 hour
3600000 ; Expire - 1 week
86400) ; Minimum - 1 day
IN NS dns.cuug.net.
IN MX 10 mail.cuug.net.
240 IN PTR dns.cuug.net.
100 IN PTR scan.cuug.net.
101 IN PTR scan.cuug.net.
102 IN PTR scan.cuug.net.
本机反向解析库文件:
net.127
$TTL 86400
@ IN SOA localhost. root.localhost. (
1997022700 ; Serial
28800 ; Refresh - 3 hours
14400 ; Retry - 1 hour
3600000 ; Expire - 1 week
86400) ; Minimum - 1 day
IN NS localhost.
1 IN PTR localhost.
本机正向解析库文件:
net.local
$TTL 86400
@ IN SOA localhost. root.localhost. (
1997022700 ; Serial
28800 ; Refresh - 3 hours
14400 ; Retry - 1 hour
3600000 ; Expire - 1 week
86400) ; Minimum - 1 day
IN NS localhost.
localhost IN A 127.0.0.1
4)修改区域文件的权限
[root@Dns_master named]# chown :named cuug.zone
[root@Dns_master named]# chown :named 192.zone
5)检查配置文件语法
[root@Dns_master named]#named-checkconf ###检测配置文件是否有语法错误
[root@Dns_master named]#named-checkzone cuug.net cuug.zone
zonelinuxidc/IN: loaded serial 42
OK
3、重新启动named服务
[root@Dns_master named]# service named restart
停止 named: [确定]
启动 named: [确定]
4、测试
首先添加DNS服务器记录
编辑nsswitch.conf 添加dns解析
[root@Dns_master named]# vi /etc/nsswitch.conf
在hosts: dns files 增加DNS解析
[root@Dns_masternamed]# cat /etc/resolv.conf
nameserver192.168.8.240
[root@Dns_masternamed]# host scan.cuug.net
scan.cuug.net has address 192.168.1.100
scan.cuug.net has address 192.168.1.100
scan.cuug.net has address 192.168.1.100
@至此,通过DNS解析scan ip成功!
[转]Oracle 11g RAC SCAN ip的原理及配置
标签:sky eve 声明 include service 编辑 target default access
原文地址:http://www.cnblogs.com/wlzjdm/p/6700678.html