You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by praneethvarma <it...@gmail.com> on 2014/05/29 22:40:09 UTC

Solr: IndexNotFoundException: no segments* file HdfsDirectoryFactory

I'm trying to write some integration tests against SolrCloud for which I'm
setting up a solr instance backed with a zookeeper and pointing it to a
namenode (all in memory using hadoop testing utilities and JettySolrRunner).
I'm getting the following error when I'm trying to create a collection (btw,
the exact same configuration works just fine in dev with solrcloud).

    org.apache.lucene.index.IndexNotFoundException: no segments* file found
in NRTCachingDirectory(HdfsDirectory@2ea2a4e4
lockFactory=org.apache.solr.store.hdfs.HdfsLockFactory@4cf0e472;
maxCacheMB=192.0 maxMergeSizeMB=16.0): files: [HdfsDirectory@6bf4fc1c
lockFactory=org.apache.solr.store.hdfs.HdfsLockFactory@51115f81-write.lock]

I'm getting this error when I'm trying to create a collection (precisely,
when solr is actually trying to open a searcher on the new index.). There
are no segment files in the index directory on HDFS. So this error is
expected on opening a searcher on the index but I thought that the segment
file is created the first time (when a collection is being created). 

After some debugging I noticed that the IndexWriter  is being initialized
explicitly with APPEND mode by overriding the default APPEND_CREATE mode,
which means that the segment files won't be created if at least one doesn't
exist. I'm not sure why this is the case and also I may be going down the
wrong path with the error. Again this only happens in my in-memory solrcloud
setup.

Can someone help me with this? Thanks




--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-IndexNotFoundException-no-segments-file-HdfsDirectoryFactory-tp4138737.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Solr: IndexNotFoundException: no segments* file HdfsDirectoryFactory

Posted by praneethvarma <it...@gmail.com>.
I've missed Norgorn's reply above. But in the past and also as suggested
above, I think the following lock type solved the problem for me.

<lockType>${solr.lock.type:hdfs}</lockType> in your indexConfig in
solrconfig.xml



--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-IndexNotFoundException-no-segments-file-HdfsDirectoryFactory-tp4138737p4178098.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Solr: IndexNotFoundException: no segments* file HdfsDirectoryFactory

Posted by xinwu <xi...@gmail.com>.
Hi,did you solve this problem?
I met the same problem when I setted up solr+hdfs.



--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-IndexNotFoundException-no-segments-file-HdfsDirectoryFactory-tp4138737p4178034.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Solr: IndexNotFoundException: no segments* file HdfsDirectoryFactory

Posted by Norgorn <ls...@mail.ru>.
Yes, it's late, but I've faced same problem and this question is the only one
relevant to the problem in Google results, so, hope it'll help s1.

For me, adding this two strings to solrconfig solved the problem

<dataDir>${solr.data.dir:hdfs://192.168.22.11:9001/solr}</dataDir>
<unlockOnStartup>true</unlockOnStartup>

In docs it's siad, that there is no need to set data.dir in Cloud mode, but
- well, mb I'm doing sommething wrong, but my SolrCloud works well now.
Index is in hdfs (local folder is empty) and search querries works fine.

Othe hdfs-relative strings for me are:

<lockType>${solr.lock.type:hdfs}</lockType>

  <directoryFactory name="DirectoryFactory"
class="solr.HdfsDirectoryFactory">
	  <str name="solr.hdfs.home">hdfs://192.168.0.1:9000/solr</str>
	  <bool name="solr.hdfs.blockcache.enabled">true</bool>
	  <int name="solr.hdfs.blockcache.slab.count">1</int>
	  <bool name="solr.hdfs.blockcache.direct.memory.allocation">true</bool>
	  <int name="solr.hdfs.blockcache.blocksperbank">16384</int>
	  <bool name="solr.hdfs.blockcache.read.enabled">true</bool>
	  <bool name="solr.hdfs.blockcache.write.enabled">true</bool>
	  <bool name="solr.hdfs.nrtcachingdirectory.enable">true</bool>
	  <int name="solr.hdfs.nrtcachingdirectory.maxmergesizemb">16</int>
	  <int name="solr.hdfs.nrtcachingdirectory.maxcachedmb">192</int>
  </directoryFactory> 



--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-IndexNotFoundException-no-segments-file-HdfsDirectoryFactory-tp4138737p4169036.html
Sent from the Solr - User mailing list archive at Nabble.com.