Recently learning Hadoop, using virtual machines to do the distributed, because Hadoop to configure the host name of the slave node, you need to modify the Hosts file's IP address and host name Mapping relationship.
However, each time the virtual machine restarts, the IP address will change, so that each time you have to change the hosts file. So decided to static IP, the process encountered some problems, now the steps and the problems encountered summed up:
1, modify sudo vi/etc/network/interfaces, modify the content as follows:
Iface eth0 inet Static
Address 192.168.0.100
Netmask 255.255.255.0
Gateway 192.168.0.1
2, Ifup eth0
3,/etc/init.d/networking Restart (it is important to forget to execute this command, have been unable to ssh remote connection)
If it still doesn't work, restart the virtual machine.
Ps:linux for Ubuntu
Virtual machine Set static IP