Subscribe
docker compose exec redis /bin/bash
redis-cli -h redis-node-5 -a bitnami -c
> ssubscribe sfoo
> ssubscribe sbar
Publish
docker compose exec redis /bin/bash
redis-cli -h redis-node-5 -a bitnami -c
> spublish sfoo 1
> spublish sbar 1
services: | |
redis-node-0: | |
image: docker.io/bitnami/redis-cluster:7.0 | |
environment: | |
- 'REDIS_PASSWORD=bitnami' | |
- 'REDIS_NODES=redis-node-0 redis-node-1 redis-node-2 redis-node-3 redis-node-4 redis-node-5' | |
redis-node-1: | |
image: docker.io/bitnami/redis-cluster:7.0 | |
environment: | |
- 'REDIS_PASSWORD=bitnami' | |
- 'REDIS_NODES=redis-node-0 redis-node-1 redis-node-2 redis-node-3 redis-node-4 redis-node-5' | |
redis-node-2: | |
image: docker.io/bitnami/redis-cluster:7.0 | |
environment: | |
- 'REDIS_PASSWORD=bitnami' | |
- 'REDIS_NODES=redis-node-0 redis-node-1 redis-node-2 redis-node-3 redis-node-4 redis-node-5' | |
redis-node-3: | |
image: docker.io/bitnami/redis-cluster:7.0 | |
environment: | |
- 'REDIS_PASSWORD=bitnami' | |
- 'REDIS_NODES=redis-node-0 redis-node-1 redis-node-2 redis-node-3 redis-node-4 redis-node-5' | |
redis-node-4: | |
image: docker.io/bitnami/redis-cluster:7.0 | |
environment: | |
- 'REDIS_PASSWORD=bitnami' | |
- 'REDIS_NODES=redis-node-0 redis-node-1 redis-node-2 redis-node-3 redis-node-4 redis-node-5' | |
redis-node-5: | |
image: docker.io/bitnami/redis-cluster:7.0 | |
depends_on: | |
- redis-node-0 | |
- redis-node-1 | |
- redis-node-2 | |
- redis-node-3 | |
- redis-node-4 | |
environment: | |
- 'REDIS_PASSWORD=bitnami' | |
- 'REDISCLI_AUTH=bitnami' | |
- 'REDIS_CLUSTER_REPLICAS=1' | |
- 'REDIS_NODES=redis-node-0 redis-node-1 redis-node-2 redis-node-3 redis-node-4 redis-node-5' | |
- 'REDIS_CLUSTER_CREATOR=yes' | |
ports: | |
- 6379:6379 | |
redis: | |
image: bitnami/redis:7.0 | |
environment: | |
- ALLOW_EMPTY_PASSWORD=yes |
docker compose up |
StackExchange.Redis is not yet support Shared Pub/Sub commands.
see: https://hub.docker.com/r/bitnami/redis-cluster/ for more detail.