I have setup a dockerized redis cluster in windows 10. I could connect to docker cluster from container. But when i try to fetch cluster node info from my web application which is not running on docker it give me error
org.springframework.data.redis.ClusterStateFailureException: Could not retrieve cluster information. CLUSTER NODES returned with error.
I have created redis cluster in different ways but none of them worked for me.
Created redis cluster in bridge network mode and published respective port but was getting same error. Tried different port mapping :
- only mapped port skipped IP. docker inspect shows port mapping as(0.0.0.0:7000:6379)
- Provided both IP and port. IP(provided machine host ip , 127.0.0.1, docker NAT ip). docker inspect shows port mapping as(127.0.0.1:7000->6379/tcp), (hostip:7000->6379/tcp),(dockerNAtIP:7000->6379/tcp)
Created redis cluster in --network=host mode. a. Did not publish port as it id not ideal to do that. b. Also published port in the same manner as mentioned above.
But i was getting same error. Finally did setup without docker in windows and i was able to connect to redis cluster and fetch node info.
Is it not possible to connect dockerized redis cluster from application running outside docker?
Tried with all this steps: