熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Oracle >> 正文

Oracle 11g R2 RAC:配置DNS解析SCAN VIP

2022-06-13   來源: Oracle 

  Oracle gRGrid Infrastructure (CRS) 中引入了 Single Client Access Name (SCAN) 來簡化客戶端對數據庫服務的訪問
    本文將詳細介紹如何配置 DNS 來解析 SCAN VIP
演示環境
    OracleEnterprise Linux
安裝 DNS Server
    rpm ivhbindPelirpm
    rpm ivhbindchrootPelirpm
    rpm ivhcachingnameserverPelirpm
    DNS的守護進程
    /usr/sbin/named
    /usr/sbin/rndc
    DNS的腳本
    /etc/initd/named
    DNS的端口
           (tcp udp)
    DNS的配置文件
    /var/named/chroot/etc/nf(主配置文件)
    /var/named/chroot/*
配置 DNS Server
    創建主配置文件 nf
    [root@rac Server]#cd /var/named/chroot/etc
    [root@rac etc]# lslt
    total
    rwr rootnamed  Jun  : rndckey
    rwr rootnamed Jan   namedcanf
    rwr rootnamed  Jan   namedrfczones
    rwrr rootroot  Feb   localtime
    [root@rac etc]#more namedcanf
    //
    //namedcanf
    //
    // Provided by RedHat cachingnameserver package to configure the
    // ISC BIND named()DNS server as a caching only nameserver
    // (as a localhostDNS resolver only)
    //
    // See/usr/share/doc/bind*/sample/ for example named configuration files
    //
    // DONOT EDIT THIS FILE use systemconfigbind or an editor
    // tocreate nf edits to this file will be lost on
    // cachingnameserver package upgrade
    //
    創建 nf 配置文件
    [root@rac etc]# cpp namedcanf nf
    [root@rac etc]# lslt
    total
    rwr rootnamed  Jun  : rndckey
    rwr rootnamed Jan   namedcanf
    rwr rootnamed Jan   nf
    rwr rootnamed  Jan   namedrfczones
    rwrr rootroot  Feb   localtime
    編輯剛剛創建的 nf 文件按照如下方式修改
    listenon port { ; };
    allowquery { localhost; };
    matchclients { localhost; };
    matchdestinations { localhost; };
    allowquerycache { localhost; };
    將上述entry中的 host 信息全部修改為 any注意保留源文件中的空格
    配置正向解析和反向解析 zone
    配置正向解析 zone
    [root@rac etc]# vinamedrfczones
    zone IN {
    type master;
    file racoraclezone;
    allowupdate { none; };
    };

  配置反向解析 zone
    [root@rac etc]# vinamedrfczones
    zoneinaddrarpa IN {
    type master;
    file racoraclelocal;
    allowupdate { none; };
    };
    這裡需要注意的是反向解析從左到右讀取ip地址時是以相反的方向解釋的所以需要將ip地址反向排列這裡*網段的反向解析域名為inaddrarpa
    利用模板文件創建用於正向解析和反向解析數據庫文件
    [root@rac etc]# cd/var/named/chroot/var/named
    [root@rac named]#ls lt
    total
    rwr root  named  Jan localdomainzone
    rwr root  named  Jan localhostzone
    rwr root  named  Jan namedbroadcast
    rwr root  named Jan   namedca
    rwr root  named  Jan namediplocal
    rwr root  named  Jan namedlocal
    rwr root  named  Jan namedzero
    drwxrwx namednamed Aug   data
    drwxrwx namednamed Jul   slaves
    創建正向解析數據庫文件
    [root@racnamed]#  cp p localhostzoneracoraclezone
    創建方向解析數據庫文件
    [root@racnamed]#  cp p namedlocalracoraclelocal
    配置正向解析數據庫文件
    [root@rac named]#vim racoraclezone
    $TTL
    @ IN SOA (
    ; serial (d adams)
    H ; refresh
    M ; retry
    W ; expiry
    D ) ; minimum
    IN NS
    racscan IN A
    racscan IN A
    racscan IN A
    注意無論RAC有多少節點SCAN VIP 的個數只能有
    配置反向解析數據庫文件
    [root@rac named]#vim racoraclelocal
    $TTL
    @ IN SOA
    ; Serial
    ; Refresh
    ; Retry
    ; Expire
    ) ; Minimum
    IN NS
    IN PT
    IN PT
    IN PT
    注意
    () 數字寫IP 地址的最後一個 就寫
    () racscan 後面有一個點
    重啟 DNS Server
    [root@rac named]#service named restart
    Stopping named:[  OK ]
    Starting named:[  OK ]
    配置 DNS 客戶端
    [root@rac named]#more /etc/nf
    #search
    #nameserver
    nameserver
    注意如有必要刻意修改 /etc/nf 文件配置主機解析方式
    驗證 DNS 配置
    [root@rac named]#nslookup
    Server:        
    Address:        #
    inaddrarpa       name =
    [root@rac named]#cd /var/named/chroot/var/named
    [root@rac named]#nslookup racscan
    Server:        
    Address:        #
    Name:  
    Address:
    Name:  
    Address:
    Name:  
    Address:
    [root@rac named]#nslookup
    Server:        
    Address:        #
    Name:  
    Address:
    Name:  
    Address:
    Name:  
    Address:
    [root@rac named]#nslookup
    Server:        
    Address:        #
    inaddrarpa       name =
    #eth PUBLIC
    rac
    rac
    #VIP
    racvip
    racvip
    #eth PRIVATE
    racpriv
    racpriv


From:http://tw.wingwit.com/Article/program/Oracle/201311/18492.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.