Red Hat Bugzilla – Bug 1406165
hadoop-namenode listens on loopback interface
Last modified: 2018-02-07 16:29:13 EST
Description of problem:
When the hadoop-namenode service is configured to start at boot (systemctl enable hadoop-namenode), it incorrectly binds to the loopback interface instead of the public interface. This is probably because the systemd unit file does not wait on the network interfaces to start up fully.
Version-Release number of selected component (if applicable):
Almost always, after a reboot.
Steps to Reproduce:
1. systemctl enable hadoop-namenode
3. netstat -tlnp
the namenode is bound to 127.0.0.2
it should be bound to the IP address for the primary NIC
The namenode can be restarted after the system is fully up, and then it will correctly bind to the right interface.
It could also bind to 0.0.0.0 instead, which would make sense as a default.
I guess this could very well be race condition with the network manager starting the network. During this race condition on a machine with more network cards the resolv of hostname could result in 127.0.0.2.
Can you try changing the hadoop-hdfs.service from network.target to depend on network-online.target ?
Seems to affect rawhide / fedora 27 as well.