1、方法一使用hostnamectl命令 $ hostnamectl set-hostname node01 2、方法二:修改配置文件 /etc/hostname 保存退出 $ vim /etc/hostname