How can I change data directly location in my running cluster.
Example : /data to /dse_data
Bringing together the Apache Cassandra experts from the community and DataStax.
Want to learn? Have a question? Want to share your expertise? You are in the right place!
Not sure where to begin? Getting Started
@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
$ 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
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!
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).
6 People are following this question.