Help Center/ MapReduce Service/ Component Operation Guide (LTS) (Ankara Region)/ Using Solr/ Common Service Operations About Solr/ (Recommended) Changing the Collection Data Storage Mode from HDFS to Local Disk
Updated on 2024-11-29 GMT+08:00

(Recommended) Changing the Collection Data Storage Mode from HDFS to Local Disk

Scenario

Solr supports collection data to be stored in local disks and HDFS. In most cases, local disk storage provides higher read and write performance and is recommended.

Before changing the storage mode, delete the historical collections stored in HDFS one by one. Then, perform the following steps to change the storage mode to local disk storage. This way, new collections will be stored on the local disk.

Prerequisites

The Solr service has been installed. To ensure read and write performance, prepare a separate disk for each instance of the Solr node.

Procedure

Assume that some collections, such as collectionTest, are stored in HDFS. To change the storage mode to local disk storage, perform the following steps:

  1. Delete all collections that are stored in HDFS. The collectionTest is used as an example.

    solrctl collection --delete collectionTest

    The collection name collectionTest is used as an example. Change the collection name based on the site requirements until all collections stored in the HDFS are deleted.

  2. On the Solr web page, change the service parameter INDEX_STORED_ON_HDFS to FALSE.

    After modifying the parameters, synchronize the configurations and restart the cluster. In this case, the collection storage mode is changed to local disk storage.

  3. Create collections as required. New collection data is stored on the local disk.