DatascienceGeeks
DatascienceGeeks

Reputation: 438

windows redis-client connect to docker server failed

I am using windows10, redis-64bit, I started a redis container with command:

docker run --name myredis -d redis redis-server --appendonly yes

when I try to connect to this container using:

redis-cli -h 192.168.99.1 -p 6379

it shows:

Could not connect to Redis at 192.168.99.1:6379: Unknown error

here, 192.168.99.1 is my virtual machine ip address, anyone know how to solve this issue, thanks!

Upvotes: 0

Views: 365

Answers (1)

Assael Azran
Assael Azran

Reputation: 2993

To connect to a redis container from a remote server you should do the following:

  • Start redis container on host (192.168.99.1):

    docker run --name myredis -p 7000:6379 -d redis redis-server
    
  • Connect via remote server:

    redis-cli -h 192.168.99.1 -p 7000
    

Upvotes: 1

Related Questions