solrCloud 管理
创建collection:
- /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
- curl 'http://localhost:50080/solr/admin/collections?action=CREATE&name=test_date&numShards=1&replicationFactor=3'
修改collection的配置信息:
- 写入ZK:
- sh zkcli.sh -zkhost localhost:2181/solrcloud -cmd upconfig -confdir /soft/server/solr-4.10.0-1/example/solr/collection1/conf -confname collection1
- reload conf:
- curl 'http://localhost:50080/solr/admin/collections?action=RELOAD&name=collection1'
删除collection
- curl 'http://172.24.28.110:50080/solr/admin/collections?action=DELETE&name=test'
- 数据目录下只保留了目录,数据已经删除了。
- zk中的该collection的信息没有被删除。
split shard
- curl 'http://localhost:50080/solr/admin/collections?action=SPLITSHARD&collection=name&shard=shardID'
delete inactive shard
- curl 'http://localhost:50080/solr/admin/collections?action=DELETESHARD&shard1=shardID&collection=name'
给分片创建副本:
- curl 'http://localhost:50080/solr/admin/collections?action=ADDREPLICA&collection=collection&shard=shard&node=solr_node_name'
- 例如:curl 'http://localhost:50080/solr/admin/collections?action=ADDREPLICA&collection=test_shard&shard=shard1_0&node=172.24.28.118:50080_solr'
删除副本:
- curl 'http://localhost:50080/solr/admin/collections?action=DELETEREPLICA&collection=collection&shard=shard&replica=replica'
- 例如:curl 'http://localhost:50080/solr/admin/collections?action=DELETEREPLICA&collection=test_shard&shard=shard1_0&replica=core_node5'