SolrCloud:无法创建集合,锁定问题

SolrCloud: Unable to Create Collection, Locking Issues

我一直在尝试实现 SolrCloud,并且一切正常,直到我尝试创建一个包含 6 个分片的集合。我的设置如下:

所有服务器内通信都是通过私有 IP,因为所有服务器都由同一家公司托管。我正在使用 iptables 作为防火墙,端口已打开并且所有服务器都成功通信。配置上传到 ZooKeeper 成功,我可以通过 Solr 管理界面看到两个节点都可用。

当我尝试使用以下命令创建集合时,问题开始了:

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

通过 Solr UI 日志记录,我看到同时发出了多个索引创建命令,如下所示:

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...

最终任务被报告为完成,但在日志中,我有锁定错误:

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

如果我查看云图,可能会创建几个分片,其他分片已关闭或正在恢复,如果我重新启动 Solr,none 个核心可以启动。

现在,我知道你要说什么了:按照 this SO post 并将 solrconfig.xml 锁定设置更改为:

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

我这样做了,但没有任何影响。因此问题。我即将不得不将单个 Solr 实例发布到生产环境中,我讨厌这样做。有人知道如何解决这个问题吗?

根据您提供的日志条目,Solr 可能正在同一文件夹中为每个分片创建数据(索引)目录。

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

此消息是针对两个不同的集合显示的,它引用了相同的位置。我通常做的是将我的 Solr Home 更改为另一个目录,在该目录下将创建所有集合 "instance" 的东西。然后我手动编辑每个分片的 core.properties 以指定索引数据的位置。