分享

Solr,shards.tolerant=true的问题

dandaoxianfeng 发表于 2015-7-27 14:09:17 [显示全部楼层] 回帖奖励 阅读模式 关闭右栏 4 15737
这个参数可以忽略失败或者坏掉的数据,
我用的语言是perl,用的是Apache::Solr相关模块
不知道这个参数怎么设置呢?还望知道的大虾帮忙指点一下。

已有(4)人评论

跳转到指定楼层
arsenduan 发表于 2015-7-27 14:30:40
这个参数个人认为有作用,也没作用。其实就是为了客户体验。不把错误信息显示给用户。
详细作用如下:
SolrCloud可以继续无间断服务,只要至少一台服务器主机的每一个碎片。如果你已经杀了一个特定的碎片shard,所有服务器到其他服务器的请求将导致503错误。加上此参数后,会只返回碎片仍然活着(避免错误)的文件


英文资料:
SolrCloud can continue to serve results without interruption as long as at least one server hosts every shard. You can demonstrate this by judiciously shutting down various instances and looking for results. If you have killed all of the servers for a particular shard, requests to other servers will result in a 503 error. To return just the documents that are available in the shards that are still alive (and avoid the error), add the following query parameter: shards.tolerant=true
回复

使用道具 举报

dandaoxianfeng 发表于 2015-7-27 15:11:04
arsenduan 发表于 2015-7-27 14:30
这个参数个人认为有作用,也没作用。其实就是为了客户体验。不把错误信息显示给用户。
详细作用如下:
So ...

非常感谢
刚才我自己做了实验
my $res=$solr->select(q => '*:*',start=>'0',rows=>10,sort=>'time desc',fl=>'*','shards.tolerant'=>'true');
这样传递参数就可以。

回复

使用道具 举报

arsenduan 发表于 2015-7-27 15:19:49
dandaoxianfeng 发表于 2015-7-27 15:11
非常感谢
刚才我自己做了实验
my $res=$solr->select(q => '*:*',start=>'0',rows=>10,sort=>'time des ...

参数一般可以通过程序控制,配置文件应该可以达到相同的作用。
回复

使用道具 举报

dandaoxianfeng 发表于 2015-7-27 17:59:23
arsenduan 发表于 2015-7-27 15:19
参数一般可以通过程序控制,配置文件应该可以达到相同的作用。

刚刚接触solr,很多地方都不明白,多谢指教

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条