1、修改network文件
# cd /etc/sysconfig/
# vi network
NETWORKING=yes
HOSTNAME=hadoop102
2、修改hosts文件
# cd /etc
# vi hosts
127.0.0.1 localhost.localdomain localhost
192.168.186.211 hadoop102
3、修改hostname文件
# vi hostname
hadoop102
4、reboot重启
5、查看修改效果
# hostname
hadoop102