Dockerized Spring Boot application for Server side load balancing using Zuul and Eureka.
These instructions will get you a copy of the project up and running on your local machine for development purposes. See running for notes on how to run the project on a system.
-
Clone the project to your local environment:
git clone https://github.com/ankitrajput0096/Server_Side_LoadBalancing_Using_Zuul_and_Eureka
-
You need Docker to be installed:
https://download.docker.com/win/stable/Docker%20for%20Windows%20Installer.exe
Once you have docker installed on your environment, install the project dependencies via:
Build docker Image:
docker-compose build
Start docker:
docker-compose up
Or
Start docker with scaled up services:
docker-compose up --scale clientone=3 --scale clienttwo=3
Can scale up clientone and clienttwo services to max instances of 5.
If you want to scale even higher, then increase the port range in docker-compose
file.
Your Zuul proxy server should be now running on https://localhost:8000, ClientOne server should be now running on https://localhost:8080-8085 and ClientTwo server should be now running on https://localhost:8086-90 and Eureka server cluster should be now running on https://localhost:9001, https://localhost:9002, https://localhost:9003
- Install Postman (https://www.getpostman.com)
- Import Postman collection from the
Zuul_Eureka_SpringBoot.postman_collection.json
file - Enjoy !!
NOTE : To see server side load balancing observe terminal logs of docker-compose
. When trying to hit same endpoint multiple times parallely.
- Spring Boot - Spring Boot 2
- Maven - Dependency Management
- Docker - For containerization of application
- Zuul - For Routing and Filtering using Zuul
- Eureka - For Eureka admin and client
If you have any improvement suggestions please create a pull request and I'll review it.
- Ankit Rajput - Initial work - Github
This project is licensed under the MIT License
- Big thanks to Pivotal for Spring Boot framework, love it!