Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get Solr back up when indexes are locked and <unlockOnStartup>true doesn't work?

Tags:

solr

I have a Solr slave that is running in Tomcat. I added a core, so I changed solr.xml. To reload it I decided to simply restart Tomcat using the Windows Services managament console.

After restarting Tomcat I keep getting the following exception:

org.apache.lucene.store.LockObtainFailedException: Index locked for write for core

I decided to temporarily change the solrconfig.xml for each core to add:

<unlockOnStartup>true</unlockOnStartup>

But no luck. Locking is set to native, so I can't go and remove lock files.

  1. How do I get Solr up and running again?
  2. How should I restart Solr to prevent this from happening?
like image 307
Michiel van Oosterhout Avatar asked Jun 05 '13 14:06

Michiel van Oosterhout


People also ask

How do I reindex Solr?

There is no process in Solr for programmatically reindexing data. When we say "reindex", we mean, literally, "index it again". However you got the data into the index the first time, you will run that process again.

Where are Solr indexes stored?

Apache Solr stores the data it indexes in the local filesystem by default. HDFS (Hadoop Distributed File System) provides several benefits, such as a large scale and distributed storage with redundancy and failover capabilities. Apache Solr supports storing data in HDFS.

How does Solr indexing work?

Solr works by gathering, storing and indexing documents from different sources and making them searchable in near real-time. It follows a 3-step process that involves indexing, querying, and finally, ranking the results – all in near real-time, even though it can work with huge volumes of data.


2 Answers

Delete only write.log in data/index . Where is data directory is specified in conf/solrconfig.xml.

like image 100
Babu Avatar answered Oct 03 '22 00:10

Babu


Clear the index directory and restart solr. It will work

like image 39
sasikt Avatar answered Oct 02 '22 22:10

sasikt