Oracle 在RAC中使用DNS与DHCP

通常,我们在搭建RAC的时候,习惯把相关的IP配置在每个节点上的/etc/hosts文件当中。然而在12c当中,虽然也可以把相关的IP同样配置在每个节点上的/etc/hosts文件中,但是在进行安装预检测的时候,它要求不单是对SCAN的解析,同样它还要求对每个节点的HOSTNAME及VIP进行解析。在安装Flex Cluster的时候,要求配置GNS,同时也就汲到了DHCP。其实,这些要求是合理的,因为虽着节点数的增加,使用DNS与DHCP管理IP及hostname已成为必然。

在http://blog.163.com/donfang_jianping/blog/static/13647395120152283914534/中,我们介绍了12c RAC的搭建。这里,我们再来看一下使用DNS进行RAC的搭建。

首先,需要配置DNS服务器。
该DNS服务器用来解析,每个节点的hostname,hostname-vip及SCAN。配置过程如下:
需要安装如下RPM包:
[root@12c-dns ~]# rpm -qa | grep bind
bind-utils-9.8.2-0.17.rc1.el6_4.6.x86_64
bind-libs-9.8.2-0.17.rc1.el6_4.6.x86_64
bind-9.8.2-0.17.rc1.el6_4.6.x86_64
[root@12c-dns ~]# 
配置/etc/named.conf:
[root@12c-dns ~]# cat /etc/named.conf
options {
        directory "/var/named";
};
zone "88.168.172.IN-ADDR.ARPA" IN {
        type master;
        file "172.168.88.db";
};
zone "space.com." IN {
        type master;
        file "space.com.db";
};
[root@12c-dns ~]# 
在/va/named目录下,配置对应的域及反向解析:
[root@12c-dns ~]# cat /var/named/space.com.db 
$TTL 1H
@   IN    SOA   12c-dns.space.com.      root.homeserver.localdomain. (5
                                                        3H
                                                        1H
                                                        1W
                                                        1H)
@       IN      NS      12c-dns.space.com.
12c-dns                 IN      A       172.168.88.254
djp01                   IN      A       172.168.88.10
djp02                   IN      A       172.168.88.11
djp-cluster-gns         IN      A       172.168.88.200
djp                     IN      NS      djp-cluster-gns
[root@12c-dns ~]# cat /var/named/172.168.88.db 
$TTL 1H
@   IN    SOA     12c-dns.space.com. root.homeserver.localdomain.space.com. ( 2
                                        1H
                                        1H
                                        1W
                                        1H )
@       IN      NS      12c-dns.space.com.
254     IN      PTR     12c-dns.space.com.
10      IN      PTR     djp01.space.com.
11      IN      PTR     djp02.space.com.
200     IN      PTR     djp-cluster-gns.space.com
[root@12c-dns ~]# 

配置dhcp服务。
首先需要安装如下rpm包:
[root@12c-dns ~]# rpm -qa | grep dhcp
dhcp-common-4.1.1-38.P1.el6.x86_64
dhcp-4.1.1-38.P1.el6.x86_64
[root@12c-dns ~]# 
配置/etc/dhcp/dhcpd.conf:
[root@12c-dns ~]# cat /etc/dhcp/dhcpd.conf 
#
# DHCP Server Configuration file.
#   see /usr/share/doc/dhcp*/dhcpd.conf.sample
#   see 'man 5 dhcpd.conf'
#
ddns-update-style               interim;
ignore client-updates;
subnet 172.168.0.0 netmask 255.255.0.0 {
        range 172.168.88.201 172.168.88.253;
        option subnet-mask 255.255.0.0;
        option domain-name "space.com";
        option domain-name-servers      172.168.88.254;
}
[root@12c-dns ~]# 

配置每个节点的/etc/resolve.conf,用来指定DNS。
[root@djp01 ~]# cat /etc/resolv.conf 
options attempts: 2
options timeout: 1
search space.com        djp.space.com
nameserver 172.168.88.254
[root@djp01 ~]# 
同样在节点djp02上进行配置。

验证。
 [root@djp01 ~]# nslookup djp01
Server:         172.168.88.254
Address:        172.168.88.254#53

Name:   djp01.space.com
Address: 172.168.88.10

[root@djp01 ~]# nslookup djp02
Server:         172.168.88.254
Address:        172.168.88.254#53

Name:   djp02.space.com
Address: 172.168.88.11

[root@djp01 ~]# nslookup djp-cluster-gns
Server:         172.168.88.254
Address:        172.168.88.254#53

Name:   djp-cluster-gns.space.com
Address: 172.168.88.200

[root@djp01 ~]# 
同样,在另外一个节点上进行验证。

不要忘记把private IP写到/etc/hosts中。
root@djp01 ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

#Private IP (eth1)
192.168.88.1    djp01-priv.space.com djp01-priv
192.168.88.2    djp02-priv.space.com djp02-priv

[root@djp01 ~]# 

RAC安装环境的检测。
[grid@djp01 grid]$ ./runcluvfy.sh stage -pre crsinst -n djp01,djp02 -fixup -verbose
执行该脚本进行环境的检测,其中有如下一项,
Checking integrity of file "/etc/resolv.conf" across nodes

Checking the file "/etc/resolv.conf" to make sure only one of 'domain' and 'search' entries is defined
"domain" and "search" entries do not coexist in any "/etc/resolv.conf" file
Checking if 'domain' entry in file "/etc/resolv.conf" is consistent across the nodes...
"domain" entry does not exist in any "/etc/resolv.conf" file
Checking if 'search' entry in file "/etc/resolv.conf" is consistent across the nodes...
Checking file "/etc/resolv.conf" to make sure that only one 'search' entry is defined
More than one "search" entry does not exist in any "/etc/resolv.conf" file
All nodes have same "search" order defined in file "/etc/resolv.conf"
Checking DNS response time for an unreachable node
  Node Name                             Status                  
  ------------------------------------  ------------------------
  djp01                                 passed                  
  djp02                                 passed                  
The DNS response time for an unreachable node is within acceptable limit on all nodes
checking DNS response from all servers in "/etc/resolv.conf"
checking response for name "djp02" from each of the name servers specified in "/etc/resolv.conf"
  Node Name     Source                    Comment                   Status    
  ------------  ------------------------  ------------------------  ----------
  djp02         172.168.88.254            IPv4                      passed    
checking response for name "djp01" from each of the name servers specified in "/etc/resolv.conf"
  Node Name     Source                    Comment                   Status    
  ------------  ------------------------  ------------------------  ----------
  djp01         172.168.88.254            IPv4                      passed    

Check for integrity of file "/etc/resolv.conf" passed
该项检测通过,证明DNS配置完整。

grid的安装。
安装到“http://blog.163.com/donfang_jianping/blog/static/13647395120152283914534/”中描述的第4步时,在“SCAN name”里面输入djp-cluster-scan.djp.space.com(这里的名称只是SCAN名称,不要错输入为djp-cluster-gns.space.com),勾选“Configure nodes Virtual IPs as assigned by the Dynamic Networks”,在“GNS VIP address”中输入172.168.88.200,在“GNS Sub Domain”中输入djp.space.com(就是上述DNS中的子域)。
在“第五步”中在“Public Hostname”中输入djp02.space.com,“Virtual Hostname”为“AUTO”。
安装完成以后,运行root.sh脚本即可。

下面,我们来看一下RAC中的几个IP。

集群资源查看:
[root@djp01 bin]# ./crsctl status res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ASMNET1LSNR_ASM.lsnr
               ONLINE  ONLINE       djp01                    STABLE
               ONLINE  ONLINE       djp02                    STABLE
ora.LISTENER.lsnr
               ONLINE  ONLINE       djp01                    STABLE
               ONLINE  ONLINE       djp02                    STABLE
ora.OCRDG.dg
               ONLINE  ONLINE       djp01                    STABLE
               ONLINE  ONLINE       djp02                    STABLE
ora.net1.network
               ONLINE  ONLINE       djp01                    STABLE
               ONLINE  ONLINE       djp02                    STABLE
ora.ons
               ONLINE  ONLINE       djp01                    STABLE
               ONLINE  ONLINE       djp02                    STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       djp02                    STABLE
