All Projects → salimane → Redis Tools

salimane / Redis Tools

my tools working with redis

Projects that are alternatives of or similar to Redis Tools

Redis Cluster
Redis Cluster setup running on Kubernetes
Stars: ✭ 230 (+121.15%)
Mutual labels:  redis, cluster
Bitnami Docker Redis
Bitnami Redis Docker Image
Stars: ✭ 317 (+204.81%)
Mutual labels:  redis, cluster
Reading And Comprehense Redis Cluster
分布式NOSQL redis源码阅读中文分析注释,带详尽注释以及相关流程调用注释,提出改造点,redis cluster集群功能、节点扩容、槽位迁移、failover故障切换、一致性选举完整分析,对理解redis源码很有帮助,解决了source insight中文注释乱码问题,更新完毕(redis源码学习交流QQ群:568892619)
Stars: ✭ 224 (+115.38%)
Mutual labels:  redis, cluster
Redcon
Redis compatible server framework for Go
Stars: ✭ 1,683 (+1518.27%)
Mutual labels:  redis, protocol
Docker Redis Cluster
Dockerfile for Redis Cluster (redis 3.0+)
Stars: ✭ 1,035 (+895.19%)
Mutual labels:  redis, cluster
Koa Redis
Redis storage for Koa session middleware/cache with Sentinel and Cluster support
Stars: ✭ 324 (+211.54%)
Mutual labels:  redis, cluster
Redis Resharding Proxy
Redis Resharding Proxy
Stars: ✭ 168 (+61.54%)
Mutual labels:  sharding, redis
Memento
Fairly basic redis-like hashmap implementation on top of a epoll TCP server.
Stars: ✭ 74 (-28.85%)
Mutual labels:  redis, cluster
Rediscluster Py
a Python interface to a Cluster of Redis key-value store
Stars: ✭ 46 (-55.77%)
Mutual labels:  redis, cluster
Iodine
iodine - HTTP / WebSockets Server for Ruby with Pub/Sub support
Stars: ✭ 720 (+592.31%)
Mutual labels:  redis, cluster
Zanredisdb
Yet another distributed kvstore support redis data and index. moved to: https://github.com/youzan/ZanRedisDB
Stars: ✭ 64 (-38.46%)
Mutual labels:  sharding, redis
Phpredis
A PHP extension for Redis
Stars: ✭ 9,203 (+8749.04%)
Mutual labels:  redis, cluster
Jupiter
Jupiter是一款性能非常不错的, 轻量级的分布式服务框架
Stars: ✭ 1,372 (+1219.23%)
Mutual labels:  cluster
Pythonstudy
Python related technologies used in work: crawler, data analysis, timing tasks, RPC, page parsing, decorator, built-in functions, Python objects, multi-threading, multi-process, asynchronous, redis, mongodb, mysql, openstack, etc.
Stars: ✭ 103 (-0.96%)
Mutual labels:  redis
Kubernetes Pfsense Controller
Integrate Kubernetes and pfSense
Stars: ✭ 100 (-3.85%)
Mutual labels:  cluster
Kurasuta
A Custom discord.js Sharding Library inspired by eris-sharder.
Stars: ✭ 101 (-2.88%)
Mutual labels:  cluster
Actix Redis
Redis actor and middleware for Actix
Stars: ✭ 104 (+0%)
Mutual labels:  redis
Seckill
Spring Boot+MySQL+Redis+RabbitMQ的高性能高并发商品秒杀系统设计与优化
Stars: ✭ 103 (-0.96%)
Mutual labels:  redis
Redis Cui
Simple, visual command line tool for redis
Stars: ✭ 101 (-2.88%)
Mutual labels:  redis
Springboot Link Admin
Vue Springboot Project | Link Admin后端,适用于小型项目
Stars: ✭ 100 (-3.85%)
Mutual labels:  redis

#Generating Redis Protocol

Generate the Redis protocol, in raw format, in order to use 'redis-cli --pipe' command to massively and quickly insert/delete.... keys in a redis server. It accepts as input a pipe with redis commands formatted as "DEL key", "SET key value" ...

####Usage:

echo "SET mykey1 value1\nDEL mykey2" > data.txt
cat data.txt | python gen_redis_proto.py | redis-cli --pipe

#Redis Copy

Redis Copy the keys in a source redis server into another target redis server. The script probably needs to be added to a cron job if the keys are a lot because it only copies a fix number of keys at a time and continue from there on the next run. It does this until there is no more keys to copy

####Dependency:

sudo easy_install -U redis

####Usage:

python redis-copy.py [options]

####Options:

-l ..., --limit=...         optional numbers of keys to copy per run, if not defined 10000 is the default . e.g. 1000
-s ..., --source=...        source redis server "ip:port" to copy keys from. e.g. 192.168.0.99:6379
-t ..., --target=...        target redis server "ip:port" to copy keys to. e.g. 192.168.0.101:6379
-d ..., --databases=...     comma separated list of redis databases to select when copying. e.g. 2,5
-h, --help                  show this help
--clean                     clean all variables, temp lists created previously by the script

