您好,登錄后才能下訂單哦!
Oracle 11g RAC SCAN ip的原理及配置
Oracle 11g RAC網(wǎng)格即插即用(GPnP)工作原理:
SCAN概念:
先介紹一下什么叫SCAN,SCAN(Single Client Access Name)是Oracle從11g R2開(kāi)始推出的,客戶(hù)端可以通過(guò)SCAN特性負(fù)載均衡地連接到RAC數(shù)據(jù)庫(kù)。SCAN提供一個(gè)域名來(lái)訪(fǎng)問(wèn)RAC,域名可以解析1個(gè)到3個(gè)(注意,最多3個(gè))SCAN IP,我們可以通過(guò)DNS或者GNS來(lái)解析實(shí)現(xiàn)。其中DNS大家都很熟悉,這里不多說(shuō)。GNS(Grid Naming Service)則是Oracle 11g R2的新功能,可以通過(guò)DHCP服務(wù)為節(jié)點(diǎn)和SCAN分配VIP和SCAN IP。另外還有個(gè)優(yōu)點(diǎn)是,對(duì)于新加入集群的節(jié)點(diǎn),它會(huì)自動(dòng)分配VIP地址,更新集群資源,客戶(hù)端依然通過(guò)SCAN特性負(fù)載均衡地連接到新增集群節(jié)點(diǎn)上。DNS和GNS配置與解析相關(guān)內(nèi)容在下面還有說(shuō)明。
除了DNS和GNS解析方法外,SCAN也可以使用hosts文件來(lái)解析,但用過(guò)的人都知道,此方法不僅在安裝RAC的時(shí)候產(chǎn)生問(wèn)題,后期使用也是存在問(wèn)題的,比如SCAN域名只能定義一個(gè)SCAN IP。所以這種方法也是Oracle不推薦使用的。但盡管如此,很多生產(chǎn)上依然這樣使用,也就是廢棄了11g的新特性SCAN,而是依然采用VIP連接方式。
SCAN ip 工作原理:
通過(guò)DNS配置SCAN IP:
以下案例是在Linux環(huán)境下配置DNS服務(wù)器:
步驟:
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; }; #監(jiān)聽(tīng)端口
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; }; #查詢(xún)地址
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
view any_resolver {
match-clients { any; }; #客戶(hù)端
match-destinations { any; }; #查詢(xún)目的地址
recursion yes;
include "/etc/named.rfc1912.zones";
};
2)聲明一個(gè)域
[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)建立對(duì)應(yīng)的正解和反向區(qū)域文件
[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.
本機(jī)反向解析庫(kù)文件:
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.
本機(jī)正向解析庫(kù)文件:
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)修改區(qū)域文件的權(quán)限
[root@Dns_master named]# chown :named cuug.zone
[root@Dns_master named]# chown :named 192.zone
5)檢查配置文件語(yǔ)法
[root@Dns_master named]#named-checkconf ###檢測(cè)配置文件是否有語(yǔ)法錯(cuò)誤
[root@Dns_master named]#named-checkzone cuug.net cuug.zone
zonelinuxidc/IN: loaded serial 42
OK
3、重新啟動(dòng)named服務(wù)
[root@Dns_master named]# service named restart
停止 named: [確定]
啟動(dòng) named: [確定]
4、測(cè)試
首先添加DNS服務(wù)器記錄
編輯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
@至此,通過(guò)DNS解析scan ip成功!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀(guān)點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。