修改主机名
vim /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=
增加ip 映射
vi /etc/hosts
172.17.0.2 hadoop1
172.17.0.3 hadoop2
设置ip文件
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0" #网卡名
BOOTPROTO="dhcp" #dhcp改 为static
IPADDR=192.168.0.116
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
DNS1=8.8.8.8
HWADDR="52:54:00:A1:CB:F7"
IPV6INIT="yes"
MTU="1500"
NM_CONTROLLED="yes"
ONBOOT="yes"
TYPE="Ethernet"
UUID="9598c26e-a909-4d2f-b444-d5d6b6df7fb9"
配制生效
service network restart
版权声明:本文为KGDMHNY原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。