####Examples:

python redis-copy.py --help                                show this doc

python redis-copy.py \
--source=192.168.0.99:6379 \
--target=192.168.0.101:6379 \
--databases=2,5 --clean                                 clean all variables, temp lists created previously by the script

python redis-copy.py \
--source=192.168.0.99:6379 \
--target=192.168.0.101:6379 \
--databases=2,5                                         copy all keys in db 2 and 5 from server 192.168.0.99:6379 to server 192.168.0.101:6379
                                                      with the default limit of 10000 per script run

python redis-copy.py --limit=1000 \
--source=192.168.0.99:6379 \
--target=192.168.0.101:6379 \
--databases=2,5                                         copy all keys in db 2 and 5 from server 192.168.0.99:6379 to server 192.168.0.101:6379
                                                      with a limit of 1000 per script run

#Redis sharding

Reshard the keys in a number of source redis servers into another number of target cluster of redis servers in order to scale an application. The script probably needs to be added to a cron job if the keys are a lot because it only reshards a fix number of keys at a time and continue from there on the next run. It does this until there is no more keys to reshard

You can use rediscluster-py or rediscluster-php as client libraries of your new cluster of redis servers.

####Dependency:

sudo easy_install -U redis

####Usage:

python redis-sharding.py [options]

####Options:

-l ..., --limit=...         optional numbers of keys to reshard per run, if not defined 10000 is the default . e.g. 1000
-s ..., --sources=...       comma separated list of source redis servers "ip:port" to fetch keys from. e.g. 192.168.0.99:6379,192.168.0.100:6379
-t ..., --targets=...       comma separated list target redis servers "node_i#ip:port" to reshard the keys to. e.g. node_1#192.168.0.101:6379,node_2#192.168.0.102:6379,node_3#192.168.0.103:6379
-d ..., --databases=...     comma separated list of redis databases to select when resharding. e.g. 2,5
-h, --help                  show this help
--clean                     clean all variables, temp lists created previously by the script

####IMPORTANT:

This script assume your target redis cluster of servers is based on a node system, which is simply a host:port pair that points to a single redis-server instance. Each node is given a symbolic node name "node_i" where i is the number gotten from this hashing system

str((abs(binascii.crc32(key) & 0xffffffff) % len(targets)) + 1)

to uniquely identify it in a way that doesn’t tie it to a specific host (or port). e.g.

config = {
  'node_1':{'host':'192.168.0.101', 'port':6379},
  'node_2':{'host':'192.168.0.102', 'port':6379},
  'node_3':{'host':'192.168.0.103', 'port':6379},
}

####Examples:

python redis-sharding.py --help                                show this doc

python redis-sharding.py \
--sources=192.168.0.99:6379,192.168.0.100:6379 \
--targets="node_1#192.168.0.101:6379,node_2#192.168.0.102:6379,node_3#192.168.0.103:6379" \
--databases=2,5 --clean

python redis-sharding.py \
--sources=192.168.0.99:6379,192.168.0.100:6379 \
--targets="node_1#192.168.0.101:6379,node_2#192.168.0.102:6379,node_3#192.168.0.103:6379" \
--databases=2,5

python redis-sharding.py --limit=1000 \
--sources=192.168.0.99:6379,192.168.0.100:6379 \
--targets="node_1#192.168.0.101:6379,node_2#192.168.0.102:6379,node_3#192.168.0.103:6379" \
--databases=2,5

#Redis Memory Stats

A memory size analyzer that parses the output of the memory report of rdb https://github.com/sripathikrishnan/redis-rdb-tools for memory size stats about key patterns At its core, RedisMemStats uses the output of the memory report of rdb, which echoes a csv row line for every key stored to a Redis instance. It parses these lines, and aggregates stats on the most memory consuming keys, prefixes, dbs and redis data structures.

####Usage:

rdb -c memory <REDIS dump.rdb TO ANALYZE> | ./redis-mem-stats.py [options]

OR

rdb -c memory <REDIS dump.rdb TO ANALYZE> > <OUTPUT CSV FILE>
./redis-mem-stats.py [options] <OUTPUT CSV FILE>

####Options:

--prefix-delimiter=...           String to split on for delimiting prefix and rest of key, if not provided `:` is the default . --prefix-delimiter=#

####Dependencies:

rdb (redis-rdb-tools: https://github.com/sripathikrishnan/redis-rdb-tools)

####Examples:

rdb -c memory /var/lib/redis/dump.rdb > /tmp/outfile.csv
./redis-mem-stats.py /tmp/outfile.csv

or

rdb -c memory /var/lib/redis/dump.rdb | ./redis-mem-stats.py

Bitdeli Badge

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].