Solr common operation commands

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
    1. -c collection name to create
    2. -d config file directory
    3. -shards The number of shards to create for this collection
    4. -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
    1. --name name of the collection to delete

3. Add shard replica

./solr delete -c collection_vip -deleteConfig true
  • Parameter Description
    1. delete action command
    2. collection_vip The name of the collection to be deleted
    3. 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
    1. action action command
    2. collection The collection to delete the replica set
    3. shard shard name
    4. 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
    1. -cmd Action command
    2. /solr/configs/collection_vip/solrconfig.xml configuration file path in zk
    3. /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
    1. action action command
    2. name The name of the collection to refresh

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325021485&siteId=291194637