• Home
  • LLMs
  • Docker
  • Kubernetes
  • Java
  • Maven
  • About
Apache Solr | Clean-up Solr
  1. Clean-up Solr

  1. Clean-up Solr
    If you want to clean-up completely your Solr installation:
    • Stop your Solr instances (you may need to stop also the applications using Solr).

    • For each Solr instance, delete manually the collections' shards/replicas created in the directory "${SOLR_HOME}":
      ► collection6_shard1_replica_n1
      ► collection6_shard2_replica_n1
      ► ...

      $ rm -rf ${SOLR_ROOT}/server/solr/collection6*

    • Empty the solr aliases.json (znode) in ZooKeeper.

      $ ${ZK_HOME}/bin/zkCli.sh -server localhost:2181 set /solr/aliases.json ""

    • Delete the solr collections (znodes) from ZooKeeper.

      For each collection, execute the following:
      $ ${ZK_HOME}/bin/zkCli.sh -server localhost:2181 deleteall /solr/collections/collection6

    • Optionally, delete the solr configs (znodes) from ZooKeeper.

      For each configuration, execute the following:
      $ ${ZK_HOME}/bin/zkCli.sh -server localhost:2181 deleteall /solr/configs/solr_config1

    Alternatively, instead of deleting in ZooKeeper each collection and configuration, you can delete the root solr znode from ZooKeeper.
    Be aware that this will delete the whole Solr configuration!
    Also note that you still need to delete manually the collections from the Solr home directory (see above).

    $ ${ZK_HOME}/bin/zkCli.sh -server localhost:2181 deleteall /solr
© 2025  mtitek