Reputation: 23084
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.
Upvotes: 9
Views: 15484
Reputation: 171
My experience as I was a bit confused by the write.log
with the .log
ending in some answers (I was expecting a .lock
ending).
I simply followed the instruction given by Solr:
Index dir '/var/solr/data/coreName/data/index/' of core 'coreName' is already locked. The most likely cause is another Solr server (or another solr core in this server)
Then I went to the directory /var/solr/data/coreName
I searched find . -iname '*lock'
and then delete those files that were clearly lock files.
Restarted solr and it worked.
Upvotes: 0
Reputation: 818
Just deleted write.lock file under Solr > My Core > data > Index > write.lock file and restart solr server and it's worked.
Upvotes: 1
Reputation: 5250
Delete only write.log in data/index . Where is data directory is specified in conf/solrconfig.xml.
Upvotes: 6
Reputation: 2136
Delete file write.log
in folder /data/index/
for your core then restart tomcat. It worked for me.
Upvotes: 3
Reputation: 6772
In case the other answers don't work, check your file permissions. In my case, I had to do a
chown -R tomcat6:tomcat6 /opt/solr/corename
Upvotes: 1