-
Operating System: Linux
- Ensure Docker and Docker Compose are installed.
- Install Java JDK 21 and Apache Maven 3.9.5.
-
Database User Setup:
- Configure the script/init.js file to add a new MongoDB user with a specified password.
-
Docker Network Configuration:
- Set the Docker network name to
clusternet
.
- Set the Docker network name to
-
Cluster Initialization:
- Run:
Custom volumes are mounted:
./init_mongo_cluster.sh
- Primary Node:
~/volumes/mongo7/primary:/data/db
- Secondary Node:
~/volumes/mongo7/secondary:/data/db
- Primary Node:
- Run:
-
Running the Cluster:
- Subsequently, run:
./run_mongo.sh
- Subsequently, run:
-
Microservice Deployment:
- Run:
This will build and deploy the People microservice using Docker Compose.
./run.sh
- Run:
-
API Access:
- Access the API documentation at http://localhost:7025/swagger-ui.html to interact with the available data manipulation APIs.
-
Data Generation:
- Trigger data generation with:
curl http://localhost:7025/api/v2/people/generate/new/data
- Trigger data generation with:
-
Benchmarking:
- Conduct benchmarking using Apache Benchmark:
ab -n 100 -c 10 http://localhost:7025/api/v2/people/generate/new/data
- Conduct benchmarking using Apache Benchmark:
-
Concurrency Configuration:
- Spring Boot is configured with virtual threads for enhanced performance.
-
Database Inspection:
- View the MongoDB instances using:
or
./look.sh mongo1
./look.sh mongo2
- View the MongoDB instances using:
-
Microservice Restart:
- Restart the People microservice with:
./restart people
- Restart the People microservice with:
-
Performance Tuning:
- The Dockerfile is tuned for high performance, aiming for optimal production deployment.
-
Deployment:
- Push the code to production confidently!
-
Collaboration:
- Feel free to send a pull request for improvements. Contributions are highly appreciated!