手动配置IP地址和DNS
DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
PEERDNS=yes
PEERROUTES=yes
LAST_CONNECT=1386682585
IPADDR=192.168.0.137
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
DNS1=218.85.152.99
DNS2=218.85.157.99
配置时区和修改时间
配置hostname主机名称
vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=hadoop01
配置hosts主机名地址映射
vi /etc/hosts
192.168.0.137 hadoop01
重启服务
service network restart
测试外网
ping www.baidu.com
关闭防火墙
chkconfig iptables off
创建用户,设置sudo权限
useradd hadoop
passwd hadoop
chmod u+w /etc/sudoers
vim /etc/sudoers
在root ALL=(ALL) ALL下面加上一行hadoop ALL=(ALL) ALL。(分隔的是制表符)
chmod u-w /etc/sudoers
设置ssh免密登录(使用hadoop登录)
ssh-keygen -t rsa
cd /home/hadoop/.ssh
cp id_rsa.pub authorized_keys
chmod 600 authorized_keys
ssh hadoop01