solr數據分片相關


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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM