Could not resolve hostname node1: Name or service not know
2019-07-04 23:33:56

搭建集群的时候,使用ssh + 主机名 报错。 

这个时候我已经修改了


错误前配置:

/etc/hostname,将主机的名字更改成了:node1 了。 

这个时候会发现在显示上面,主机名字更改为了node1. 

ssh会出现上述报错。


解决

1、需要配置/etc/hosts文件才是关键!


/etc/hosts 中的localhost.localdomain 替换为node1 

image.png


image.png
然后再重启机器就成功了