SolrCloud:无法创建集合,锁定问题 [英] SolrCloud: Unable to Create Collection, Locking Issues

查看:86
本文介绍了SolrCloud:无法创建集合,锁定问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试实现SolrCloud,并且一切正常,直到我尝试创建具有6个分片的集合为止.我的设置如下:

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台虚拟服务器,全部运行Ubuntu 14.04,由一家公司跨不同数据中心托管
  • 3个运行ZooKeeper 3.4.6的服务器作为整体
  • 2台服务器,每台服务器都运行Solr 5.1.0服务器(Jetty)
  • 每个Solr实例都有一个2TB的ext4辅助磁盘作为索引,安装在/solrData/Indexes上.我通过< dataDir>/solrData/Indexes</dataDir> solrconfig.xml 中设置了此值,并将其上传到ZooKeeper集成中.请注意,这些辅助磁盘既不是NAS,也不是NFS,我知道这会引起问题. solr 用户拥有/solrData .
  • 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.

由于所有服务器内部通信均由同一公司托管,因此它们都是通过专用IP进行的.我将iptables用于防火墙,并且端口已打开并且所有服务器都已成功通信.配置成功上传到ZooKeeper,通过Solr管理界面我可以看到两个节点都可用.

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

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

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

如果我查看云图,可能会创建几个分片,其他分片已关闭或正在恢复,如果我重新启动Solr,则所有内核都无法启动.

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.

现在,我知道您要说的是:关注此SO帖子并将 solrconfig.xml 锁定设置更改为此:

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>

我这样做了,没有任何影响.因此,问题就来了.我将不得不将一个Solr实例发布到生产环境中,而我不愿意这样做.有人知道如何解决这个问题吗?

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?

推荐答案

基于您提供的日志条目,看来Solr可能正在同一文件夹中为EACH碎片创建数据(索引)目录.

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

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

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.

这篇关于SolrCloud:无法创建集合,锁定问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