CentOS6.5修改主机名
1.编辑/etc/sysconfig/network
[root\@localhost \~]\# vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=hadoop001
2.hostname直接命名
[root\@localhost \~]\#hostname hadoop-01
3.编辑/etc/hosts
[root\@localhost \~]\# vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.137.130 hadoop001
主机名修改之后需要重新打开终端,才能显示。