Skip to end of metadata
Go to start of metadata

Checking out Ambari source

The following uses the Ambari git repository for the development process.

We'll refer to the top-level "ambari" directory as AMBARI_DIR in this document.

Tools needed to build Ambari

The following tools are needed to build Ambari from source.

Alternatively, you can easily launch a VM that is preconfigured with all the tools that you need.  See the Pre-Configured Development Environment section in the Quick Start Guide.

  • 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.7

  • rpmbuild (rpm-build package)
  • g++ (gcc-c++ package)
  • NodeJS - v0.10.2 or later is recommended.  Latest version tested for compatibility is v0.10.24 (as of Jan 15, 2014).  Download the binary tarball, extract, and put the bin directory in your PATH.  Verify that you can run the command node and npm.  Alternatively, you can use yum to install NodeJS if you are on Fedora 18:

  • Brunch 1.7.13 (to install it, run the following command after NodeJS is installed):

    Verify that you can run the command brunch.  Later versions may work, but 1.7.13 is the latest version that has been tested (as of Jan 15, 2014).

Running Unit Tests

  • mvn clean test

NOTE: Please make sure you have npm in the path before running the unit tests.

Building Ambari

To build Ambari RPMs, run the following.

Note: Replace ${AMBARI_VERSION} with the version you want the artifacts to be (e.g., -DnewVersion=1.5.0)

RHEL/Fedora/CentOS 5:

RHEL/CentOS 6:

SUSE/SLES 11:

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:

  • -X -e: add these options for more verbose output by Maven.  Useful when debugging Maven issues.
  • -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:

On SUSE/SLES:

Initialize Ambari Server:

Start up Ambari Server:

See Ambari Server log:

To access Ambari, go to

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:

SUSE/SLES:

Edit the location of Ambari Server in /etc/ambari-agent/conf/ambari-agent.ini by editing the hostname line.

Start Ambari Agent:

See Ambari Agent log:

Setting up Ambari in 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:

Select the top-level "ambari pom.xml" and click Finish.

Coding Guidelines for Ambari

Labels
  • No labels
  1. It appears that ambari-server/../ambari-web/public does not exist, but is required for the build. We've attempted on two branches (trunk, and branch-1.2"

  2. Hi Jay, I'm also facing the same issue.
    Ambari Web has trouble building, even though mvn says it's SUCCESS. I'm looking into it.

  3. I saw this problem on a CentOS 6.3 VM today.

    Ambari Web build was failing with some error message about EmberPrecompiler failure.

    This is what I have done to get it working again:

    1. cd $AMBARI_DIR/ambari-web
    2. rm -rf node_modules
    3. npm install
    4. brunch build

    I don't know if there was a temporary problem with the npm repo or what, but things are working for me now...

  4. 1) I had to do "python > 2.6" on RHEL, like so:

    mvn -X -B -e clean install package rpm:rpm -DskipTests -Pcentos5 -Dpython.ver="python > 2.6" > /tmp/mvnlog 2>&1

    2) And I had to specify the exact RPM path:

    yum install ./ambari-server/target/rpm/ambari-server/RPMS/noarch/ambari-server-1.2.2-SNAPSHOT20130401212524.noarch.rpm

  5. Hi Yusaku, I'm not sure this is the right place to post my question but I cant find a more suitabe spot in this forum. I'm trying to write a simple web manager console for a database and learning ember.js the same time. I think Ambari is a good reference so I looked into the source code, especially the web part. I wonder if you are using any project organization tool with ember.js, as I see require('app') kind of syntax everywhere in the java scripts. What is that or what tool you are using to achieve the more organized multi-file single page ember application, if you don't mind to share. I appreciate your help!

    1. Hi Grace,

      We use an application assembler called Brunch: http://brunch.io/
      It lets us organize JS files in a hierarchical manner using the require syntax that you saw. Also, it can very quickly compile all the files into consolidated JS files (so that when the browser downloads the web app, it's only downloading just a few files, rather than hundreds of source files). It also serves as a Node.JS based web server that we can use for testing locally with mock data without having the actual backend server running, etc.
      Please note that the version of Ember we are using is v1.0.pre. There have been significant changes since then (especially how the router works in the v1.0 release).
      For any questions related to Ambari code/development, please ask on the ambari-dev mailing list: http://incubator.apache.org/ambari/mail-lists.html

      Yusaku

      1. Thanks so much for the prompt reply. Will study on brunch. And thanks for pointing me the right mailing list, I'm sure I'll make a good use of out of it soon enough!