Redis教程

Redis cluster proxy 解决方法

本文主要是介绍Redis cluster proxy 解决方法,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!


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你想偏移多少偏移多少

 

 

 

 

这篇关于Redis cluster proxy 解决方法的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!