thomasjpfan / redis-cluster-docker-swarm

Redis cluster cache configuration for docker swarm
MIT License
112 stars 46 forks source link

Connecting with redis-cli #2

Open stephan-nordnes-eriksen opened 6 years ago

stephan-nordnes-eriksen commented 6 years ago

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.

thomasjpfan commented 6 years ago

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"
...