Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • JDK 1.6.0
  • Apache Maven
  • Python 2.6
  • Python setuptools - Download and run:
    Code Block
    sh setuptools-0.6c11-py2.6.egg
  • NodeJS
  • Brunch 1.4.4 (to install it, run the following command after NodeJS is installed):
    Code Block
    npm install -g brunch@1.4.4

Building Ambari

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

Code Block

$ mvn clean install 

Note: The above is for building the jars. See below for starting/deploying the Ambari Server and the Ambari Agent.

Building Artifacts and Running the Server/Agent

To build tarball artifacts run:

Code Block

$ mvn clean package assembly:assembly

This will build the Server and Agent tarballs.

NOTE: Run everything as root below.

Running the Ambari Server:

Execute the following, where INSTALL_DIR is a directory where you want to run the ServerRHEL/CentOS 5:

Code Block
$mvn cp-X ambari-server/target/ambari-server-*-dist.tar.gz INSTALL_DIR
$ cd INSTALL_DIR
$ tar -zxvf ambari-server-*-dist.tar.gz
-B -e clean install package rpm:rpm -DskipTests -Pcentos5 -Dpython.ver="python26"

RHEL/CentOS 6Edit the Ambari properties configuration file:

Code Block
$mvn vim /etc/ambari/ambari.properties

Add the following entry:

Code Block

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

NOTE: replace INSTALL_DIR with the actual directory path.

Code Block

$ INSTALL_DIR
$ cd ambari-server-*
$ export AMBARI_PASSPHRASE="tmp"
$ cp /etc/ambari/ambari.properties etc/ambari-server/conf/
$ java -cp etc/ambari-server/conf/:lib/ambari-server/* org.apache.ambari.server.controller.AmbariServer

NOTE: the conf directory should come first in the java classpath because guice-persist.jar includes a log4j.properties which will cause the Ambari log4j.properties to not load.

The Server will launch 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 running and healthy, you can go to:

Code Block

http://localhost:8080/api/check

The status will show as running. Or from a command line, you can run:

Code Block

curl localhost:8080/api/check

NOTE: The health check is static response for now.

Running the Ambari Agent.

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

Code Block

$ 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=bfa92100bd772d5a213eedd356d64086Image Removed and run:

Code Block

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

To setup the Ambari Agent:

Code Block

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

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.

Code Block

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

To run the agent:

Code Block

$ export AMBARI_PASSPHRASE="tmp"

Copy puppet modules to /var/lib/ambari-agent/puppet/

Code Block

$ cp -R ../../puppet/modules/ /var/lib/ambari-agent/puppet
$ python2.6 main.py

The Ambari Agent will just try connecting to the server. To see the logs, take a look at:

Code Block

/var/log/ambari-agent/ambari-agent.log

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). Brunch 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:

  1. Install NodeJS from http://nodejs.org/download/
  2. Install Brunch 1.4.4
    Code Block
    $ npm install -g brunch@1.4.4
  3. Download dependent packages into ambari-web/node_modules directory
    Code Block
    
    $ cd AMBARI_DIR/ambari-web
    $ npm install
    

To run Ambari Web so that it works with mock data independently from Ambari Server:

  1. Start test server:
    Code Block
    
    $ brunch watch --server (or simply "brunch w --s")
    
  2. Edit ambari-web/app/initialize.js and set to test mode (testMode = true). You can optionally set to go to the install wizard or directly into the app dashboard.
    Code Block
    
    App.testMode = true;
    App.skipBootstrap = true;
    App.alwaysGoToInstaller = true;
    
  3. Access http://localhost:3333Image Removed from your web browser. When you change Ambari Web source files, changes are immediately reflected.

To run Ambari Web with Ambari Server integration:

Code Block

$ cd AMBARI_DIR
$ mvn clean package assembly:assembly

Note: currently the mvn command does not put ambari-web in the Maven-generated package. This will be fixed in the future.

Code Block

$ cd AMBARI_DIR/ambari-server/ambari/target/ambari-server-*-dist/ambari-server-*
$ java -cp etc/ambari-server/conf/:lib/ambari-server/* org.apache.ambari.server.controller.AmbariServer
$ cd AMBARI_DIR/ambari-web
$ brunch watch

...

-X -B -e clean install package rpm:rpm -DskipTests -Dpython.ver="python >= 2.6"

SUSE/SLES 11:

Code Block

mvn -X -B -e clean install package rpm:rpm -DskipTests -Psuse11 -Dpython.ver="python >= 2.6"

This will build the Server and Agent RPMs.

NOTE: Run everything as root below.

Running the Ambari Server

First, install the Ambari Server RPM:

Code Block

yum install ambari-server-*.rpm
Code Block

ambari-server setup

Start up Ambari Server:

Code Block

ambari-server start

To access Ambari, go to

Code Block
http://{ambari-server-hostname}:8080

from your web browser.

Install the Ambari Agent Manually (Optional)

Code Block

yum install ambari-agent-*.rpm
Code Block

ambari-agent start
Code Block

/var/log/ambari-agent/ambari-agent.log

Setting up Ambari in Eclipse

...