Skip to content

Instantly share code, notes, and snippets.

@yaud
Created November 14, 2016 09:21
Show Gist options
  • Save yaud/85e0382d26c189bdf84f0297cd54f479 to your computer and use it in GitHub Desktop.
Save yaud/85e0382d26c189bdf84f0297cd54f479 to your computer and use it in GitHub Desktop.
Flushall on Redis cluster
#!/bin/sh
NODES=`redis-cli -h $1 cluster nodes | cut -f2 -d' '`
IFS="
"
for node in $NODES; do
echo Flushing node $node...
redis-cli -h ${node%:*} -p ${node##*:} flushall
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment