ubuntu 12.04 solr 5.3.1 zookeeper 使用笔记


/opt/solr/bin/solr create -c mycol -d data_driven_schema_configs -s 3 -rf 2 -n myconf


http://172.17.11.135:8983/solr/admin/collections?action=CREATE&name=mycol&numShards=3&replicationFactor=2&maxShardsPerNode=6&collection.configName=myconf


http://172.17.11.135:8983/solr/admin/collections?action=DELETE&name=mycol

http://172.17.11.135:8983/solr/admin/collections?action=reload&name=mycol


/opt/solr/server/scripts/cloud-scripts/zkcli.sh -zkhost 172.17.11.135:2181 -cmd upconfig -c mycol -d /opt/solr-5.3.1/server/solr/configsets/data_driven_schema_configs/conf -n myconf




curl "http://172.17.10.13:8880/solr/collection1/update/json?commit=true" --data-binary @clear.json -H 'Content-type:text/json; charset=utf-8'

curl "http://172.17.10.13:8880/solr/collection1/update/json?commit=true" --data-binary @books.json -H 'Content-type:text/json; charset=utf-8'

curl "http://172.17.10.13:8880/solr/collection1/select?q=*:*&wt=json"



cat clear.json 

    {"delete": {

     "query": "*:*"

    }

    }



cat books.json

    {"add":{"overwrite":true,"doc":{"id":1,"name":"\u6e56\u5357\u536b\u89c6","area":"\u6e56\u5357"}}}

    {"add":{"overwrite":true,"doc":{"id":2,"name":"\u6e56\u5357\u7535\u89c6\u5267\u573a","area":"\u6e56\u5357"}}}

    {"add":{"overwrite":true,"doc":{"id":3,"name":"\u6c5f\u82cf\u536b\u89c6","area":"\u6c5f\u82cf"}}}


你可能感兴趣的:(zookeeper,Solr)