ora.LISTENER_SCAN2.lsnr
      1        ONLINE  ONLINE       djp01                    STABLE
ora.LISTENER_SCAN3.lsnr
      1        ONLINE  ONLINE       djp01                    STABLE
ora.MGMTLSNR
      1        OFFLINE OFFLINE                               STABLE
ora.asm
      1        ONLINE  ONLINE       djp01                    Started,STABLE
      2        ONLINE  ONLINE       djp02                    Started,STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.cvu
      1        ONLINE  ONLINE       djp01                    STABLE
ora.djp01.vip
      1        ONLINE  ONLINE       djp01                    STABLE
ora.djp02.vip
      1        ONLINE  ONLINE       djp02                    STABLE
ora.gns
      1        ONLINE  ONLINE       djp02                    STABLE
ora.gns.vip
      1        ONLINE  ONLINE       djp02                    STABLE
ora.oc4j
      1        ONLINE  ONLINE       djp01                    STABLE
ora.scan1.vip
      1        ONLINE  ONLINE       djp02                    STABLE
ora.scan2.vip
      1        ONLINE  ONLINE       djp01                    STABLE
ora.scan3.vip
      1        ONLINE  ONLINE       djp01                    STABLE
--------------------------------------------------------------------------------
[root@djp01 bin]# 

节点VIP查看:
[root@djp01 bin]# ./srvctl config nodeapps
Network 1 exists
Subnet IPv4: 172.168.0.0/255.255.0.0/eth0, dhcp
Subnet IPv6: 
Ping Targets: 
Network is enabled
Network is individually enabled on nodes: 
Network is individually disabled on nodes: 
VIP exists: network number 1, hosting node djp01
VIP IPv4 Address: -/djp01-vip/172.168.88.204
VIP IPv6 Address: 
VIP is enabled.
VIP is individually enabled on nodes: 
VIP is individually disabled on nodes: 
VIP exists: network number 1, hosting node djp02
VIP IPv4 Address: -/djp02-vip/172.168.88.208
VIP IPv6 Address: 
VIP is enabled.
VIP is individually enabled on nodes: 
VIP is individually disabled on nodes: 
ONS exists: Local port 6100, remote port 6200, EM port 2016, Uses SSL false
ONS is enabled
ONS is individually enabled on nodes: 
ONS is individually disabled on nodes: 
[root@djp01 bin]# 

SCAN信息查看:
[root@djp01 bin]# ./srvctl config scan
SCAN name: djp-cluster-scan.djp.space.com, Network: 1
Subnet IPv4: 172.168.0.0/255.255.0.0/eth0, dhcp
Subnet IPv6: 
SCAN 0 IPv4 VIP: -/scan1-vip/172.168.88.205
SCAN VIP is enabled.
SCAN VIP is individually enabled on nodes: 
SCAN VIP is individually disabled on nodes: 
SCAN 1 IPv4 VIP: -/scan2-vip/172.168.88.211
SCAN VIP is enabled.
SCAN VIP is individually enabled on nodes: 
SCAN VIP is individually disabled on nodes: 
SCAN 2 IPv4 VIP: -/scan3-vip/172.168.88.209
SCAN VIP is enabled.
SCAN VIP is individually enabled on nodes: 
SCAN VIP is individually disabled on nodes: 
[root@djp01 bin]#
SCAN名称的解析:
[root@djp01 bin]# nslookup djp-cluster-scan
Server:         172.168.88.254
Address:        172.168.88.254#53

Non-authoritative answer:
Name:   djp-cluster-scan.djp.space.com
Address: 172.168.88.209
Name:   djp-cluster-scan.djp.space.com
Address: 172.168.88.207
Name:   djp-cluster-scan.djp.space.com
Address: 172.168.88.205
Name:   djp-cluster-scan.djp.space.com
Address: 172.168.88.206
Name:   djp-cluster-scan.djp.space.com
Address: 172.168.88.211

[root@djp01 bin]# 

GNS信息查看:
[root@djp01 bin]# ./srvctl config gns
GNS is enabled.
GNS VIP addresses: 172.168.88.200
Domain served by GNS: djp.space.com
[root@djp01 bin]#
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值