mysql实时到cdh中solr_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=3code

注意: 这里是管理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会自动复制索引。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值