#####################shell命令#############################
導入文檔:
sh bin/post -c gettingstarted docs/index.html
刪除全部文檔:
sh bin/post -c gettingstarted -d "<delete><query>*:*</query></delete>"
刪除示例:
bin/solr stop -all ; rm -Rf example/cloud/
啟動指定Node:
sh bin/solr start -c -s example/cloud/node1/solr/ -p 8983
sh bin/solr start -c -s example/cloud/node2/solr/ -p 7574
上傳配置文件到zk:
sh zkcli.sh -cmd upconfig -zkhost 127.0.0.1:2181 -confname default-configset -confdir /root/program-files/solr-5.1.0/configs
上傳文件到zk:
sh zkcli.sh -zkhost localhost:2181 -cmd putfile /solr.xml /path/to/solr.xml
創建collection:
curl 'http://127.0.0.1:8983/solr/admin/collections?action=CREATE&name=default-collection&instanceDir=default-collection&dataDir=data&config=solrconfig.xml&schema=schema.xml&numShards=2&collection.configName=default-configset&replicationFactor=2'
刪除collection:
curl 'http://localhost:8983/solr/admin/collections?action=delete&name=default-collection'
重新加載collection(可以讓zk上修改后的配置文件生效):
curl 'http://localhost:8983/solr/admin/collections?action=RELOAD&name=default-collection'
創建core:
curl 'http://localhost:8983/solr/admin/cores?name=default-collection_shard1_replica2&action=create&collection=default-collection&shard=shard1'
刪除core:
curl 'http://localhost:8983/solr/admin/cores?action=UNLOAD&core=default-collection_shard2_replica1' (命令不會刪除core的實際文件夾,需要手動刪除)
刪除shard:
curl 'http://localhost:8983/solr/admin/collections?action=DELETESHARD&shard=shard1&collection=default-collection'
根據指定server目錄啟動一個實例:
sh bin/solr start -c -p 7574 -d server2 -z 127.0.0.1:2181
#####################http命令#############################


#reload collection

