WELCOME!

What is Pinoy? It's a slang for Filipino, a person who comes from the Republic of the Philippines, or commonly known as the Philippine Islands (PI). I am a Filipino and works as an Oracle DBA in the United States. Whenever an issue arises or just for experiments, I usually forget what I did to solve/conduct them. There must be a central location where I can put everything. Thus, this blog was born. It's a collection of ideas, tips and tricks, scripts, or anything interesting that happened to me on an Oracle database or any other stuff.

The simpler, the better! has always been my motto. You don't have to complicate things. Simple things, for me, is always easier, just like my site.

FYI, anything that is written here is based on my personal experiences and is not endorsed by any other party. Also, I will not be held liable for issues that can arise by following whatever I did. Just like any other good DBA would say... ALWAYS TEST!

Hope you can find this site helpful in whatever you need and remember, I am not a guru.

Feb 10, 2015

"HttpSolrServer$RemoteSolrException: We are not the leader" Solr Cloud

I created a SolrCloud (4.10) environment using a 3-host Zookeeper environment with a 3-host SOLR cluster. I simulated a crash by deleting one of replica that was running on the leader node for one of the collections (let's call it M01). Because of this, a new leader was elected (let's call it M02) for the collection. Now, the landscape has 2 leaders: M02 for 1 collection, and M01 for the other collections.

I added the replica back. Waited for it to recover but unfortunately, it didn't and there were error messages in the log file:

Error while trying to recover. core=coreName:java.util.concurrent.ExecutionException: org.apache.solr.client.solrj.impl.HttpSolrServer$RemoteSolrException: We are not the leader
 at java.util.concurrent.FutureTask.report(FutureTask.java:122)
 at java.util.concurrent.FutureTask.get(FutureTask.java:188)
 at org.apache.solr.cloud.RecoveryStrategy.sendPrepRecoveryCmd(RecoveryStrategy.java:615)
 at org.apache.solr.cloud.RecoveryStrategy.doRecovery(RecoveryStrategy.java:371)
 at org.apache.solr.cloud.RecoveryStrategy.run(RecoveryStrategy.java:235)
Caused by: org.apache.solr.client.solrj.impl.HttpSolrServer$RemoteSolrException: We are not the leader
 at org.apache.solr.client.solrj.impl.HttpSolrServer.executeMethod(HttpSolrServer.java:550)
 at org.apache.solr.client.solrj.impl.HttpSolrServer$1.call(HttpSolrServer.java:245)
 at org.apache.solr.client.solrj.impl.HttpSolrServer$1.call(HttpSolrServer.java:241)
 at java.util.concurrent.FutureTask.run(FutureTask.java:262)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
 at java.lang.Thread.run(Thread.java:745)


I tried to delete and add the said replica but got the same error.

The solution is to restart the SOLR instance that was on the leader node of the collection where the replica was deleted. This will reset the leader for that collection and eventually have M01 recover.

Hope this helps

No comments:

Post a Comment