CDH 中solrcloud 关于shard副本问题

version CDH5.4.4
the number of nodes:3
想实现个节点直接互相备份:node

命令:apache

      solrctl instancedir --create myCollection /home/test
      solrctl collection --create myCollection  -s 1 -r 2 (It was successful)
      
      but :solrctl collection --create myCollection  -s 3 -r 2:
      it is an error:Cannot create collection mycollection. Value of maxShardsPerNode is 1服务器

能够看看官方这个帖子:https://community.cloudera.com/t5/Cloudera-Search-Apache-SolrCloud/Indexing-files-on-HDFS-using-solrcloud-on-cloudera-and-searching/td-p/30656curl

也能够看官方文档:http://wiki.apache.org/solr/SolrCloudide


其实 默认状况下:每一个节点的最大分片是1(maxShardsPerNode=1),oop

可是咱们能够:however, you can override this by overriding the value of the "maxShardsPerNode" parameter, as you did with the curl command. (即用过URL命令来实现)this


步骤:solrctl instancedir --create myCollection /home/testurl

能够点开CDH的solrcloud管理界面:spa

http://hadoopnamenode:8983/solr/admin/collections?action=CREATE&name=myCollection&numShards=3&replicationFactor=3&maxShardsPerNode=3 
code

注意: 这里是管理collection,因此用collections?

在node1上建立core,以下:

 'http://node1:8983/solr/admin/cores?action=CREATE&name=mycore&collection=collection1&shard=shard2'


而后用:solrctl  collection --list 发现咱们建立成功


注意:当咱们用cdh作分片备份的时候,创建collection的时候必须maxShardsPerNode大于1,好比这里为3,之后当一个服务器挂了,新添加的服务器,咱们才能用建立core的URL,若是使用默认的maxShardsPerNode=1,尽管建立成功,可是查询的时候依然会失败,当建立备份以后,新的core会自动复制索引。

相关文章
相关标签/搜索