Latest Updates

Configure Hadoop cluster using ansible playbooks

 

HADOOP

RED HAT ANSIBLE


Task Objective :

Let’s Get Started

pip3 install ansible
etc/ansible/                          // ansible directory
[MasterNode]192.168.0.112  ansible_connection=ssh  ansible_user=root  ansible_ssh_pass=root[SlaveNode]192.168.0.113  ansible_connection=ssh  ansible_user=root  ansible_ssh_pass=root
it is located at /etc/ansible/ansibel.cfg
// you need to create file
[defaults]inventory = /data.txthost_key_checking = Falsedeprecation_warnings = False

ansible all -m ping


step 2: download JDK and Hadoop
JDK:https://github.com/frekele/oracle-java/releases/download/8u171-b11/jdk-8u171-linux-x64.rpmHadoop:https://archive.apache.org/dist/hadoop/core/hadoop-1.2.1/hadoop-1.2.1-1.x86_64.rpm
ansible-playbook FileName.yml

scp -r file1 file2  'ip of destination:/path to save file'






step 4: update core-site.xml and Hdfs-site.xml

In this step, we will edit the Core-site.xml and Hdfs-site.xml and we will add the property or we can say configuration it is important because without this Hadoop will confuse from where we are getting storage and on which port I have to give the service
hdfs-site.xml  // will be different in both  // Master Node<configuration><property><name>dfs.name.dir</name>   // telling take following directory<value>/master</value>   //Folder path</property></configuration>
core-site.xml // will be same in both
<configuration>
<property><name>fs.default.name</name><value>hdfs://192.168.0.112:9001</value> // any port you can give</property></configuration>





DataNode or SlaveNode
hdfs-site.xml  // will be different in both  // slave Node<configuration><property><name>dfs.data.dir</name>   // telling take following directory<value>/slave</value>   //Folder path</property></configuration>





step 5: Format Namenode
hadoop namenode -format
 echo Y | hadoop namenode -format



step 6: start services of MasterNode and DataNode
Master
hadoop-daemon.sh start namenode

// use 'stop' insted of 'start' to stop services
Slave
hadoop-daemon.sh start datanode





all the services have been configured so We are able to see the GUI of the Hadoop

http://'MasterNode IP':50070     // 50070 GUI port of hadoop





GitHub Link:

https://github.com/venkateshpensalwar/ARTH/tree/main/Ansible/Configure%20Hadoop


Conclusion:

No comments