I encountered a very strange bug when I was deploying a solr cluster as usual。

it said A previous ephemeral live node st ill exists when I’ve started another solr node via tomcat.

then login to zookeeper find out what happed. The live_nodes shows me this:
what!!! why its name is like this?? As usual, it should be realIP:port not local ip.

Let’s fix it

step one

Checking your solr.xml is corrate or not

<str name="host">${host:}</str>

this line should be var. Thus it will be named your host ip automatically when you star your solr node, registering in zookeeper.

step two

Here’s what I’v found in my case.
step one is right but why am I faild to start my solr node.

The Point is /etc/hosts, it records xxxxhostnamexxx at the top of this file.
and then at the bottom of this file it records xxxxhostnamexxx, so I think that node name will be read line by line from top to bottom via tomcat from hosts this file.

Deleting this line 127xxxxxxxx, then restart your nodes.
Logining and checking your node names in live_nodes of zookeeper.

I, simon love this world ❤️