Redis Cluster and Docker Currently Redis Cluster does not support NATted environments and in general environments where IP addresses or TCP ports are remapped. Docker uses a technique called port mapping: programs running inside Docker containers may be exposed with a different port compared to the one the program believes to be using. This is useful in order to run multiple containers using the same ports, at the same time, in the same server. In order to make Docker compatible with Redis Cluster you need to use the host networking mode of Docker. Please check the --net=host option in the Docker documentation for more information. |
Redis 集群不支持nat转换的ip访问
其实可以这样处理
第一步:使用nat创建集群
第二步:停止redis cluster
第三步:修改每个节点的 node.conf 里面myself地址为nat地址
Redis cluster偏移量10000的解决方式
修改cluster.h里面的#define CLUSTER_PORT_INCR 10000
#define CLUSTER_PORT_INCR xxxx你想偏移多少偏移多少