solrCloud 管理

创建collection:

  1. /soft/server/solr-4.10.0/example/scripts/cloud-scripts/zkcli.sh -cmd upconfig -zkhost localhost:2181/solrcloud -confdir /soft/server/solr-4.10.0/example/solr/sku_search/conf -confname sku_search
  2. curl 'http://localhost:50080/solr/admin/collections?action=CREATE&name=test_date&numShards=1&replicationFactor=3'

修改collection的配置信息:

  1. 写入ZK:
    1. sh zkcli.sh  -zkhost localhost:2181/solrcloud -cmd upconfig -confdir /soft/server/solr-4.10.0-1/example/solr/collection1/conf -confname collection1
  2. reload conf:
    1. curl 'http://localhost:50080/solr/admin/collections?action=RELOAD&name=collection1'

删除collection

  1. curl 'http://172.24.28.110:50080/solr/admin/collections?action=DELETE&name=test'
  2. 数据目录下只保留了目录,数据已经删除了。
  3. zk中的该collection的信息没有被删除。

split shard

  1. curl 'http://localhost:50080/solr/admin/collections?action=SPLITSHARD&collection=name&shard=shardID'

delete inactive shard

  1. curl 'http://localhost:50080/solr/admin/collections?action=DELETESHARD&shard1=shardID&collection=name'

给分片创建副本:

  1. curl 'http://localhost:50080/solr/admin/collections?action=ADDREPLICA&collection=collection&shard=shard&node=solr_node_name'
  2. 例如:curl 'http://localhost:50080/solr/admin/collections?action=ADDREPLICA&collection=test_shard&shard=shard1_0&node=172.24.28.118:50080_solr'

删除副本:

  1. curl 'http://localhost:50080/solr/admin/collections?action=DELETEREPLICA&collection=collection&shard=shard&replica=replica'
  2. 例如:curl 'http://localhost:50080/solr/admin/collections?action=DELETEREPLICA&collection=test_shard&shard=shard1_0&replica=core_node5'

    

原文地址:https://www.cnblogs.com/fanweiwei/p/4030623.html