Redis Cluster over stunnel configuration

redisstunnel

I'm trying to set up a 3 node Redis Cluster that communicates over stunnel.

Redis listens on port 6379 (configurable) for client pub/sub and on the configured port+10000 (not configurable – it becomes 16379 in this case) for cluster communication.

I haven't had much luck configuring stunnel for this. Could someone walk me through the configuration?

This is what I've got for node 1:

cert = /etc/stunnel/private/private.pem
pid = /var/run/stunnel.pid

[6382]
client = yes
accept = localhost:6382
connect = redis2:26382

[6383]
client = yes
accept = localhost:6383
connect = redis3:26383

[26381]
client = no
accept = 26381
connect = 6381

The other nodes have a config that follows a similar pattern.

http://redis.io/topics/cluster-tutorial says redis cluster mode "does not support NATted environments and in general environments where IP addresses or TCP ports are remapped."

Best Answer

Last week I tried to config a redis server cluster securized with stunnel, and I get to start the cluster with redis-trib, but when the nodes started to send the cluster meet command to the rest of the nodes appears the problems, because the redis library in the nodes said to me that it didn't connect to the nodes.

The configuration are the same that are specified, with 3 masters and 2 replications nodes for every master, in the stunnel config file define a server that receive information in arbitrary port, securize the information, and send to redis port in localhost, and a client configuration for every replica node, two in my case, that call to arbitrary port in localhost to the secured port in the external node, and in the redis-trib script specified the secured clients:

localhost:xxxx localhost:xxxx ...