Description

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:127.0.0.1:8080.
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

1
<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 127.0.0.1 xxxxhostnamexxx at the top of this file.
and then at the bottom of this file it records xxx.xxx.xxx.xxx 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.
Done.

EOF
Enjoy
I, simon love this world ❤️