0
点赞
收藏
分享

微信扫一扫

solrcloud常用命令




上传conf

question:


java -classpath D:\solrCloud\solr-lib\* org.apache.solr.cloud.ZkCLI -cmd upconfig -zkhost 127.0.0.1:2181,127.0.0.1:2182,127.0.0.1:2183,127.0.0.1:2184,127.0.0.1:2185 -confdir D:\solrCloud\solr_configs\question -confname question_conf


paper:


java -classpath D:\solrCloud\solr-lib\* org.apache.solr.cloud.ZkCLI -cmd upconfig -zkhost 127.0.0.1:2181,127.0.0.1:2182,127.0.0.1:2183 -confdir D:\solrCloud\solr_configs\paper -confname paper_conf


teachingPlan:


java -classpath D:\solrCloud\solr-lib\* org.apache.solr.cloud.ZkCLI -cmd upconfig -zkhost 127.0.0.1:2181,127.0.0.1:2182,127.0.0.1:2183 -confdir D:\solrCloud\solr_configs\teachingPlan -confname teachingPlan_conf




创建:


curl "http://127.0.0.1:8081/solr/admin/collections?action=CREATE&name=question&numShards=2&replicationFactor=3&collection.configName=question_conf"




curl "http://10.1.30.220:8081/solr/admin/collections?action=CREATE&name=paper&collection.configName=paper_conf&router.name=implicit&shards=shard1,shard2&createNodeSet=10.1.30.220:8081_solr,10.1.30.220:8084_solr"




​​ http://10.1.30.220:8081/solr/admin/collections?action=CREATE&&name=teachingPlan&replicationFactor=3&collection.configName=teachingPlan_conf&createNodeSet=10.1.30.220:8081_solr,10.1.30.220:8082_solr,10.1.30.220:8083_solr&shards=1&router.name=implicit ​​




关联conf


java -classpath D:\solrCloud\solr-lib\* org.apache.solr.cloud.ZkCLI -cmd linkconfig -collection question -confname question_conf -zkhost 127.0.0.1:2181,127.0.0.1:2182,127.0.0.1:2183




删除索引:


​​ http://localhost:8081/solr/admin/collections?action=DELETE&name=question​​


​​ http://10.1.30.220:8081/solr/admin/collections?action=DELETE&name=teachingPlan​​


​​ http://10.1.30.220:8081/solr/admin/collections?action=DELETE&name=paper​​




重新加载:


​​ http://localhost:8081/solr/admin/collections?action=RELOAD&name=question​​





​​ http://10.1.30.220:8081/solr/admin/collections?action=CREATE&name=question&numShards=2&replicationFactor=3&collection.configName=question_conf​​




​​ http://10.1.30.220:8081/solr/admin/collections?action=DELETE&name=question​​




创建副本


​​ http://10.1.30.220:8081/solr/admin/collections?action=ADDREPLICA&collection=question&shard=shard1&node=10.1.30.220:8084_solr​​


​​ http://10.1.30.220:8081/solr/admin/collections?action=ADDREPLICA&collection=question&shard=shard1&node=10.1.30.220:8085_solr​​


​​ http://10.1.30.220:8081/solr/admin/collections?action=ADDREPLICA&collection=paper&shard=shard1&node=10.1.30.220:8082_solr​​




删除副本


​​ http://10.1.30.220:8081/solr/admin/collections?action=DELETEREPLICA&collection=question&shard=shard1&replica=core_node3​​


​​ http://10.1.30.220:8081/solr/admin/collections?action=DELETEREPLICA&collection=teachingPlan&shard=shard1&replica=core_node10​​




拆分分片


​​ http://10.1.30.220:8081/solr/admin/collections?action=SPLITSHARD&collection=question&shard=shard1​​




创建分片:


​​ http://10.1.30.220:8081/solr/admin/collections?action=CREATESHARD&collection=teachingPlan&shard=shard2&createNodeSet=10.1.30.220:8084_solr,10.1.30.220:8085_solr,10.1.30.220:8086_solr​​




删除分片


​​ http://10.1.30.220:8081/solr/admin/collections?action=DELETESHARD&collection=question&shard=shard1_1​​


​​ http://10.1.30.220:8081/solr/admin/collections?action=DELETESHARD&collection=teachingPlan&shard=shard1 ​​

举报

相关推荐

0 条评论