Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

guidance #3

Open
Natarajan77 opened this issue May 7, 2018 · 3 comments
Open

guidance #3

Natarajan77 opened this issue May 7, 2018 · 3 comments

Comments

@Natarajan77
Copy link

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

@eye0fra
Copy link
Contributor

eye0fra commented May 8, 2018

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.

@Natarajan77
Copy link
Author

Natarajan77 commented May 11, 2018

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/

@eye0fra
Copy link
Contributor

eye0fra commented Jul 30, 2018

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/"$//'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants