solr数据分片相关

来源:互联网 发布:centos 安装gcc g 编辑:程序博客网 时间:2024/05/29 16:41

solr操作url

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

solr create_collection -c students2 -d ../server/solr/my/conf -shards 2 -replicationFactor 2  -router implicit  -routerField name## 等价于调用以下urlhttp://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

0 0
原创粉丝点击