In a Hadoop cluster, use DNS instead of hosts to access the server.
1. Installing the BIND software
Run with the root user:
Yum-y Install bind*
2. Configuring the named.conf file
Vi/etc/named.conf
Modify the following sections:
Listen-on Port: (any;};
allow-query {any;};
After the modification, continue to modify another file under/etc.
3. Add forward and reverse domain names
VI/etc/Named.rfc1912.zoneszone"."In {type master; file "Hadoop.com.zone"; allow-update {none;};}; Zone"44.168.192.in-addr.arpa"In {type master; file "192.168.44.zone"; allow-update {none;};};
4. Edit forward and reverse two files
vim/var/named/hadoop.com.zone$ttl 1d@ in SOA com. root.hadoop.com. ( 0; serial 1D; Refresh 1H ; Retry 1W; Expire 3H); Minimum NS @ A127.0.0.1AAAA::1Master in A192.168.44.1Secondarynamenode in A192.168.44.2admin in A192.168.44.3Hadoop01 in A192.168.44.4hadoop02 in A192.168.44.5hadoop03 in A192.168.44.6hadoop04 in A192.168.44.7hadoop05 in A192.168.44.8hadoop06 in A192.168.44.9hadoop07 in A192.168.44.10hadoop08 in A192.168.44.11hadoop09 in A192.168.44.12Hadoop10 in A192.168.44.13hadoop11 in A192.168.44.14HADOOP12 in A192.168.44.15hadoop13 in A192.168.44.16hadoop14 in A192.168.44.17HADOOP15 in A192.168.44.18hadoop16 in A192.168.44.19
vim/var/named/192.168.44.zone$TTL86400@ in SOA hadoop.com. root.hadoop.com. (1997022700 ; Serial28800 ; Refresh14400 ; Retry3600000 ; Expire86400 ) ; minimum@ in NS Hadoop.1In PTR master.2In PTR Secondarynamenode.3In PTR admin.4In PTR hadoop01.5In PTR hadoop02.6In PTR hadoop03.7In PTR hadoop04.8In PTR hadoop05.9In PTR hadoop06.TenIn PTR hadoop07. OneIn PTR hadoop08. AIn PTR hadoop09. -In PTR hadoop10. -In PTR hadoop11. theIn PTR hadoop12. -In PTR hadoop13. -In PTR hadoop14. -In PTR hadoop15. +In PTR hadoop16.
5. Restart the BIND service
Service bind restart
Intranet configuration DNS server, no domain name, only host name