首页 > 其他 > 详细

solr数据分片相关

时间:2017-07-06 19:56:46      阅读:218      评论:0      收藏:0      [点我收藏+]

solr操作url

使用正常的core,使用命令生成coillection

solr create_collection -c students2 -d ../server/solr/my/conf -shards 2 -replicationFactor 2  -router implicit  -routerField name
## 等价于调用以下url
http://localhost:8081/solr/admin/collections?action=CREATE&name=students&numShards=2&replicationFactor=2&maxShardsPerNode=2&collection.configName=students

1:所有shard上查询数据
http://localhost:8081/solr/mycollection/select?q=*%3A*
2:指定shard查询数据
http://localhost:8081/solr/mycollection/select?q=*%3A*&shard=shard1
3:当shard没有启动时,为了能正常查询需如下:
http://localhost:8081/solr/mycollection/select?q=*%3A*&shards.tolerant=true
4:添加集合
http://localhost:8081/solr/admin/collections?action=CREATE&name=mycollection&numShards=2&replicationFactor=2
参数名 说明
Name 要创建的集合名称
numShards 指定集合Shard的数量
replicationFactor 指定每个Shard副本数量
maxShardsPerNode 每个Solr服务器节点上最大Shard数量
5:删除集合
http://localhost:8081/solr/admin/collections?action=DELETE&name=mycollection
6:重新加载
http://localhost:8081/solr/admin/collections?action=RELOAD&name=mycollection

solr数据分片相关

原文:http://www.cnblogs.com/faunjoe88/p/7127931.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!