Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cr34t1ve/distr-redis-microservice
Distributed Redis Implementation with Go, HAProxy and Docker
https://github.com/cr34t1ve/distr-redis-microservice
docker golang haproxy microservice redis
Last synced: 9 days ago
JSON representation
Distributed Redis Implementation with Go, HAProxy and Docker
- Host: GitHub
- URL: https://github.com/cr34t1ve/distr-redis-microservice
- Owner: cr34t1ve
- Created: 2024-07-13T15:46:40.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-07-13T16:00:13.000Z (4 months ago)
- Last Synced: 2024-07-13T17:21:40.750Z (4 months ago)
- Topics: docker, golang, haproxy, microservice, redis
- Language: Go
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Distributed Redis Implementation with Go, HAProxy and Docker
This project is a simple implementation of a distributed Redis system using Go, HAProxy and Docker. The project is divided into three main parts:
1. **Redis Cluster**: A Redis cluster with 3 master nodes
2. **Go Client**: A Go client that connects to the Redis cluster and performs some operations
3. **HAProxy Load Balancer**: A HAProxy load balancer that distributes the requests to the Redis cluster## Running the project
To run the project, you need to have Docker installed on your machine. Then, you can run the following commands:
1. **Build the Docker images**:
```bash
docker-compose build
```2. **Run the Docker containers**:
```bash
docker-compose up -d
```3. **Check the logs**:
```bash
docker-compose logs haproxy
```## Testing the project
To test the project, you can run the following command:
```bash
curl --location 'localhost:8081/key' --head
er 'Content-Type: application/json' --data '{"key": "hello", "value": "world"}'
```## Endpoints
The project has the following endpoints:
1. **GET /key**: Get the value of a key
2. **POST /key**: Set the value of a key
3. **DELETE /key**: Delete a key
4. **GET /health**: Check the health of the Redis cluster