Oracle12cRAC cluster uses GNS for SCAN

Source: Internet
Author: User
Tags dnssec nslookup

Oracle12cRAC cluster uses GNS for SCAN

 

1 Description

 

In the previous Blog, there were three methods for configuring SCAN in RAC:

(1)/etc/hosts

(2) DNS

(3) GNS

 

The specific link is as follows:

Oracle RAC cluster SCAN description

Http://blog.csdn.net/tianlesoftware/article/details/42712979

 

Oracle 12c RAC cluster uses DNS for SCAN

Http://blog.csdn.net/tianlesoftware/article/details/42917867

 

Modify SCAN configurations in Oracle 12c RAC

Http://blog.csdn.net/tianlesoftware/article/details/42919785

 

If you use GNS for SCAN, you need to configure DNS and DHCP. The entire RAC architecture also changes.

 

In our traditional architecture, public ip, private ip, and VIP are pre-allocated. However, if GNS is used for SCAN, you only need to fix PRIVATEIP and public ip, the VIP and scan ip addresses are dynamically obtained by GNS from DHCP.

 

 

The following table lists IP Address Allocation for RAC setup in this test.

 

Node

Public IP

Private IP

VIP

SCAN VIP

GNS VIP

SCAN

Rac1

192.168.56.5

192.168.57.5

Dynamic Allocation from DHCP

Dynamic Allocation from DHCP

192.168.56.201

Resolved by DNS

Obtained from DHCP and resolved by GNS

Rac2

192.168.56.6

192.168.57.6

Dns/dhcp

192.168.56.200

 

 

2 install and configure DNS

 

2.1 install DNS

 

Installation:

[Root@rac1yum.repos.d] # yum search bind-

Loadedplugins: refresh-packagekit, security

========================================================== ======================================== N/S Matched: bind-= ====================================

Bind-chroot.x86_64: A chroot runtime environment for the isc bind dns server, named (8)

Bind-devel.i686: Header files and libraries needed for bind dns development

Bind-devel.x86_64: Header files and libraries needed for bind dns development

Bind-dyndb-ldap.x86_64: LDAP back-end plug-in for BIND

Bind-libs.x86_64: Libraries used by the bind dns packages

Bind-libs.i686: Libraries used by the bind dns packages

Bind-sdb.x86_64: BIND server with database backends and DLZ support

Bind-utils.x86_64: Utilities for querying DNS name servers

 

[Root @ rac1sbin] # yum install bind-chroot.x86_64

 

The dependent package is automatically resolved.

 

[Root @ rac1etc] # rpm-qa | grep "^ bind"

Bind-chroot-9.8.2-0.30.rc1.el6.x86_64

Bind-9.8.2-0.30.rc1.el6.x86_64

Bind-libs-9.8.2-0.30.rc1.el6.x86_64

Bind-utils-9.8.2-0.30.rc1.el6.x86_64

[Root @ rac1etc] #

 

 

2.2 configure DNS

After the bind is installed, the main configuration file of bind is/etc/named. conf; the region configuration file is/etc/named. rfc1912.zones; and the region configuration file is under/var/named;

 

 

2.2.1 modify the name. conf file

 

 

[Root @ davedns ~] # Cat/etc/named. conf

//

// Named. conf

//

// Provided by Red Hat bind package to configure the ISC BINDnamed (8) DNS

// Server as a caching only nameserver (as a localhost DNS resolveronly ).

//

// See/usr/share/doc/bind */sample/for example named configurationfiles.

//

 

Options {

// Listen-onport 53 {127.0.0.1;}; the default listening IP address is 127.0.0.1, which must be commented out.

// Listen-on-v6port 53 {:: 1 ;}; comment out

Directory "/var/named"; directory of the region configuration file

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 ";

// Allow-query {localhost;}; IP address of the client that can be queried. The default value is local, Which is commented out.

 

Recursionyes; Whether to enable iterative Query

 

Dnssec-enable yes;

Dnssec-validationyes;

Dnssec-lookasideauto;

 

/* Path to ISC DLVkey */

Bindkeys-file "/etc/named. iscdlv. key ";

 

Managed-keys-directory "/var/named/dynamic ";

};

 

Logging {

Channel default_debug {

File "data/named. run ";

Severitydynamic;

};

};

 

// Comment out the original file and add the file again.

Zone "." IN {

Type hint;

// File "named. ca ";

File "/dev/null ";

};

 

Include "/etc/named. rfc1912.zones ";

Include "/etc/named. root. key ";

 

 

2.2.2 configure forward/reverse resolution Zone

 

Modify the Zone file:/etc/named. rfc1912.zones and add the Zone definition for forward and reverse resolution.

 

-- Configure forward resolution Zone

Zone "cndba.cn" IN {

Typemaster;

File "cndba.cn. zone ";

Allow-update {none ;};

};

 

-- Configure reverse resolution Zone

Zone "56.168.192.in-addr. arpa" IN {

Typemaster;

File "56.168.192.local ";

Allow-update {none ;};

};

 

Note that reverse resolution reads IP addresses from left to right in the opposite direction, so you need to sort the IP addresses in reverse order. Here, the reverse resolution domain name of 192.168.56. * network segment is "56.168.192.in-addr. arpa ".

 

 

2.2.3 configure the region file for forward resolution

 

In the previous name. conf configuration, the specified region file directory is/var/named. Therefore, create a forward resolved regional file in this directory.

 

The file name is the file name defined in Zone.

 

[Root @ davedns ~] # Touch/var/named/cndba.cn. zone

 

 

Add the following content:

$ TTL 86400

@ In soa dns.cndba.cn. root.cndba.cn .(

42; serial (d. adams)

3 H; refresh

15 M; retry

1 W; expiry

1D); minimum

In ns dns.cndba.cn.

Dns in a 192.168.56.200

Gns in a 192.168.56.201

$ ORIGINcndba.cn.

@ In ns gns.cndba.cn.

 

 

2.2.4 configure the reverse resolution region File

 

Create a reverse resolution region file in the/var/named directory. The file name is also defined in the previous Zone: 56.168.192.local.

 

[Root @ davedns ~] # Touch/var/named/56.168.192.local

 

Add the following content:

 

$ TTL 86400

@ In soa dns.cndba.cn. root.cndba.cn .(

1997022700; Serial

28800; Refresh

14400; Retry

3600000; Expire

86400); Minimum

In ns dns.cndba.cn.

200 in ptr dns.cndba.cn.

201 in ptr gns.cndba.cn.

 

 

2.2.5 restart DNS

[Root @ davedns ~] # Chkconfig named on

 

[Root @ davedns ~] # Service named restart

Stoppingnamed:. [OK]

Startingnamed: [OK]

[Root @ rac2named] #

 

 

2.2.6 verify DNS

Add the following content to the/etc/resolv. conf file of all nodes:

 

[Root @ rac1 ~] # Cat/etc/resolv. conf

# Generated by NetworkManager

Nameserver192.168.56.200

Nameserver192.168.56.201

Optionsrotate

Optionstimeout: 2

Optionsattempts: 5

 

[Root @ rac1 ~] #

[Root @ rac2 ~] # Nslookup dns.cndba.cn

Server: 192.168.56.200

Address: 192.168.56.200 #53

 

Name: dns.cndba.cn

Address: 192.168.56.200

 

[Root @ rac2 ~] # Nslookup gns.cndba.cn

Server: 192.168.56.200

Address: 192.168.56.200 #53

 

Name: gns.cndba.cn

Address: 192.168.56.201

 

[Root @ rac2 ~] #

 

[Root @ rac1 ~] # Nslookup gns.cndba.cn

Server: 192.168.56.200

Address: 192.168.56.200 #53

 

Name: gns.cndba.cn

Address: 192.168.56.201

 

[Root @ rac1 ~] # Nslookup dns.cndba.cn

Server: 192.168.56.200

Address: 192.168.56.200 #53

 

Name: dns.cndba.cn

Address: 192.168.56.200

 

[Root @ rac1 ~] #

 

 

3 install and configure DHCP

 

3.1 install DHCP

[Root @ davedns ~] # Yum install dhcp

 

[Root @ davedns ~] # Rpm-qa | grep "^ dhcp"

Dhcp-common-4.1.1-43.P1.el6.centos.x86_64

Dhcp-4.1.1-43.P1.el6.centos.x86_64

 

 

3.2 configure DHCP

 

[Root @ davedns ~] # Vim/etc/dhcp/dhcpd. conf

 

You can also directly Add the following content:

 

 

[Root @ davednsdhcp] # cat dhcpd. conf

#

# DHCPServer Configuration file.

# See/usr/share/doc/dhcp */dhcpd. conf. sample

# See 'man 5 dhcpd. conf'

 

Ddns-update-styleinterim;

Ignoreclient-updates;

 

Subnet192.168.56.0 netmask 255.255.255.0 {

 

Option routers 192.168.56.1;

Option subnet-mask limit 255.0;

 

Option nis-domain "cndba.cn ";

Option domain-name "cndba.cn ";

Option domain-name-servers 192.168.56.200;

 

Option time-offset-18000; # Eastern Standard Time

 

Range dynamic-bootp 192.168.56.100192.168.56.150;

Default-lease-time 21600;

Max-lease-time 43200;

}

 

[Root @ davednsdhcp] #

 

 

3.3 restart DHCP

 

[Root @ davednsdhcp] # chkconfig dhcpd on

 

[Root @ davednsdhcp] # chkconfig dhcpd -- list

Dhcpd 0: off 1: off 2: on 3: on 4: on 5: on 6: off

 

[Root @ davednsdhcp] # service dhcpd restart

Shuttingdown dhcpd: [OK]

Startingdhcpd: [OK]

[Root @ davednsdhcp] #

 

 

 

4. Install RAC

12 For detailed steps for installing cRAC, refer to the following link:

Oracle12c RAC construction manual

Http://blog.csdn.net/tianlesoftware/article/details/41675693

 

 

Here we post different places.

 

Modify the hosts file and comment out the vip configuration, which is dynamically obtained by the program.

 

[Root @ rac2 ~] # Cat/etc/hosts

127.0.0.1 localhost

 

192.168.56.5rac1

192.168.57.5rac1-priv

#192.168.56.7rac1-vip

 

192.168.56.6rac2

192.168.57.6rac2-priv

#192.168.56.8rac2-vip

 

# 192.168.56.9rac-scan

 

[Root @ rac2 ~] #

 

 

 

 

 

 

 

 

 

5. Verification

 

[Grid @ rac1grid] $ crs_stat-t

Name Type Target State Host

------------------------------------------------------------

Ora... SM. lsnrora... er. type ONLINE rac1

Ora... ER. lsnrora... er. type ONLINE rac1

Ora... AF. lsnrora... er. type OFFLINE

Ora... N1.lsnrora... er. type ONLINE rac2

Ora... N2.lsnrora... er. type ONLINE rac1

Ora... N3.lsnrora... er. type ONLINE rac1

Ora. MGMTLSNR ora... nr. type ONLINE rac1

Ora. OCR. dg ora... up. type ONLINE rac1

Ora. asm ora. asm. type ONLINE rac1

Ora. cvu ora. cvu. type ONLINE rac1

Ora. gns ora. gns. type ONLINE rac1

Ora. gns. vip ora... ip. type ONLINE rac1

Ora. mgmtdb ora... db. type ONLINE rac1

Ora... networkora... rk. type ONLINE rac1

Ora. Solaris ora. productname. type ONLINE rac1

Ora. ons ora. ons. type ONLINE rac1

Ora... C1.lsnrapplication ONLINE rac1

Ora. rac1.ons application ONLINE rac1

Ora. rac1.vip ora... t1.type ONLINE rac1

Ora... C2.lsnrapplication ONLINE rac2

Ora. rac2.ons application ONLINE rac2

Ora. rac2.vip ora... t1.type ONLINE rac2

