🔰 Configure Hadoop and start cluster services using Ansible Playbook

In this task we will configure 1-namenode/Master and2-datanode/Slave nodes and start the cluster services using ansible playbook.
Pre-requisite: For same Use-Case
a. Centos-8
b. jdk-8u171-linux-x64.rpm
c. hadoop-1.2.1–1.86_x64.rpm
d. Ansible installed and configured
e. sshpass must be installed
STEP-1: Update the IP in Ansible Inventory

Here Group load-balancer will be configured as Namenode and Hadoop group as Datanode
STEP-2: Creating a Playbook to do the task



Before we run it we have used some template file so we have to create it that’s lead us to our 3rd step
STEP-3: Creating required template files
These template file has to be created in the same directory where playbook is to make it easier.

To use hadoop data node and slave node we must have these files configured and it is located in /etc/hadoop/ directory
In core-site.xml we need to pass the Masters Ip with port number

Similarly modifying the hdfs-site.xml using Jinja code.
STEP-4: Finally Running the Playbook



STEP-5: Checking for the result



Above we can see that Namenode and Data node are perfectly established
let’s use the dfs-admin command to check even more.
# hadoop dfsadmin -report


Thanks everyone who you guys enjoyed and learned.