Checking out Ambari source
The following uses the Ambari git repository for the development process. Please keep in mind that the git repository is read only and patches will have to be uploaded and committed via svn.
git clone https://git-wip-us.apache.org/repos/asf/incubator-ambari.git cd incubator-ambari
We'll refer to the top-level "ambari" directory as AMBARI_DIR
in this document.
Tools needed to build Ambari
- JDK 1.6.0
- Apache Maven 3.0.5 <- Maven 3.1.0 results in errors when building ambari-agent
- Python 2.6
- Python setuptools - python 2.6: Download or python 2.7: Download and run:
2.6:2.7sh setuptools-0.6c11-py2.6.egg
sh setuptools-0.6c11-py2.7.egg
- rpmbuild (rpm-build package)
- g++ (gcc-c++ package)
- NodeJS - v0.10.2 or later is recommended
#Fedora 18: sudo yum update audit; sudo yum --enablerepo=updates-testing install nodejs npm
- Brunch 1.6.7 (to install it, run the following command after NodeJS is installed):
npm install -g brunch@1.6.7
Building Ambari
To build Ambari RPMs, run:
RHEL/Fedora/CentOS 5:
#Fedora 18: You may have to install rpmbuild if its not already installed... yum --enablerepo=updates-testing install rpm-build mvn -X -B -e clean install package rpm:rpm -DskipTests -Pcentos5 -Dpython.ver="python26" #Note: Or you can use '-Dpython.ver="python > 2.6' as an alternative, which seems to work better in at least one RHEL instance."
RHEL/CentOS 6:
mvn -X -B -e clean install package rpm:rpm -DskipTests -Dpython.ver="python >= 2.6"
SUSE/SLES 11:
mvn -X -B -e clean install package rpm:rpm -DskipTests -Psuse11 -Dpython.ver="python >= 2.6"
Ambari Server RPM will be created under AMBARI_DIR
/ambari-server/target/rpm/ambari-server/RPMS/noarch.
Ambari Agent RPM will be created under AMBARI_DIR
/ambari-agent/target/rpm/ambari-agent/RPMS/x86_64.
Optional parameters:
- -DdefaultStackVersion=STACK-VERSION
- Sets the default stack and version to be used for installation (e.g., -DdefaultStackVersion=HDP-1.3.0)
- -DenableExperimental=true
- Enables experimental features to be available via Ambari Web (default is false)
NOTE: Run everything as root
below.
Running the Ambari Server
First, install the Ambari Server RPM.
On RHEL/CentOS:
yum install ambari-server-*.rpm #Note: The above seems to fail - since the RPMs are in the target/rpm/ directory. Instead, #Try: yum install ./ambari-server/target/rpm/ambari-server/RPMS/noarch/ambari-server-1.2.2-*.noarch.rpm
On SUSE/SLES:
zypper install ambari-server-*.rpm
Initialize Ambari Server:
ambari-server setup
Start up Ambari Server:
ambari-server start
See Ambari Server log:
tail -f /var/log/ambari-server/ambari-server.log
To access Ambari, go to
http://{ambari-server-hostname}:8080
from your web browser and log in with username admin and password admin.
Install and Start the Ambari Agent Manually on Each Host in the Cluster
Install the Ambari Agent RPM.
On RHEL/CentOS:
yum install ambari-agent-*.rpm
SUSE/SLES:
zypper install ambari-agent-*.rpm
Edit the location of Ambari Server in /etc/ambari-agent/conf/ambari-agent.ini by editing the hostname line.
Start Ambari Agent:
ambari-agent start
See Ambari Agent log:
tail -f /var/log/ambari-agent/ambari-agent.log
Setting up Ambari in Eclipse
$ mvn clean eclipse:eclipse
After doing the above you should be able to import the project via Eclipse "Import > Maven > Existing Maven Project". Choose the root directory where you cloned the git repository. You should be able to see the following projects on eclipse:
ambari | |- ambari-project |- ambari-server |- ambari-agent |- ambari-web
Select the top-level "ambari pom.xml" and click Finish.