redis-ha icon indicating copy to clipboard operation
redis-ha copied to clipboard

guidance

Open Natarajan77 opened this issue 6 years ago • 3 comments

Sir do you know how to backup and restore this stuff? Also any performance related parameters which requires tweaking.

Natarajan77 avatar May 07 '18 19:05 Natarajan77

Please see this as sample backup procedure :

https://github.com/openlab-red/redis-ha/blob/master/management/backup/README.md

About performance you can refer to the redis official document.

eye0fra avatar May 08 '18 05:05 eye0fra

Thank you sir again for your timely help :-) Trying to script into shell so that I can run automate it.

oc debug dc/backend-redis (this runs fine)

export REDIS_MASTER_IP=$(redis-cli -h backend-redis-sentinel -p 26379 --csv SENTINEL get-master-addr-by-name mymaster |awk -F, '{print $1}'|sed -e 's/^"//' -e 's/"$//') ----This one doesn't get triggered inside the debug console echo $REDIS_MASTER_IP

export REDIS_BACKUP_STATUS=$(redis-cli -h $REDIS_MASTER_IP -p 6379 bgsave) ----This one doesn't get triggered inside the debug console echo $REDIS_BACKUP_STATUS date -d @$(redis-cli -h $REDIS_MASTER_IP -p 6379 lastsave | cut -d ' ' -f1) ----This one doesn't get triggered inside the debug console

export REDIS_MASTER=$(oc get pods -lapp=backend-redis -o custom-columns=NAME:.metadata.name,IP:.status.podIP --no-headers | grep $REDIS_MASTER_IP| cut -d ' ' -f1) **----This one $REDIS_MASTER_IP from debug console need to get passed out for this to run ** oc rsync $REDIS_MASTER:/var/lib/redis/data/appendonly.aof /tmp/ oc rsync $REDIS_MASTER:/var/lib/redis/data/dump.rdb /tmp/

Natarajan77 avatar May 11 '18 04:05 Natarajan77

I can suggest to run all single command one by one from the following assignment and discover the error:

export REDIS_MASTER_IP=$(redis-cli -h backend-redis-sentinel -p 26379 --csv SENTINEL get-master-addr-by-name mymaster |awk -F, '{print $1}'|sed -e 's/^"//' -e 's/"$//')

  1. redis-cli -h backend-redis-sentinel -p 26379 --csv SENTINEL get-master-addr-by-name mymaster
  2. redis-cli -h backend-redis-sentinel -p 26379 --csv SENTINEL get-master-addr-by-name mymaster |awk -F, '{print $1}'
  3. redis-cli -h backend-redis-sentinel -p 26379 --csv SENTINEL get-master-addr-by-name mymaster |awk -F, '{print $1}'|sed -e 's/^"//' -e 's/"$//'

eye0fra avatar Jul 30 '18 07:07 eye0fra