Today when you are in a fully distributed cluster of Hadoop, when you start CentOS, you always stop at starting sendmail for a long time, and the next starting sm-client is unusually slow. Later, we found that the original is related to the change of hostname. Recall that I had indeed changed the hostname. However, only the configuration file (/etc/sysconfig/network) was modified. "This is because SendMail's server name (preset is hostname) cannot be resolved by gethostbyaddr, and when it is not resolved, it waits for timeout, so it has been waiting for so long," said the Internet. So, in the/etc/hosts there is no response or DNS there is no record.
So, the solution to this problem is to add the hostname to the/etc/hosts file (after adding the hostname to the 127.0.0.1) by modifying the configuration file to change the hostname. Of course, can also directly stop SendMail service.
In fact, to change the host name to do three things:
1, modify the/etc/sysconfig/network configuration file, hostname= "host name";
2, add the host name to the/etc/hosts file. Enables the host name to be parsed.
/etc/hosts:
192.168.1.119 Server.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 has been modified successfully, but the shell prompt displays the original hostname and needs to be restarted before it can be changed.
Use the command; hostname host name this way, the hostname is completely modified.
Prohibit SendMail service:
1. End SendMail Service: # killall SendMail
2. Delete SendMail in automatic startup: #chkconfig--del SendMail
3. Disable SendMail: #chkconfig sendmail off