Skip to content

Latest commit

 

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧱 Redis Cluster Docker Image

This repository provides a custom Redis Cluster Docker image based on the official Redis source.
It is preconfigured to run a 6-node Redis Cluster (3 masters + 3 replicas) for local development or testing purposes.
Detailed documentation and updates can be found on the official project page.


🚀 Features

  • Built on top of the official Redis image
  • Configured for cluster mode (6 nodes: ports 30001 - 30006)
  • Simplified setup with a one-time initialization command
  • Ideal for development, testing, or learning Redis Cluster internals

🧩 How It Works

Each container instance runs six Redis nodes internally, each bound to ports from 30001 to 30006.
After the first startup, you only need to initialize the cluster manually once.
All nodes are automatically connected and configured in cluster mode.


🐳 Run the Container

To start your Redis Cluster container:

docker run -d \
  -p 30001-30006:30001-30006 \
  --name redis-cluster \
  ercansormaz/redis-cluster

This command will:

  • Start the container in detached mode
  • Map host ports 30001-30006 to container ports 30001-30006
  • Create a container named redis-cluster

⚙️ Initialize the Cluster

Once the container is running, execute the following one-time setup command to initialize the Redis Cluster:

docker exec -it redis-cluster create-cluster create

This will:

  • Connect all 6 nodes together
  • Assign 3 master and 3 replica roles
  • Enable full cluster mode operation

After this step, your cluster is ready to use!


🧼 Stop & Cleanup

To stop the cluster:

docker stop redis-cluster

To remove it completely:

docker rm -f redis-cluster

🔍 Troubleshooting

  • Ports already in use?
    Ensure that ports 30001-30006 are free before running the container.

📦 Docker Hub

You can pull the image directly from Docker Hub:

docker pull ercansormaz/redis-cluster

📜 License

This project is licensed under the MIT License.

About

Lightweight Redis Cluster image — 6 nodes setup for easy local development & testing.

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages