Configure Hadoop and start cluster services using Ansible Playbook

 Today, we will learn how to configure hadoop cluster using ansible.

Setup:

We need 3 machines - Ansible controller node(192.168.1.7), Hadoop Namenode(192.168.1.9), Hadoop Datanode(192.168.1.8)

Steps:

namenode

install java 

install hadoop

create a directory 

hdfs-site file config 

<property>

<name>dfs.data.dir</name>

<value>/nn<value>

</property>

format directory with hadoop

core-site file config

<property>

<name>fs.default.name</name>

<value>hdfs://192.168.1.9:9001<value>

</property>

stop firewall

start service


slavenode

install java 

install hadoop

create a directory

hdfs-site file config

<property>

<name>dfs.data.dir</name>

<value>/dn<value>

</property>

core-site file config

<property>

<name>fs.default.name</name>

<value>hdfs://192.168.1.9:9001<value>

</property>

stop firewall

start service


The inventory file looks like this


The playbook looks like this





After running this inventory file by command

ansible-playbook hadoop.yml

The hadoop setup can be verified by command

hadoop dfsadmin -report


Thank You for reading.

I would like to thanks Vimal Daga Sir.

My Email — ayanchawlae@gmail.com






Comments

Popular posts from this blog

Key Announcements at Microsoft Ignite

Ansible Handlers

Ansible Roles (Httpd + Haproxy)