Arth Task 11.1

Devanshu Singh
2 min readMar 22, 2021

Task Description:

11.1 Configure Hadoop and start cluster services using Ansible Playbook.

So, in this task, we have to write an Ansible playbook with the help of which we can easily configure the Hadoop HDFS cluster.

We all know setting up the Hadoop cluster takes very much time but by automating it with the help of ansible we have to run only some playbook and our HDFS cluster is ready to use.

Before starting this task we should know the Hadoop clusters then only we can write the Ansible playbook.

So first of all create a workspace, where I am going to put all my playbooks.

workspace directory

creating the ansible.cfg file for telling the ansible about the hosts.

In the host's file, I have written the IP of the hosts.

Writing the Master.yml playbook for configuring the IP ( 172.20.10.5 ) as MasterNode.

Writing the Slave.yml playbook for configuring the IP ( 172.20.10.6 ) as SlaveNode.

Now, copying the hdfs-site.xml file from “ /etc/hadoop/hdfs-site.xml” to our Hadoop_task11 workspace and then editing it for further use.

Copying the core-site.xml file from “ /etc/hadoop/core-site.xml” to our Hadoop_task11 workspace and then editing it for further use

Now run the playbook main_play.yml and you are done setting up your Hadoop HDFS cluster using the ansible-playbook.

Now in the last running the Hadoop command to check whether the Hadoop HDFS cluster is being configured or not.

Checking that the Hadoop cluster is configured or not.

In the above image, you have seen that we have successfully configured the Hadoop cluster with the help of ansible using the ansible playbooks.

THANK YOU !!

Stay tuned for more …

--

--