在 CentOS 7.6 中,你可以按照以下步骤来永久修改主机名: 编辑 /etc/hostname 文件。 打开 /etc/hostname 文件,并将其内容替换为你想要设置的主机名。例如,将主机名设置为 hadoop01: sudo vim /etc/hostname hadoop01 保存并关闭文件。 编辑 /etc/hosts 文件。 打开 /etc/hosts 文件,并将其中的 127.0.0.1 行中的旧主机名替换为新主机名。例如: sudo vim /etc/hosts 127.0.0.1 local…