Load balancer that only look for record of a brand name
- Clone this repo
git clone https://github.com/bhhoang/mongolb
cd mongolb
Then install the module
git submodule --init --recursive --force
Build the module
./build.sh
- Make load balancer file
make
- Make the client file
g++ src/client/client.cpp -o client
- Create build for backend
mkdir -p backend/build
cd backend/build
- Build backend
cmake -S .. -B .
make
- You should run 3 backend for 3 localhost ports (these port should match with those in backendList.json) and 3 mongodb replicas
./mongo_app 8080 27017
./mongo_app 8081 27018
./mongo_app 8082 27019
- Go back to the mongolb folder
cd ../..
- Run the load balancer file with a port
./mongolb 3000
- Run the client with the port that match loadbalancer
./client 3000