Today’s world is all about data and it is the most critical thing for anyone. A company having lots of data grows like anything and they always want to get more and more data. We can’t imagine how much data is generated each day on internet and it is growing rapidly.

For storing data we require hard disks or storage units, but do we have such a large hard disk for storing data in Petabytes, Exabytes or more? This is a big problem of how to store so much of data effectively. This problem is known as Big Data. Sometimes…

Hello! We will see how to automate logical volume management by writing a python code,

To get idea about creating logical volumes by commands and also integrating it with Hadoop you can read it here.

So, here we are creating a python code that will give us options to perform some operations related to LVM by integrating Linux commands for LVM into it using os or subprocess module of python.

We are creating a small menu from which user has to select options. Following is the python code,

from subprocess import getoutput
from os import system

We will see how to create partitions in Linux system (rhel8 in my case) and then increase or decrease the size of that static partition without losing data.

fdisk -l is a command that will list all disks and devices (partitions) present in our system

fdisk -l

For creating a static partition I am selecting an available disk /dev/sdb. To enter into this disk use the fdisk command,

fdisk /dev/sdb
  1. Enter n for creating new partition.
  2. We can create maximum 4 primary partition, enter p for primary partition (which will be by default).
  3. give the partition number from 1 to…

Hello Everyone!

Today we will create a setup such that our system is able to ping Google but not Facebook by editing routes in routing table.

A routing table is the place where routing information is stored that contains routing entries or list of destinations. If a system tries to connect or ping to some other system with an IP address (destination IP), it first go to this routing table and if there is some rule which is allowing that destination then only network packets will be created otherwise not.

We can use route -n command to see rules or…

Hello there!

Let’s set up Python interpreter inside a docker container.

It is required that docker is installed in the base operating system. So we can run a docker container.

Here I am running a docker container with some name ‘pyos’ using centos docker image and also I am attaching a volume to this container (a directory created in base OS). So when the container is created a directory will be created inside it (here I used same name /pyfiles or we use some existing path) and will be linked to directory in the base OS (/pyfiles).

If we put…

Hello, we will see how to set up httpd (apache) web server inside a docker container.

First launching a container, to launch a docker container we can use docker run command or docker container run command (newer),

note: docker should be installed and docker service should be running.

Here in the example below I am launching a container with name ‘myos1’ using the docker image of centos:latest. I am exposing the port number 80 for this container (PAT) and can access it using port 81 from outside the container, -it option will give me interactive terminal. …

Simple Queue Service (Amazon SQS) is a fully managed service provided by AWS for message queuing. It is highly useful in microservices, distributed systems, and serverless applications as it decouples them by acting as a middle ware . Amazon SQS moves data between distributed application components and helps you decouple these components. This decoupling helps to keep safe the data in case consumer is down.

Producers are who send messages to SQS, which then SQS stores. Consumers have to come to SQS and keep checking for the messages, it is called Polling. If consumer finds data there in SQS it…

Ansible has to know its target nodes where it has to configure all the things and the information about the target nodes is written in the inventory file of ansible. But what if we don’t know the IP of the target node, which happens most of the time in real scenario. If we use ansible to provision an ec2 instance, we get the IP only after provisioning. So, we want that after instance is created ansible retrieve the instance IP for further configuration. In this situation dynamic inventory can help to dynamically get the current IP of the target node.

We will see how to setup multiple web servers with one load balancer and all these over AWS instances. Since Ansible Roles are the great way of managing our code of playbooks, we are going to create multiple roles for,

📁 Launching AWS instances.

📁 Configuring Apache web server in the instances.

📁 Configuring an instance as HAProxy load balancer.

This is my ansible configuration file, we will be connecting to ec2 instances as ‘ec2-user’ so I have done privilege escalation to become root user for configuring everything in the instances.

We will see how to write an Ansible playbook that does the
following operations in the managed nodes:
🔹 Configure Docker.
🔹 Start and enable Docker services.
🔹 Pull the httpd server image from the Docker Hub.
🔹 Run the docker container and expose it to the public.
🔹 Copy the html code to the document root and start the web server.

So first, and obviously, ansible should be installed in the system (which is our contoller node), here I am using RedHat8 VM.

Vikas Verma

Tech and Programming, MLOps, DevOps Assembly Lines, Hybrid Multi Cloud, Flutter and Ansible Automation

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store