?? Excited to Share My DevOps Course Project: Building a Multi-Tier Application Environment!??

?? Excited to Share My DevOps Course Project: Building a Multi-Tier Application Environment!??

Introduction

In today’s fast-paced digital landscape, the ability to deliver applications quickly and reliably is paramount. This is where DevOps comes into play, bridging the gap between development and operations to enhance collaboration and efficiency. In this article, I will share my journey of setting up a robust multi-tier application environment using various technologies, including Vagrant, Tomcat, Nginx, RabbitMQ, and MySQL. By the end of this post, you will have a clear understanding of the steps involved in creating a resilient application infrastructure.

BRIEF EXPLANATION

Project Overview

The goal of my project was to build a scalable and maintainable web application that could handle a significant amount of traffic while ensuring data integrity and performance. The architecture I chose consists of several key components:

  • MySQL: For data storage and management.
  • Memcache: To enhance performance through caching.
  • RabbitMQ: As a message broker for asynchronous communication.
  • Tomcat: To serve the application.
  • Nginx: As a reverse proxy to manage incoming requests.

Environment Preparation

Prerequisites

Before diving into the setup, ensure you have the following installed on your machine:

  1. Oracle VM VirtualBox: A powerful x86 and AMD64/Intel64 virtualization product.
  2. Vagrant: A tool for building and managing virtualized development environments.
  3. Git: For version control and managing your source code.

To install the Vagrant Hostmanager plugin, run the following command:

$ vagrant plugin install vagrant-hostmanager
        

Cloning the Repository

Start by cloning the source code repository:

$ git clone https://github.com/KrishanthaBSomarathna/DevOps_Project
$ cd vprofile-project
$ git checkout main
        

Bringing Up the VMs

Navigate to the Vagrant directory and bring up the virtual machines:

$ cd vagrant/
$ vagrant up
        

Note: Bringing up all the VMs may take some time, depending on your system's resources.

Service Configuration

1. MySQL Setup

To set up MySQL, SSH into the database VM:

$ vagrant ssh db01
        

Verify the hosts entry and update it if necessary:

# cat /etc/hosts
        

Update the OS and install the necessary packages:

# yum update -y
# yum install epel-release -y
# yum install git mariadb-server -y
        

Start and enable the MariaDB service:

# systemctl start mariadb
# systemctl enable mariadb
        

2. Memcache Setup

Memcache is crucial for caching database queries. Install it using:

# yum install memcached -y
# systemctl start memcached
# systemctl enable memcached
        

3. RabbitMQ Setup

Next, set up RabbitMQ for message brokering:

$ vagrant ssh app01
# yum install rabbitmq-server -y
# systemctl start rabbitmq-server
# systemctl enable rabbitmq-server
        

Allow RabbitMQ through the firewall:

# firewall-cmd --add-port=5672/tcp --permanent
# firewall-cmd --reload
        

4. Tomcat Setup

SSH into the Tomcat VM and install the necessary dependencies:

$ vagrant ssh app01
# yum update -y
# yum install epel-release -y
# dnf -y install java-11-openjdk java-11-openjdk-devel
# dnf install git maven wget -y
        

Deploy your application by copying the WAR file:

# cp target/vprofile-v2.war /usr/local/tomcat/webapps/ROOT.war
# systemctl start tomcat
# systemctl enable tomcat
        

5. Nginx Setup

Finally, set up Nginx as a reverse proxy:

$ vagrant ssh web01
# apt update
# apt upgrade
# apt install nginx -y
        

Create a configuration file for your application:

# vi /etc/nginx/sites-available/vproapp
        

Add the following content:

upstream vproapp {
    server app01:8080;
}
server {
    listen 80;
    location / {
        proxy_pass https://vproapp;
    }
}
        

Enable the configuration and restart Nginx:

# ln -s /etc/nginx/sites-available/vproapp /etc/nginx/sites-enabled/
# systemctl restart nginx
        

Testing and Validation

After setting up all the services, it’s crucial to test the application. Use tools like Postman or curl to send requests to your application and verify that it responds correctly. Monitor the logs for any errors and ensure that all services are running smoothly.

Lessons Learned

Throughout this project, I learned several valuable lessons:

  • Documentation is Key: Keeping track of configurations and changes helped me troubleshoot issues quickly.
  • Automation: Using Vagrant for environment setup significantly reduced the time spent on manual configurations.
  • Community Resources: Leveraging community forums and documentation was invaluable when facing challenges.

Conclusion

Building a robust multi-tier application environment is a rewarding experience that enhances your understanding of DevOps practices. By following the steps outlined in this article, you can create a scalable and maintainable application infrastructure. I encourage you to explore these technologies further and share your experiences with the community.

#DevOps #Vagrant #Docker #MySQL #Nginx #Tomcat #RabbitMQ #LearningJourney

Udemy

Course Link

Project GitHub Link

要查看或添加评论,请登录

Krishantha Bandara的更多文章

  • ?? Setting Up Multiple Vagrant VMs for a Local Development Environment ??

    ?? Setting Up Multiple Vagrant VMs for a Local Development Environment ??

    If you’re looking to create and manage multiple virtual machines (VMs) in a local development setup, Vagrant is a…

  • ?? Deploying WordPress on an Ubuntu Server ??

    ?? Deploying WordPress on an Ubuntu Server ??

    Deploying WordPress on an Ubuntu server is a powerful way to manage your website independently. Here’s a step-by-step…

  • ?? Understanding Linux Users & Groups (Linux 04) ??

    ?? Understanding Linux Users & Groups (Linux 04) ??

    Linux is a multi-user operating system, which means it’s built to handle multiple users securely and efficiently. One…

  • ?? Mastering Linux Filters, Redirection, and Piping in DevOps! ?? (Linux 4#)

    ?? Mastering Linux Filters, Redirection, and Piping in DevOps! ?? (Linux 4#)

    As I continue expanding my skillset in DevOps, I've been deep-diving into Linux commands, filters, and I/O redirection…

  • VIM EDITOR (Linux #3)

    VIM EDITOR (Linux #3)

    ?? Mastering Vim Editor: The Ultimate Tool for Developers! ?? If you’re serious about writing clean, efficient code…

  • Basics of Linux Commands (Linux #2)

    Basics of Linux Commands (Linux #2)

    ?? Mastering the Basics of Linux Commands ??? If you’re working in tech, especially in DevOps or system administration,…

  • Introduction to Linux #1

    Introduction to Linux #1

    ?? Unlock the Power of Open Source with Linux! ???? In today's tech-driven world, understanding Linux can open up a…

  • Vagrant Cloud

    Vagrant Cloud

    ?? Streamline Your Development Environment with Vagrant Cloud! ????? For developers looking to efficiently manage and…

  • Chocolatey CLI

    Chocolatey CLI

    ?? Boost Your Productivity with Chocolatey CLI – The Ultimate Windows Package Manager! ???? If you're managing software…

社区洞察

其他会员也浏览了