I am using a redis-server:latest image. I used "docker run -it --name="redis2" redis:1 bash" command and got inside the container. I saw that by default redis is listening to Port: 6379.
Running in stand alone mode
Port: 6379
PID: 39
http://redis.io
[39] 01 Mar 09:03:45.669 # Server started, Redis version 2.8.4 [39] 01 Mar 09:03:45.669 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition.
To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect. [39] 01 Mar 09:03:45.669 * The server is now ready to accept connections on port 6379
And then further there is no response. I tried "redis-cli ping". There was no response. Then I hit "ctrl+c" and type, "redis-cli ping" and get following response:
Could not connect to Redis at 127.0.0.1:6379: Connection refused
I tried to change the port to 6001 by executing following:
redis-server --port 6003
And I see following response:
Running in stand alone mode
Port: 6003
PID: 47
And again I tried "redis-cli ping" and it threw me the same error:
Could not connect to Redis at 127.0.0.1:6379: Connection refused
How do I fix this? Also I have updated the port(the new port 6003) in "/etc/redis/redis.conf" location.
Thank you