Skip to content

Instantly share code, notes, and snippets.

@nickyleach
Created October 2, 2012 05:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nickyleach/3816275 to your computer and use it in GitHub Desktop.
Save nickyleach/3816275 to your computer and use it in GitHub Desktop.
De-sharding Redis
scp redis-server-1:/var/lib/redis/appendonly.aof /var/lib/redis/appendonly.aof.1
scp redis-server-2:/var/lib/redis/appendonly.aof /var/lib/redis/appendonly.aof.2
cat /var/lib/redis/appendonly.aof.* > /var/lib/redis/appendonly.aof
return floor((crc32($key) % 64) / $num_nodes);
return crc32($key) % $num_nodes;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment