projecteru / redis-cerberus

Redis Cluster Proxy
MIT License
352 stars 82 forks source link

配置文件中node行不支持k8s的域名 #49

Open totemofwolf opened 5 years ago

totemofwolf commented 5 years ago

我们的redis cluster运行在pod里,配置pod的服务DNS地址到配置文件后,启动报错:

2019-09-02 09:56:24,367 E 140477375293184 Disconnect ext-redis-cache-cluster-0.ext-redis-cache-cluster-svc:6379 for Unknown host: ext-redis-cache-cluster-0.ext-redis-cache-cluster-svc
2019-09-02 09:56:24,367 E 140477375293184 Disconnect ext-redis-cache-cluster-1.ext-redis-cache-cluster-svc:6379 for Unknown host: ext-redis-cache-cluster-1.ext-redis-cache-cluster-svc
2019-09-02 09:56:24,367 E 140477375293184 Disconnect ext-redis-cache-cluster-2.ext-redis-cache-cluster-svc:6379 for Unknown host: ext-redis-cache-cluster-2.ext-redis-cache-cluster-svc
2019-09-02 09:56:24,367 E 140477375293184 Disconnect ext-redis-cache-cluster-3.ext-redis-cache-cluster-svc:6379 for Unknown host: ext-redis-cache-cluster-3.ext-redis-cache-cluster-svc
2019-09-02 09:56:24,367 E 140477375293184 Disconnect ext-redis-cache-cluster-4.ext-redis-cache-cluster-svc:6379 for Unknown host: ext-redis-cache-cluster-4.ext-redis-cache-cluster-svc
2019-09-02 09:56:24,367 E 140477375293184 Disconnect ext-redis-cache-cluster-5.ext-redis-cache-cluster-svc:6379 for Unknown host: ext-redis-cache-cluster-5.ext-redis-cache-cluster-svc

redis-cerberus 目前不支持域名方式么? 如果想要支持,可以修正哪里的源码?

zheplusplus commented 5 years ago

Cerberus 使用的是 inet_pton 调用, 应该是支持连接域名的.

totemofwolf commented 5 years ago
ext-redis-cache-cluster-X.ext-redis-cache-cluster-svc

这个就是POD的k8s内部地址,启动的时候不能解析成IP