ARTH Task 7
By Team ARTH2020.1.3
Task 7.1: Elasticity Task
🔅Integrating LVM with Hadoop and providing Elasticity to Data Node Storage
🔅Increase or Decrease the Size of Static Partition in Linux.
🔅Automating LVM Partition using Python-Script.
Solution (7.1)
Pre-requisites — Set up a Hadoop cluster with one name node, at least 2 data nodes, and 1 client node.
- Creating physical volume using pvcreate command
2. Creating a volume group by allocating the new PV
3. Create a logical volume of the desired size (Here 700 MiB) using lvcreate command
4. Format the new LV and mount it on the directory through data node will contribute storage
5. Connect all the data nodes and check the dfsadmin report for the contribution of each data node
IP addresses to be noted: Name Node — 192.168.1.39/32, Data node 1–192.168.1.40/32, Data Node 2–192.168.1.52/32
As you can see in the images above, Data node 1 is contributing roughly 700 MiB as only a particular partition is mounted on the directory through which the node contributes storage.
6. Using LV’s nature of dynamic partitions to increase the storage contributed by data node 1 and format it partially
7. Automating LVM using Python script — Please refer to https://github.com/devanshu06/ArthTeamTasks-Repo for the code
Task 7.2: Docker Task
🔅Configuring HTTPD Server on Docker Container
🔅Setting up Python Interpreter and running Python Code on Docker Container
Solution (7.2)
Pre-requisites — Docker must be set up in the system. (Here, the entire task is done on an RHEL8 VM)
1. Configuring HTTPD server on Docker
To configure the HTTPD server on Docker, we can use any official Docker images from Docker Hub. We will be using CentOS for this.
While launching the Docker container with CentOS, we can also expose port 80 of the container so that the webserver can be contacted by the base OS on which the VM is running.
After launching the container, we can use the pre-configured yum reps to directly install httpd, as well as net-tools, which is helpful in many networking-related operations.
Now, to start the service, we cannot use systemctl like we typically use in RHEL8. Instead, we need the command /usr/bin/httpd, which is actually the command that starts httpd service in RHEL8 in the background, when we use the systemctl start httpd command.
To check if the server is actually accessible, we can try to access the webserver through the port we have exposed (8080) on the host to the container’s port 80.
2. Setting up Python in the container
To work with Python in a container using CentOS image, we can once again use the pre-configured yum repository to install Python version 3.
To test it, we can simply type python3 to access the Python REPL, which is also a confirmation that Python programs can be executed in this container.