1、添加用户并授权
#useradd hadoop
#passwd hadoop
#vim /etc/sudoers
hadoop ALL=(ALL) ALL
2、静态IP
编辑 ifcfg-eth0 文件
#vim /etc/sysconfig/network-scripts/ifcfg-eth0
BOOTPROTO="static" #dhcp改为static
ONBOOT="yes" #开机启用本配置
IPADDR=192.168.7.106 #静态IP
GATEWAY=192.168.7.1 #默认网关
NETMASK=255.255.255.0 #子网掩码
DNS1=192.168.7.1 #DNS 配置
修改网关配置
#vim /etc/sysconfig/network
NETWORKING=yes#表示系统是否使用网络(IPV4),一般设置为yes。
NETWORKING_IPV6=no#不适用IPV6
HASTNAME#设置主机名,localhost.localhostdomain为默认主机名称
GATEWAY=192.168.7.1#设置网关,选一个未使用的地址即可
修改DNS
# vim /etc/resolv.conf
nameserver 114.114.114.114
nameserver 8.8.8.8
重启网络服务
#service network restart
3、防火墙
查询防火墙状态:
# service iptables status
停止防火墙:
# service iptables stop
启动防火墙:
#service iptables start
重启防火墙:
#service iptables restart
永久关闭防火墙:
# chkconfig iptables off
永久关闭后启用:
# chkconfig iptables on