Task 11.1

Mdkneema
3 min readMar 20, 2021

Configure Hadoop and start the cluster service using ansible playbook.

Description of the playbook and the jobs it will do (Master as well as slave)

Creating two groups- 1 for master and one for slave in ip.txt file whose address is given in the ansible.cfg file.

  1. The first Job is to copy the setups of both jdk and hadoop into the master as well as slave nodes of the hadoop cluster.
  2. installing jdk (jdk needs to be installed before the hadoop).
  3. installing hadoop (version needs to be compatible with jdk).

The execution will look like-

The tasks playbook will perform on master node.

After installing both jdk and hadoop, configure the hdfs-core.xml file in the master node, configure hdfs-site.xml file (with the use of variables to make it less hard coded).

hdfs-site.xml

Configure core-site.xml as well in the master node.

After configuring both the files in the master node, create the directory with which the slave nodes will share their storage.

After that format the directory by the command echo Y | hadoop namenode -format.(echo Y so that it will not ask for y in the input).

create the rule for firewall so that it will not block the incoming requests by the slave nodes to the master node.

Finally, starting the master node.(all of the code for master is attached together below this line).

The execution will look like —

The tasks playbook will perform on master node.

After installing both jdk and hadoop, configure the core-site.xml file in the slave node.

Configure hdfs-site.xml file.

Finally, create the directory by which slave will give its storage to the master.

start the data node service.

Execution will look like — -

--

--