A fast and lightweight Redis Cluster Proxy for Redis 3.0 with cluster mode enabled focused on Linux >= 3.9. Clients designed for normal mode Redis can still be used through the proxy. Redirection errors are handled and slot map is cached in proxy.
Build from source:
$ make
Build in debug mode:
$ make debug
Configuration file:
# corvus.conf
# binding port
bind 12345
# redis cluster nodes, comma separated list, can supply only one node
node localhost:8000,localhost:8001,localhost:8002
# threads share the same binding port using SO_REUSEPORT
thread 4
# log level, available values: debug, info, warn, error
# if not supplied or wrong value `info` is used
loglevel info
# whether log to syslog
syslog 0
Run proxy:
./src/corvus corvus.conf
All single key commands are supported. Commands performing complex multi-key operations like unions or intersections are available as well as long as the keys all belong to the same node.
MGET
: split to multipleGET
MSET
: split to multipleSET
DEL
: split to multiple single keyDEL
EXISTS
: split to multiple single keyEXISTS
PING
: not forward to redis serverINFO
: not forward to redis server, return information collected in proxy
EVAL
: at least one key, if mutiple keys given, all keys should belong to same node
# key
SORT(with STORE)
# list
RPOPLPUSH
# set
SDIFF SDIFFSTORE SINTER SINTERSTORE SMOVE SUNION SUNIONSTORE
# sorted set
ZINTERSTORE ZUNIONSTORE
# hyperloglog
PFCOUNT PFMERGE
KEYS MIGRATE MOVE OBJECT RANDOMKEY RENAME RENAMENX SCAN WAIT
# string
BITOP MSETNX
# list
BLPOP BRPOP BRPOPLPUSH
# pub/sub
PSUBSCRIBE PUBLISH PUBSUB PUNSUBSCRIBE SUBSCRIBE UNSUBSCRIBE
# script
EVALSHA SCRIPT
# transaction
DISCARD EXEC MULTI UNWATCH WATCH
# cluster
CLUSTER
AUTH ECHO QUIT SELECT
BGREWRITEAOF BGSAVE CLIENT COMMAND CONFIG DBSIZE DEBUG FLUSHALL FLUSHDB LASTSAVE
MONITOR ROLE SAVE SHUTDOWN SLAVEOF SLOWLOG SYNC TIME