今天需要单独配置一台新的Ubuntu服务器作为Hadoop集群的Master,一直使用动态IP,这回还特意去查了资料,很简单,记下来留作资料供以后忘记了查找吧。
     Ubuntu的网络配置总的来说需要两步:配置接口属性、配置DNS,这里我们直接使用修改配置文件永久生效的方式来进行。
一、配置接口属性
     sudo gedit /etc/network/interfaces     //default you have not vim
     进入文件图形编辑模式:
     auto lo
     iface lo inet loopback    //回环接口
     auto eth0
     iface eht0 inet static/dhcp
     //if dhcp the follows are not needed
     address 192.168.1.1
     netmask 255.255.255.0
     gateway 192.168.1.254
二、配置DNS
     sudo gedit /etc/resolv.conf
     进入DNS图形配置界面:
     nameserver 202.102.152.3
     nameserver 202.102.128.68
三、重新启动网络配置
     必须重新启动网络配置才能够使更新生效:
     sudo /etc/init.d/networking restart

09-14 16:18