温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

CDH中solrcloud shard副本问题怎么解决

发布时间:2021-12-22 11:33:43 来源:亿速云 阅读:132 作者:iii 栏目:云计算

本篇内容介绍了“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?

在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会自动复制索引。

“CDH中solrcloud shard副本问题怎么解决”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注亿速云网站,小编将为大家输出更多高质量的实用文章!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI