CDH 中solrcloud 关于shard副本问题

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

命令:

      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/30656

也可以看官方文档:http://wiki.apache.org/solr/SolrCloud


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

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


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

可以点开CDH的solrcloud管理界面:

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

注意: 这里是管理collection,所以用collections?

如下:

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


然后用:solrctl  collection --list 发现我们创建成功

你可能感兴趣的:(CDH 中solrcloud 关于shard副本问题)