You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 21 Next »

Checking out AMBARI-666

The following uses Ambari git for the development process. Please keep in mind git is read only and patches will have to be uploaded and committed via svn.

git clone git://git.apache.org/ambari.git

git checkout -b AMBARI-666 origin/AMBARI-666

Building Ambari

After checking out Ambari, you can build ambari with the steps below:

$ mvn clean install

Note: The above is for just building the jars. See below for starting/deploying the server and the agent.

Building Artifacts and Running the Server/Agent

NOTE: Though the documentation below mentions agent its not there yet and is coming up.

To build tarball artifacts run:

$mvn clean package assembly:assembly

This will build the server/agent tarballs.

For running the server:

$ cp ambari-server/target/ambari-server-*-dist.tar.gz INSTALL_DIR /* where install dir is some directory where you want to run the server */

$ cd INSTALL_DIR

$ tar -zxvf ambari-server-*-dist.tar.gz

$ vim /etc/ambari/ambari.properties
Add the following entry:

security.server.keys_dir=INSTALL_DIR/ambari-server-1.0.3-SNAPSHOT/keystore

NOTE: INSTALL_DIR will have to be replaced with the actual path in the config file.

$ cd ambari-server-*
$ java -cp lib/*: org.apache.ambari.server.controller.AmbariServer

The server will come up and run as a foreground process. Scripting will come later as we move along to run the server with proper confs/envs.

To check if the server is up and healthy, you can go to:

http://HOSTNAME:8080/api/check

The status will show as running.

or you can do: curl localhost:8080/api/check

NOTE: The health check is static as of now and will change later.

Running the agent.

The agent requires python 2.6 to run on a host. RHEL5/Centos5 have python 2.4 installed by default. To install 2.6 (NOTE: you can install both 2.4/2.6 on the host), install the epel repo and then run

$ yum install python26.

Python needs setuptools to be able to setup the project for development. Download http://pypi.python.org/packages/2.6/s/setuptools/setuptools-0.6c11-py2.6.egg#md5=bfa92100bd772d5a213eedd356d64086 and then run:

$ sh setuptools-0.6c11-py2.6.egg

To setup the ambari agent:

$ mkdir -p /var/ambari /var/run/ambari /var/log/ambari /tmp/ambari-agent/

  1. The following dev process is easier than using setup.py and is a quicker turnaround. As soon as we have a good deployment story (rpm) we will add those in.

$ cd ambari-agent/src/main/python/ambari_agent

  1. Note that ambari agent requires facter to get the node information. Download facter tarball from http://downloads.puppetlabs.com/facter/facter-1.6.0.tar.gz and uninstall in a directory.

Edit facter_home in AmbariConfig.py to the directory where facter is installed. The agent executes the script facter_home/bin/facter to get all the node information and also uses df to get the mount point information.

To run the agent:

$ python2.6 main.py

The Server currently doesnt implement the apis needed for the agent, so the agent will just try connecting to the server and do nothing. Take a look at

/var/log/ambari.log to see the logs.

Building and running Ambari Web

Ambari Web uses Brunch (http://brunch.io/) as the application assembler for development purposes.
Brunch is used to build and deploy automatically in the background as the developer modifies source files (JS, LESS/CSS, Handlebars template files).
It can also start up a Node.js-based web server with a single command so that you can easily run the application from the application root directory without any special configuration.

To build, deploy, and run Ambari Web with Brunch:

1. Install NPM per http://nodejs.tchol.org/

2. Install Brunch
$ sudo npm install -g brunch

3. Download dependent packages into ambari-web/node_modules directory
$ cd ambari-web
$ npm install

4. Run Ambari Web (with automatic, continuous build/deploy):
$ brunch watch --server

This starts up the server at http://localhost:3333

To run unit tests, run:
$ brunch test

Currently, Ambari Web is still being developed in isolation with no integration with Ambari Server using mock data.
Ambari Server runs on Jetty, so when integration happens we need to deploy on the Jetty server.
The built application is self-contained under ambari-web/public. The content of this folder simply needs to be copied to the appropriate folder on Jetty.

Setting up Ambari in Eclipse

$ mvn clean eclipse:eclipse

After doing the above you should be able to import the project via eclipse's import project. You should be able to see the following projects on eclipse:

> ambari-server
> ambari-agent

  • No labels