hostname -i 出现0.0.0.0解决

[root@hostnametest4 ~]# hostname -i
0.0.0.0

原因:是因为四个节点中其中一个节点没有配置hosts解析,必须每个节点写全这四个ip,只要掉一个ip就会出现0.0.0.0,


cat >/etc/hosts<<EOF
192.168.0.91 test1
192.168.0.92 test2
192.168.0.93 test3
192.168.0.94 test4
EOF
原文地址:https://www.cnblogs.com/effortsing/p/10357171.html