Install Ambari 2.7.6 on Windows via WSL to Provision Hadoop Cluster

Raymond Raymond event 2021-12-29 visibility 2,475
more_vert
Install Ambari 2.7.6 on Windows via WSL to Provision Hadoop Cluster

Apache Ambari is a tool for provisioning, managing and monitoring Apache Hadoop clusters. You can use it to configure Hadoop cluster, start, stop or restart Hadoop services and monitor the status of the nodes in the cluster. This tool supports the following systems:

  • RHEL (Redhat Enterprise Linux) 7.4, 7.3, 7.2
  • CentOS 7.4, 7.3, 7.2
  • OEL (Oracle Enterprise Linux) 7.4, 7.3, 7.2
  • Amazon Linux 2
  • SLES (SuSE Linux Enterprise Server) 12 SP3, 12 SP2
  • Ubuntu 14 and 16
  • Debian 9

Windows is not supported thus we can use WSL (Windows Subsystem for Linux) to install it.

Prerequisites

I am using Ubuntu distro for this tutorial.
I also installed python-dev and gcc via the following command:

sudo apt-get update
sudo apt install python-dev gcc

Otherwise, you may encounter the following error:

Python.h: No such file or directory

Make sure required setuptools is installed:

sudo pip install setuptools==0.6c11

You also need to ensure all the dependencies are met: Ambari Development.

Build and install Ambari

Download source and build

Run the following commands to download source code and then build it using Maven:

wget https://dlcdn.apache.org/ambari/ambari-2.7.6/apache-ambari-2.7.6-src.tar.gz
tar xfvz apache-ambari-2.7.6-src.tar.gz
cd apache-ambari-2.7.6-src
mvn versions:set -DnewVersion=2.7.6.0.0
pushd ambari-metrics
mvn versions:set -DnewVersion=2.7.6.0.0
popd mvn -B clean install jdeb:jdeb -DnewVersion=2.7.6.0.0 -DbuildNumber=388e072381e71c7755673b7743531c03a4d61be8 -DskipTests -Dpython.ver="python >= 2.6"

It may takes a while as it will need to download many dependent packages from internet. 

20220102103524-image.png

Install Ambari server

Changed directory to ambari-server/target/:

cd ambari-server/target

Now install the rpm package by running the following command:

sudo apt-get install ./ambari-server_2.7.6.0-0.deb

20220102104406-image.png

Setup Ambari server

Now we can run the following command to setup the Ambari server, database (PostgreSQL), JDK, LDAP and others:

sudo ambari-server setup

Input all the settings accordingly:

20220102105250-image.png

Start Ambari server

Once the setup is done, we can start Ambari server using the following command line:

sudo ambari-server start

20220102105555-image.png

Open Ambari UI:

http://localhost:8080/

The website login screen looks like the following screenshot:

20220102105828-image.png

The default user name is admin and the password is also admin.

Once you logged into the system, you can use it configure a new cluster:

20220102110036-image.png


infoFor this article, we focus on the installation of Ambari software itself only. Stay tuned for future updates.

Install Ambari agents

Now, we can also deploy Ambari agents to all the servers where you need to setup Hadoop cluster.

1) Copy the built agent deb file to the agent server:

Change the directory to agent target folder:

cd ambari-agent/target/

Copy ambari-agent_2.7.6.0-0.deb to all the agent servers:

~/apache-ambari-2.7.6-src/ambari-agent/target$ ls

ambari-agent-2.7.6.0.0 ambari-agent_2.7.6.0.0_all.changes generated-sources maven-status test-classes
ambari-agent-2.7.6.0.0.jar archive-tmp generated-test-sources rat.txt zkmigrator.jar
ambari-agent-2.7.6.0.0.tar.gz cache jcepolicyinfo.jar repo
ambari-agent_2.7.6.0-0.deb classes maven-archiver src

2) Install the agent on each server:

Run the following command on each agent server to install the Ambari agent:

sudo apt-get install ./ambari-agent_2.7.6.0-0.deb

20220102111548-image.png

3) Edit /etc/ambari-agent/conf/ambari-agent.ini

Now edit the configuration file /etc/ambari-agent/conf/ambari-agent.ini on each agent server:

sudo vi /etc/ambari-agent/conf/ambari-agent.ini

20220102112015-image.png

Make sure hostname under the [server] section points to the actual Ambari Server host, rather than "localhost". For my case, the agent and server locates on the same server thus I will keep it as localhost.

4) Start the agent service

Run the following command line to start the agent service:

sudo ambari-agent start

20220102112314-image.png

Stop Ambari services

You can use the following command lines to stop Ambari services:

sudo ambari-agent stop
sudo ambari-server stop
check Congratulations! You have now successfully installed Ambari server and agent services in your WSL. We can then use it to install Hadoop easily. I will cover it in future articles!

References

Installation Guide for Ambari 2.7.6


More from Kontext
comment Comments
No comments yet.

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts