1. Create a new collection
./solr create_collection -c collection_vip -d /opt/lucidworks-hdpsearch/solr/server/solr/configsets/vip_schema_configs/ -shards 10 -replicationFactor 3
- Parameter Description
- -c collection name to create
- -d config file directory
- -shards The number of shards to create for this collection
- -replicationFactor The number of replicas to create for each shard, an odd number is recommended
2. Delete the collection
./hbase-indexer delete-indexer --name 'collection_vip'
- Parameter Description
- --name name of the collection to delete
3. Add shard replica
./solr delete -c collection_vip -deleteConfig true
- Parameter Description
- delete action command
- collection_vip The name of the collection to be deleted
- deleteConfig Whether to delete and delete the configuration information, followed by a boolean value
4. Delete the shard copy
curl 'http://localhost:8983/solr/admin/collections?action=DELETEREPLICA&collection=collection_vip&shard=shard1&replica=core_node17'
- Parameter Description
- action action command
- collection The collection to delete the replica set
- shard shard name
- replica The name of the replica set to delete
5. Modify the solrconfig.xm configuration information of the collection
./zkcli.sh -zkhost localhost:2181 -cmd putfile /solr/configs/collection_vip/solrconfig.xml /opt/lucidworks-hdpsearch/solr/server/solr/configsets/vip_schema_configs/conf/solrconfig.xml
- Parameter Description
- -cmd Action command
- /solr/configs/collection_vip/solrconfig.xml configuration file path in zk
- /opt/lucidworks-hdpsearch/solr/server/solr/configsets/vip_schema_configs/conf/solrconfig.xml The local path of the configuration file to be modified
6. solrconfig configuration information refresh
curl 'http://localhost:8983/solr/admin/collections?action=RELOAD&name=collection_vip'
- Parameter Description
- action action command
- name The name of the collection to refresh