SolrCloud: Unable to Create Collection, Locking Issues

2.5k views Asked by At

I have been trying to implement a SolrCloud, and everything works fine until I try to create a collection with 6 shards. My setup is as follows:

  • 5 virtual servers, all running Ubuntu 14.04, hosted by a single company across different data centers
  • 3 servers running ZooKeeper 3.4.6 for the ensemble
  • 2 servers, each running Solr 5.1.0 server (Jetty)
  • The Solr instances each have a 2TB, ext4 secondary disk for the indexes, mounted at /solrData/Indexes. I set this value in solrconfig.xml via <dataDir>/solrData/Indexes</dataDir>, and uploaded it to the ZooKeeper ensemble. Note that these secondary disks are neither NAS nor NFS, which I know can cause problems. The solr user owns /solrData.

All the intra-server communication is via private IP, since all are hosted by the same company. I'm using iptables for firewall, and the ports are open and all the servers are communicating successfully. Config upload to ZooKeeper is successful, and I can see via the Solr admin interface that both nodes are available.

The trouble starts when I try to create a collection using the following command:

http://xxx.xxx.xxx.xxx:8983/solr/admin/collections?action=CREATE&name=coll1&maxShardsPerNode=6&router.name=implicit&shards=shard1,shard2,shard3,shard4,shard5,shard6&router.field=shard&async=4444

Via the Solr UI logging, I see that multiple index creation commands are issued simultaneously, like so:

6/25/2015, 7:55:45 AM WARN SolrCore [coll1_shard2_replica1] Solr index directory '/solrData/Indexes/index' doesn't exist. Creating new index...
6/25/2015, 7:55:45 AM WARN SolrCore [coll1_shard1_replica2] Solr index directory '/solrData/Indexes/index' doesn't exist. Creating new index...

Ultimately the task gets reported as complete, but in the log, I have locking errors:

Error creating core [coll1_shard2_replica1]: Lock obtain timed out: SimpleFSLock@/solrData/Indexes/index/write.lock
SolrIndexWriter was not closed prior to finalize(),​ indicates a bug -- POSSIBLE RESOURCE LEAK!!!
Error closing IndexWriter

If I look at the cloud graph, maybe a couple of the shards will have been created, others are closed or recovering, and if I restart Solr, none of the cores can fire up.

Now, I know what you're going to say: follow this SO post and change solrconfig.xml locking settings to this:

<unlockOnStartup>true</unlockOnStartup>
<lockType>simple</lockType>

I did that, and it had no impact whatsoever. Hence the question. I'm about to have to release a single Solr instance into production, which I hate to do. Does anybody know how to fix this?

1

There are 1 answers

5
nick_v1 On BEST ANSWER

Based on the log entry you supplied, it looks like Solr may be creating the data (index) directory for EACH shard in the same folder.

 Solr index directory '/solrData/Indexes/index' doesn't exist. Creating new index...

This message was shown for two different collections and it references the same location. What I usually do, is change my Solr Home to a different directory, under which all collection "instance" stuff will be created. Then I manually edit the core.properties for each shard to specify the location of the index data.