Configure SCAN DNS for RAC 11G RAC 12C using dnsmasq in OEL5, OEL6, OEL7
Configuration of network for virtualbox and RAC is always making a lot of trouble and raises many questions. In this article I’ll show how to setup network for RAC 11G, 12C using dnsmasq.Objectives to complete:
- full network setup for RAC
- public network
- private network
- SCAN settings resolved by dnsmasq
- full access to internet from each RAC hosts
- internet network
- configure dnsmasq
In my articles for RAC I usually have three network cards for each of my node with following settings on VirtualBox
Adapter1 – used for public RAC interface
Adapter2 – used for private RAC interface
Adapter3 – used for internet connections
and two host machines with following settings
- rac1.dbaora.com
- rac2.dbaora.com
public | private | vip | |
rac1 | 192.168.0.50 | 192.168.56.60 | 192.168.0.70 |
rac2 | 192.168.0.51 | 192.168.56.61 | 192.168.0.71 |
public | |
rac-scan | 192.168.0.20 192.168.0.21 192.168.0.22 |
So my entry in “/ect/hosts” looks following. As you can notice SCAN entries are commented and will be resolved via dnsmasq.
127.0.0.1 localhost.localdomain localhost #public 192.168.0.50 rac1 rac1.dbaora.com 192.168.0.51 rac2 rac2.dbaora.com #private 192.168.56.60 rac1-priv rac1-priv.dbaora.com 192.168.56.61 rac2-priv rac2-priv.dbaora.com #virtual 192.168.0.70 rac1-vip rac1-vip.dbaora.com 192.168.0.71 rac2-vip rac2-vip.dbaora.com #scan #192.168.0.20 rac-scan rac-scan.dbaora.com #192.168.0.21 rac-scan rac-scan.dbaora.com #192.168.0.22 rac-scan rac-scan.dbaora.comInstall and configure dnsmasq
1. To install dnsmasq run as root following command
yum install dnsmasq2. Configure dnsmasq
create new file “/etc/racdns” with settings for SCAN
[root@rac1 ~]# cat /etc/racdns #scan 192.168.0.20 rac-scan rac-scan.dbaora.com 192.168.0.21 rac-scan rac-scan.dbaora.com 192.168.0.22 rac-scan rac-scan.dbaora.commodify dnsmasq default configuration file “/etc/dnsmasq.conf”. One parameter addn-hosts should be changed to point to file “/etc/racdns”.
[root@rac1 ~]# cat /etc/dnsmasq.conf | grep addn-hosts addn-hosts=/etc/racdns3. Start dnsmasq
service dnsmasq start chkconfig dnsmasq on4. Next step is to resolve problem with file “/etc/resolv.conf”
I’m using third network card as NAT with DHCP so each time you restart network card or reboot host the file is overwritten with automatically generated settings. Nameserver points for 192.168.1.1 which is required to resolve internet entries but not enough to resolve SCAN settings via dnsmasq.
[root@rac1 ~]# cat /etc/resolv.conf # Generated by Networkmanager search dbaora.com nameserver 192.168.1.1As default dnsmasq is running on ip adress 127.0.0.1 so it requires following settings in “/etc/resolv.conf”.
[root@rac1 ~]# cat /etc/resolv.conf # Generated by Networkmanager nameserver 127.0.0.1 search dbaora.com nameserver 192.168.1.1You must protect the file from being automatically overwritten by host reboot, network card restart etc.
[root@rac1 ~]# chattr +i /etc/resolv.confVerification
It’s just running nslookup to verify all is working fine
rac-scan
[root@rac1 ~]# nslookup rac-scan Server: 127.0.0.1 Address: 127.0.0.1#53 Name: rac-scan.dbaora.com Address: 192.168.0.22 Name: rac-scan.dbaora.com Address: 192.168.0.20 Name: rac-scan.dbaora.com Address: 192.168.0.21 [root@rac1 ~]# nslookup rac-scan Server: 127.0.0.1 Address: 127.0.0.1#53 Name: rac-scan.dbaora.com Address: 192.168.0.20 Name: rac-scan.dbaora.com Address: 192.168.0.21 Name: rac-scan.dbaora.com Address: 192.168.0.22 [root@rac1 ~]# nslookup rac-scan Server: 127.0.0.1 Address: 127.0.0.1#53 Name: rac-scan.dbaora.com Address: 192.168.0.21 Name: rac-scan.dbaora.com Address: 192.168.0.22 Name: rac-scan.dbaora.com Address: 192.168.0.20rac1, rac2, rac1-priv, rac2-priv, rac1-vip, rac2-vip
[root@rac1 ~]# nslookup rac1 Server: 127.0.0.1 Address: 127.0.0.1#53 Name: rac1.dbaora.com Address: 192.168.0.50 [root@rac1 ~]# nslookup rac2 Server: 127.0.0.1 Address: 127.0.0.1#53 Name: rac2.dbaora.com Address: 192.168.0.51 [root@rac1 ~]# nslookup rac1-priv Server: 127.0.0.1 Address: 127.0.0.1#53 Name: rac1-priv.dbaora.com Address: 192.168.56.60 [root@rac1 ~]# nslookup rac2-priv Server: 127.0.0.1 Address: 127.0.0.1#53 Name: rac2-priv.dbaora.com Address: 192.168.56.61 [root@rac1 ~]# nslookup rac1-vip Server: 127.0.0.1 Address: 127.0.0.1#53 Name: rac1-vip.dbaora.com Address: 192.168.0.70 [root@rac1 ~]# nslookup rac2-vip Server: 127.0.0.1 Address: 127.0.0.1#53 Name: rac2-vip.dbaora.comAddress: 192.168.0.71
No comments:
Post a Comment