I've encountered connectivity issues when using Redis master, slave, and Sentinel instances in a Docker environment with multiple networks. The problem arises when the Sentinels return the IP address of the Redis master within the same network, while the application tries to connect to the Redis master through Redis Sentinel using IP address from the external network. This leads to connection failures.
Example of docker-compose, which causes the problem:
Although I have found a solution to my problem (by removing redis network), I believe the Redis documentation can be improved to provide more guidance on using Redis with Docker in scenarios involving multiple networks. This would help users to better understand the potential issues and the recommended configurations for seamless communication between Redis instances and applications.
Some specific areas where the documentation could be enhanced include:
Clarifying the importance of ensuring that all Redis instances (master, slaves, and Sentinels) and client apps are on the same Docker network (and not to use multiple sub-network for Redis in this case)
Providing examples and guidance for handling scenarios where Redis instances are connected to multiple Docker networks.
Explaining how to properly configure Sentinel instances to return the correct IP address of the Redis master, depending on the desired network for communication.
Please consider enhancing the Redis documentation to cover these aspects and help users avoid similar issues in the future.
I've encountered connectivity issues when using Redis master, slave, and Sentinel instances in a Docker environment with multiple networks. The problem arises when the Sentinels return the IP address of the Redis master within the same network, while the application tries to connect to the Redis master through Redis Sentinel using IP address from the external network. This leads to connection failures.
Example of docker-compose, which causes the problem:
Although I have found a solution to my problem (by removing redis network), I believe the Redis documentation can be improved to provide more guidance on using Redis with Docker in scenarios involving multiple networks. This would help users to better understand the potential issues and the recommended configurations for seamless communication between Redis instances and applications.
Some specific areas where the documentation could be enhanced include:
Please consider enhancing the Redis documentation to cover these aspects and help users avoid similar issues in the future.