kstyrc / embedded-redis

Redis embedded server for Java integration testing
840 stars 368 forks source link

Add support a real Redis Cluster #55

Open dmytroDragan opened 9 years ago

dmytroDragan commented 9 years ago

As far as I figure out, Redis Cluster and "Redis master slave model (made by slaveof replication) with sentinel" are two different things. So we can not enable cluster mode on second one. Two make a real Redis Cluster (which compatible with JedisCluster), we need "create" N nodes and "start"(configure) it.

Suggestion steps:

Create N nodes.

For each:

../../src/redis-server --port $PORT --cluster-enabled yes --cluster-config-file nodes-${PORT}.conf --cluster-node-timeout $TIMEOUT --appendonly yes --appendfilename appendonly-${PORT}.aof --dbfilename dump-${PORT}.rdb --logfile ${PORT}.log --daemonize yes
Setting up cluster

Using Jedis cluster functions similar to redis-trib.rb

Additional stuff

"Watch" functionality

For each:

../../src/redis-cli -p $PORT cluster nodes | head -30
Mxas commented 6 years ago

so for now we are not able to have embadded redis for JedisCluster client. May be some others options ?

Mxas commented 6 years ago

same story: #79

pPanda-beta commented 3 years ago

This fork has support for it

https://github.com/aarondwi/embedded-redis-cluster#using-ephemeral-ports

Can we take the changes on this repo?