Introduction to Ansible and How Facebook solving the challenge of setting a Hadoop cluster using Ansible

Laveena Jethani
5 min readNov 30, 2020

Hello Everyone,

In this article, I will be sharing my review🔍 of the Ansible automation tool. And I will share some use cases of the ansible. How DevOps engineer does their task using ansible.

I Will be cover the following topics:

→ Introduction to ansible.

→ Architecture of ansible

→ Comparison of IT industry working status before using and after using the automation tool.

→ How is facebook solving the challenge of setting a Hadoop cluster using Ansible?

Introduction to Ansible:

Automation: Automation means doing with less human interaction. Doing the task fast with a low cost in an efficient way.

Ansible

✔️ Ansible is an automation tool used for doing provisioning, configuration management, and deploying the application.

Provisioning: Provisioning meaning setting up the infrastructure. It can be understood as steps required to manage the data and resources. An provide to users.

Configuration Management: Configuration management means configuring the computer system such as web servers, databases servers, NFS servers, etc in an automation way. Doing configuration for the servers is called configuring management.

Application Deployment: After completing all tasks we deploy the application in the environment so everyone can use the application in a fast and efficient way.

❗️❗️ Now the world is of automation rather than IT engineers doing the task manually on the servers. They use automation tools like puppet, chef, ansible, etc.

✔️ Ansible is part of fedora distribution and is owned by the Red Hat Enterprise Linux.

✔️ Ansible is a type of declarative language where we only write what to do and we never write how to do the task.

✔️ We can use declarative language for automation . Declarative language such as python, shell scripting etc.. But for doing automation with this engineer have to remember the command according to OS type and OS version .But by using ansible engineers don’t have to remember the command for automation .

The architecture of Ansible:

Ansible Architecture

Inventory: This is a file where we declare all the target node's IPs, usernames, and passwords, etc...

Playbook: This is a programming file is written in the YML(Ain’t Markup Language) language. For declaring the variable, tasks which user want to do at the target node. After running the playbook we can achieve all the goals at the target node.

✔️ Ansible is also called agentless because in ansible architecture at the controller node we only have to install ansible we don’t need to install ansible at the target node.

Working :

✔️ When at the controller node we run YML files or ad-hoc commands. It internally connects with the target node using the SSH(Secure Shell) protocol for Linux.

✔️ While running the playbook controller node gathers all facts about the target node.

Facts: Facts are the information about the target node such as OS version, OS flavor, HDD, RAM, etc...

✔️ All the task we declare at notebook it will execute. Using modules but modules are internally calling the command according to the version of OS and type of OS.

Example- If we are configuring the rhel6 os version then the service module internal call <service command> and If we are doing configuration on rhel7 or rhel8 it will internally call <systemctl command>.

That’s the reason why ansible provides Resource Abstraction Layer(RAL)

✔️ After the successful run of the playbook, it will do all the tasks on the target node for us whatever task is written in the playbook. This tool is providing automation we have to only write playbooks at once and do all tasks automatically at the target rather than manually going to the target and do the task. It finally saves our time.

Comparison of IT industry working status before using and after using automation tools

✔️ In the market when there was no automation tool available IT industry engineers do their tasks manually on the servers this cost huge to the IT industry they have to hire more engineers for doing tasks on multiple servers. But in the market revolution of automation tools came in the year 2015. Since the year 2015, we have many automation tools come into the market for doing the task in an automated way. Automation tools such as Ansible, Docker, Kubernetes, etc...

✔️ Automation tool has completely changed the infrastructure of IT industries. Now for doing the task on the server human don’t do the task manually on the system. The user only runs the scripts(code) these scripts are smart to do all the tasks on the server for the user. Now the IT industry is focusing on their products not on the tasks of servers because automation tools do the tasks for them.

✔️ Automation tools totally give profits to the IT industry. Profits are:

  • Save Time
  • Less Money
  • Quality of products

✔️ Now in the IT industry new post come which is of DevOps engineer. Now for doing automation IT industry hires DevOps Engineer.

How is facebook solving the challenge of setting a Hadoop cluster using Ansible?

facebook

✔️ Facebook uses Hadoop technology for solving problems involving massive amounts of data and computation.

✔️ In Hadoop architecture, we have to set up one name node, many data nodes, and multiple clients. To set up the Hadoop cluster we have to configure every system for Hadoop. Manually setting the Hadoop cluster is a very time-consuming task. Here ansible plays a big role in setting the Hadoop cluster for Facebook.

✔️ For setting up a Hadoop cluster we need to do lots of configuration at nodes. This task is very time consuming and this costs huge to the Facebook company for hiring the engineer for managing the nodes. The solution to this problem is automation using ansible playbooks.

✔️ Ansible tools have the capability to set up the complete Hadoop cluster with no human interaction. Users only have to maintain inventory files for the target nodes.

✔️ when there was no automation tool available in the market. Engineers are manually login to servers and set up the configuration files and start the service. But now automation tools are available such as ansible do their half our task in 2–3 min. Automation tool giving success to IT companies.

Thank You.

--

--

Laveena Jethani

Technical Blog Writer | Research & Review different technologies | ARTH learner