Ora. scan1.vip ora... ip. type ONLINE rac2

Ora. scan2.vip ora... ip. type ONLINE rac1

Ora. scan3.vip ora... ip. type ONLINE rac1

[Grid @ rac1grid] $

 

[Grid @ rac1grid] $ crsctl stat res-t

--------------------------------------------------------------------------------

Name Target State Server Statedetails

--------------------------------------------------------------------------------

LocalResources

--------------------------------------------------------------------------------

Ora. ASMNET1LSNR_ASM.lsnr

ONLINE rac1 STABLE

ONLINE rac2 STABLE

Ora. LISTENER. lsnr

ONLINE rac1 STABLE

ONLINE rac2 STABLE

Ora. OCR. dg

ONLINE rac1 STABLE

ONLINE rac2 STABLE

Ora. net1.network

ONLINE rac1 STABLE

ONLINE rac2 STABLE

Ora. ons

ONLINE rac1 STABLE

ONLINE rac2 STABLE

--------------------------------------------------------------------------------

ClusterResources

--------------------------------------------------------------------------------

Ora. LISTENER_SCAN1.lsnr

1 ONLINE rac2 STABLE

Ora. LISTENER_SCAN2.lsnr

1 ONLINE rac1 STABLE

Ora. LISTENER_SCAN3.lsnr

1 ONLINE rac1 STABLE

Ora. MGMTLSNR

1 ONLINE rac1 169.254.236.113 192.

168.57.5, STABLE

Ora. asm

1 ONLINE rac1 Started, STABLE

2 ONLINE rac2 Started, STABLE

3 OFFLINE STABLE

Ora. cvu

1 ONLINE rac1 STABLE

Ora. gns

1 ONLINE rac1 STABLE

Ora. gns. vip

1 ONLINE rac1 STABLE

Ora. mgmtdb

1 ONLINE rac1 Open, STABLE

Ora. productname

1 ONLINE rac1 STABLE

Ora. rac1.vip

1 ONLINE rac1 STABLE

Ora. rac2.vip

1 ONLINE rac2 STABLE

Ora. scan1.vip

1 ONLINE rac2 STABLE

Ora. scan2.vip

1 ONLINE rac1 STABLE

Ora. scan3.vip

1 ONLINE rac1 STABLE

--------------------------------------------------------------------------------

[Grid @ rac1grid] $

 

 

[Grid @ rac1grid] $ srvctl config scan

SCANname: scan.cndba.cn, Network: 1

SubnetIPv4: 192.168.56.0/255.255.255.0/eth0, dhcp

SubnetIPv6:

SCAN 0IPv4 VIP:-/scan1-vip/192.168.56.101

SCANVIP is enabled.

SCANVIP is individually enabled on nodes:

SCANVIP is individually disabled on nodes:

SCAN 1IPv4 VIP:-/scan2-vip/192.168.56.102

SCANVIP is enabled.

SCANVIP is individually enabled on nodes:

SCANVIP is individually disabled on nodes:

SCAN 2IPv4 VIP:-/scan3-vip/192.168.56.103

SCANVIP is enabled.

SCANVIP is individually enabled on nodes:

SCANVIP is individually disabled on nodes:

[Grid @ rac1grid] $

 

Note that the IP address here is automatically obtained from DHCP.

 

 

[Grid @ rac1grid] $ srvctl config vip-node rac1

VIPexists: network number 1, hosting node rac1

VIPIPv4 Address:-/rac1-vip/192.168.56.100

VIPIPv6 Address:

VIP isenabled.

VIP isindividually enabled on nodes:

VIP isindividually disabled on nodes:

 

[Grid @ rac1grid] $ srvctl config vip-node rac2

VIPexists: network number 1, hosting node rac2

VIPIPv4 Address:-/rac2-vip/192.168.56.104

VIPIPv6 Address:

VIP isenabled.

VIP isindividually enabled on nodes:

VIP isindividually disabled on nodes:

[Grid @ rac1grid] $

 

Here, the same is true for VIPs, which are automatically obtained.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.