Hi,
How can I change data directly location in my running cluster.
Example : /data to /dse_data
Hi,
How can I change data directly location in my running cluster.
Example : /data to /dse_data
You can change it in your cassandra.yaml file, as specified in the docs here:
Bear in mind that you will need to restart the node(s).
Also: https://stackoverflow.com/questions/9631591/apache-cassandra-data-storage-on-disk
Thanks @lounes.amani_148266 for your answer and it seems it is for new cluster configuration,But I am looking answer for running cluster like If my /data directory is full and somehow I am not able to increase size of /data and want to migrate all my data to new directory /data_dse.
@satvantsingh_190085 Follow this procedure to relocate the data directory in a rolling fashion, one node at a time.
NOTE - These instructions apply to open-source Apache Cassandra as well.
STEP 1 - Force all data to be flushed to disk so there are no commit logs to replay on startup:
$ nodetool drain
STEP 2 - Shutdown DSE (or Cassandra).
STEP 3 - Relocate the contents in the old data_file_directories to the new location. For example, if the old location is /var/lib/cassandra/data
and the new location is /path/to/new/data
:
$ mv /var/lib/cassandra/data/* /path/to/new/data/.
STEP 4 - Review all the other directories used by Cassandra. If the filesystem is going to be affected, you will need to relocate these directories too:
hints_directory: /var/lib/cassandra/hints metadata_directory: /var/lib/cassandra/metadata commitlog_directory: /var/lib/cassandra/commitlog cdc_raw_directory: /var/lib/cassandra/cdc_raw saved_caches_directory: /var/lib/cassandra/saved_caches
STEP 5 - Review the directories you've configured in dse.yaml
to see if you need to relocate them too.
STEP 6 - Update the directory paths in cassandra.yaml
(and dse.yaml
if necessary) to reflect the changes you made in the previous step.
STEP 7 - Start DSE on the node. Monitor the progress of the startup sequence, for example:
$ tail -f /var/log/cassandra/system.log
It might also be necessary to monitor the application logs to make sure there are no issues with the cluster after the node has been restarted.
Repeat the steps above on the next node until all nodes in the cluster has been updated. Cheers!
6 People are following this question.
DataStax Enterprise is powered by the best distribution of Apache Cassandra ™
© 2023 DataStax, Titan, and TitanDB are registered trademarks of DataStax, Inc. and its subsidiaries in the United States and/or other countries.
Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries.
Privacy Policy Terms of Use