π§ Day 25 β Manual Stack Setup with Vagrant: Intro & Database Layer
Detailed Guide on Stack Setup and Its Components

Kicking off a new DevOps mini-series! Learn how to manually set up a full stack Java project using multi-stage Vagrant VMs. Today, we cover the Vagrant environment, plugin setup, and the full MySQL database configuration.
Welcome to Day 25 of my DevOps Journey in Public! π
This week, Iβm starting a mini-series on how I manually set up a Java-based project stack using Vagrant multi-VMs β and then how I plan to automate it with provisioning.
π§± Stack Overview
Weβll be building and connecting the following services across multiple Vagrant-managed virtual machines:
MySQL β SQL database
Memcached β Caching service
RabbitMQ β Broker/Queue
Tomcat β Application server
Nginx β Web server
π οΈ Prerequisites for This Setup
Before getting started, I made sure to install:
Vagrant
Git Bash or a Linux terminal
Vagrant plugins:
vagrant plugin install vagrant-hostmanager vagrant plugin install vagrant-vbguest
ποΈ Project Structure
vprofile-project/
βββ vagrant/
β βββ Manual_provisioning/
β βββ Vagrantfile
I cloned the repo and moved into the Manual_provisioning/ directory:
git clone -b main https://github.com/hkhcoder/vprofile-project.git
cd vprofile-project/vagrant/Manual_provisioning
vagrant up
If the VMs failed halfway, I just re-ran vagrant up again.
π¬ Step 1: MySQL (MariaDB) Setup
π SSH into the DB VM
vagrant ssh db01
sudo -i
π§Ύ Install MariaDB
yum install mariadb-server -y
systemctl start mariadb
systemctl enable mariadb
π Secure Installation
mysql_secure_installation
# Root password: admin123
ποΈ Create DB and User
mysql -u root -padmin123
> CREATE DATABASE accounts;
> GRANT ALL PRIVILEGES ON accounts.* TO 'admin'@'%' IDENTIFIED BY 'admin123';
> FLUSH PRIVILEGES;
> exit
π¦ Import DB Dump
git clone -b main https://github.com/hkhcoder/vprofile-project.git
cd vprofile-project
mysql -u root -padmin123 accounts < src/main/resources/db_backup.sql
π₯ Firewall Configuration
systemctl start firewalld
systemctl enable firewalld
firewall-cmd --zone=public --add-port=3306/tcp --permanent
firewall-cmd --reload
π Wrapping Up Day 25
β Weβve:
Set up the project environment
Installed required plugins
Brought up our VMs
Installed and configured MariaDB with a test DB and user
Next up? Memcached and RabbitMQ setup in Day 26. See you there! π
β‘οΈ Follow along the series and give feedback! #LearnInPublic #DevOps #Vagrant




