When we build a hadoop fully distributed cluster today,When centos is started, it always stops at starting Sendmail for a long time. The next starting Sm-client is also abnormal and slow.Later, I found out that it was related to the change of hostname. In retrospect, I actually changed the hostname. However, the configuration file (/etc/sysconfig/Network) is modified ).The Internet says, "This is because
The server name of Sendmail (default: Hostname) cannot be parsed by gethostbyaddr. It will wait for timeout when it cannot be parsed, so it has been so long. So, there is no response in/etc/hosts or there is no record in DNS ".
To solve this problem, you need to add the host name to the/etc/hosts file (after 127.0.0.1) after modifying the configuration file ). Of course, you can also directly stop the sendmail service.
In fact, there are three things to do to change the Host Name:
1. Modify the/etc/sysconfig/network configuration file, hostname = "Host Name ";
2. Add the host name to the/etc/hosts file. Resolve the host name.
/Etc/hosts:
192.168.1.119Server. localdomain Server
/Etc/sysconfig/netwrok:
Hostname =Server. localdomain
The first column of the p.s./etc/hosts file is the network address, the second column is the host name, and the third column is the host alias.
3. The host name is successfully modified, but the original host name is displayed at the shell prompt. You need to restart the host to change the host name.
The host name is completely modified by using the command; hostname host name.
Disable sendmail:
1. End the sendmail service: # killall sendmail
2. Delete Sendmail: # chkconfig -- del Sendmail in auto start.
3. Disable sendmail: # chkconfig Sendmail off