thomasjpfan/redis-cluster-docker-swarm

Connecting with redis-cli

Opened this issue · 1 comments

I am trying to connect to the cluster with redis-cli, but am having some issues. Do you have an example of how to do this?

I am logged in to the machine running the docker master node.

I updated the usage section of the readme a little:

Usage

  1. Setup docker swarm
  2. Create a overlay network:
docker network create --attachable --driver overlay redis
  1. Modify scripts/docker-compose.yml to how you want to deploy the stack.
  2. Run scripts/bootstrap.sh.
bash scripts/bootstrap.sh latest
  1. Connect to with redis-cli
docker run --rm --network redis -ti redis:4.0.9-alpine redis-cli -h redis

To access the redis cluster outside of docker, port 6379 needs to be expose. This can be done by adding ports to the docker-compose file:

...
  redis:
    image: thomasjpfan/redis-look
    ports:
      - "6379:6379"
...