Step by step: Install Ambari
Please also refer to official guide (), I just refacor this guide, because I think there is something difficult to a guy like without too much knowledge on linux, so I wrote this notes after I got it installed successfully on Redhat Linux.
Table of Contents
Step 1. Build Ambari
Getting Ambari
The source can be checked out anonymously from SVN with this command:
$ svn checkout http://svn.apache.org/repos/asf/incubator/ambari/trunk ambari
Note: normally you better download to the machine that you want to install as ambary server, it’s easy to copy and run I mean.
How to build Ambari
You need to build Ambari RPMs from the source code that you checked out:
$ yum install rpm-build
$ cd hmc/package/rpm
$ ./create_hmc_rpm.sh
$ cd mon_dashboard/package/rpm
$ ./create_dashboard_rpm.sh
When this succeeds, you will find following RPMs inside the ambari directory:
1) hmc/package/rpm/build/rpmbuild/RPMS/noarch/ambari-1.0.0-1.noarch.rpm
2) hmc/package/rpm/build/rpmbuild/RPMS/noarch/ambari-agent-1.0.0-1.noarch.rpm
3) mon_dashboard/package/rpm/build/rpmbuild/RPMS/noarch/hdp_mon_dashboard-0.0.1-2.noarch.rpm
Step 2: Install Ambari Master server
Prepare to install Ambari Master
We will refer to the node running the Ambari server as Ambari master and the nodes to which Hadoop services will be installed as cluster nodes.
1) Set up password-less SSH for root on all your cluster nodes.
- Copy root's SSH public key to all the cluster nodes in the authorized_keys file.
- Save the corresponding SSH private key file locally. You will be prompted by Ambari UI to upload it during cluster installation.
My execution:
1. Run on ambary master: % ssh-keygen -t dsa
2. Copy pubkey to each nodes:
Scp ~/.ssh/id_dsa.pub root@<each node IP>:/.ssh/authorized_keys
3. Back up id_dsa, this will be as private key when you want to launch Ambari install Hadoop clusters.
Note: you might need create .ssh folder on each node manually.
2) Install ambari-agent-1.0.0-1.noarch.rpm on each of the cluster nodes by running:
$ sudo rpm -Uvh ambari-agent-1.0.0-1.noarch.rpm
3) Stop iptables on the Ambari master:
$ sudo service iptables stop
Install Ambari Master
You should run the following at the command line on Ambari master:
$ sudo rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
OR $ sudo rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
$ sudo rpm -Uvh http://passenger.stealthymonkeys.com/rhel/5/passenger-release.noarch.rpm
$ sudo rpm -Uvh http://public-repo-1.hortonworks.com/HDP-1.0.13/repos/centos5/hdp-release-1.0.13-1.el5.noarch.rpm
To install necessary PHP modules on Ambari master:
$ sudo yum install php-pecl-json # version 1.2.1 compatible with php-5.1 or php-5.2
$ sudo yum install php-pdo
$ php -m | grep posix
If the posix module is not found, run:
$ sudo yum install php-process
Depending on which packages you have already installed, you may need to run following on Ambari master:
$ sudo yum install pdsh
$ sudo yum install httpd-devel
$ sudo yum install mod_passenger
$ sudo yum install puppet-2.7.9
$ sudo yum install ruby-devel
To install Ambari on Ambari master:
$ sudo rpm -iv ambari-1.0.0-1.noarch.rpm
$ sudo rpm -iv hdp_mon_dashboard-0.0.1-2.noarch.rpm
Step 3: Install Ambari Agent node
Install dependencies before install Ambari Agent
You should run the following at the command line on Ambari master:
$ sudo rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
OR $ sudo rpm -Uvh
$ sudo rpm -Uvh http://passenger.stealthymonkeys.com/rhel/5/passenger-release.noarch.rpm
$ sudo rpm -Uvh http://public-repo-1.hortonworks.com/HDP-1.0.13/repos/centos5/hdp-release-1.0.13-1.el5.noarch.rpm
To install necessary PHP modules on Ambari master:
$ sudo yum install php-pecl-json # version 1.2.1 compatible with php-5.1 or php-5.2
$ sudo yum install php-pdo
$ php -m | grep posix
If the posix module is not found, run:
$ sudo yum install php-process
Depending on which packages you have already installed, you may need to run following on Ambari master:
$ sudo yum install pdsh
$ sudo yum install httpd-devel
$ sudo yum install mod_passenger
$ sudo yum install puppet-2.7.9
$ sudo yum install ruby-devel
Install Agent
Copy ambary agent rpm from ambary build
$ sudo scp root@:./ambari/hmc/package/rpm/build/rpmbuild/RPMS/noarch/ambari-agent-1.0.0-1.noarch.rpm root@ :/ambari
Install ambari-agent-1.0.0-1.noarch.rpm on each of the cluster nodes by running:
$ sudo rpm -Uvh ambari-agent-1.0.0-1.noarch.rpm
Step 4: Launch Ambari
Hadoop requires JDK. You can download following files from the Oracle website: After accepting the license and downloading the files, copy them to /var/run/hmc/downloads/ directory on the Ambari master (Note: Upon download, these files may have .sh extension, so make sure you remove the .sh extension from the filenames and also set the execute permission on them)
1) jdk-6u26-linux-x64.bin
2) jdk-6u26-linux-i586.bin
Start Ambari server
$ sudo service ambari start
Start Install Hadoop cluster by Ambari
Now that Ambari server is installed and started, you can start installing Apache Hadoop and its ecosystem components on your cluster nodes by visiting from your browser.
master server>/hmc/html/
Issues : You may have
Hostname issue
Please double check you host name on master nodes and slave node, please change them to FQDN name, like <hostname.domain.com>.
$ hostname –f
$ vi /etc/hosts
Certificate issue
Some node you might have issue when you test:
$ puppetd --test --server server.puppet.com
Error: Could not request certificate: Retrieved certificate does not match private key; please remove certificate from server and regenerate it with the current key
Solution: You probally need remove/backup /etc/lib/puppet/ssl
Then retest this command, new cert will be generated. In my case, this issue gets resolved