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
- Windows Subsystem for Linux
- Maven
- Python 2.7 (Python 3 support is not working).
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.
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
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:
Start Ambari server
Once the setup is done, we can start Ambari server using the following command line:
sudo ambari-server start
Open Ambari UI:
http://localhost:8080/
The website login screen looks like the following screenshot:
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:
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
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
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
Stop Ambari services
You can use the following command lines to stop Ambari services:
sudo ambari-agent stop sudo ambari-server stop
References
Installation Guide for Ambari 2.7.6