Skip to content

Commit

Permalink
Fix is to consistently backup at <hostname>/data/
Browse files Browse the repository at this point in the history
1)cassandra backup location needs to be consistent even in case of the custom
  data_file_directories configured in cassandra.yaml

Change-Id: If0e90ac0ce248b06b7748a568ede3fcc13ac264e
Closes-Bug: #1566022
  • Loading branch information
aswanikumar90 committed Apr 6, 2016
1 parent f6fe196 commit 0cc083e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fabfile/tasks/backup_restore.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,10 @@ def backup_cassandra(db_datas, store_db='local', cassandra_backup='full'):
snapshot_dirs = sudo("find %s/ -name 'snapshots' " % db_path)
snapshot_dirs = snapshot_dirs.split('\r\n')
#get relative path to cassandra from db_path
path_to_cassandra = re.search('.*/cassandra/',db_path).group(0)
path_to_cassandra, data_dir = os.path.split(db_path)
while data_dir == '':
path_to_cassandra, data_dir = os.path.split(path_to_cassandra)
path_to_cassandra += '/'
for snapshot_dir in snapshot_dirs:
snapshot_list.append(snapshot_dir.replace(path_to_cassandra,''))
#get current snap_shot name from any snapshots folder created by nodetool
Expand Down Expand Up @@ -899,7 +902,6 @@ def restore_instance_image(backup_data_path, store_db='local'):
@roles('database')
def restore_zookeeper(backup_data_path, store_db='local'):
"""Restore zookeeper data to all database nodes """
#import pdb;pdb.set_trace()
global backup_path
host = env.host_string
msg = "Restoring backed-up data in ({HOST}).\n"
Expand Down

0 comments on commit 0cc083e

Please sign in to comment.