今天安装了ubuntu18.04 因为是做hadoop 集群想把主机名改了
使用 sudo nano /etc/hostname 修改 , 然后重启 ,不生效。
这以前用的没有出过问题啊,问我们hadoop维护的同事,说可能是ubuntu18.04 有bug。
我想了一下感觉,不太可能。百度后解决。
技术一直在变,我们必须跟着变。
解决如下:
1、修改hostname
sudo nano /etc/hostname
2、修改/etc/cloud/cloud.cfg
sudo nano /etc/cloud/cloud.cfg
This will cause the set+update hostname module to not operate (if true)
preserve_hostname: true #这里是将false改成true
修改后 reboot 搞定。
本文来自 沙赞 的CSDN 博客 ,全文地址请点击:https://blog.csdn.net/weixin_42776979/article/details/81387053?utm_source=copy