Zoro
2 min readMar 21, 2021

--

CONFIGURING HADOOP AND STARTING CLUSTER SERVICES USING ANSIBLE PLAYBOOK!

  • Configuring hdfs-site

Instead of editing the existing files through the playbook, the more efficient way is to copy the file from the controller, by making the changes according to the need. Create the hdfs-site.xml file in the controller and edit the syntax as follows for Jinja Parsing:

Here the node and hdfs_dir are the variables we had created main playbook. They will help us in editing the files for both uses - master and slave nodes.

We use the template module to copy the files so that the file will get parsed by Ansible during the task execution.

  • Configuring core-site

Similarly we configure the core-site.xml file as follows...

Here is the complete playbook for configuring the target nodes as namenode and datanode:

  • Namenode.yml file
  • Firewall code
  • Formatting the namenode.
  • Starting the namenode.
  • Datanode.yml File.

Ansible-playbook datanode.yml

Ansible-playbook namenode.yml

~ Thank You For Reading. ✨

--

--