Getting Started with Hama
This document describes how to install, configure and manage Hama clusters ranging from a few nodes to extremely large clusters with thousands of nodes.
1. Make sure all required software is installed on all nodes in your cluster:
- hadoop-1.0.x or higher version (non-secure version)
- Sun Java JDK 1.6.x or higher version
- SSH access to manage BSP deamons
2. Download Hama from the release page.
For additional information consult our
Just like Hadoop, we distinct between three modes:
- Local Mode - This mode is the default mode if you download Hama (>= 0.3.0) and install it. When submitting a job it will run a local multithreaded BSP Engine on your server. It can be configured via the bsp.master.address property to local. You can adjust the number of threads used in this utility by setting the bsp.local.tasks.maximum property. See the Settings step how and where to configure this.
- Pseudo Distributed Mode - This mode is when you just have a single server and want to launch all the deamon processes (BSPMaster, Groom and Zookeeper). It can be configured when you set the bsp.master.address to a host address e.g., localhost and put the same address into the groomservers file in the configuration directory. As stated it will run a BSPMaster, a Groom and a Zookeeper on your machine.
- Distributed Mode - This mode is just like the "Pseudo Distributed Mode", but you have multiple machines, which are mapped in the groomservers file.
The $HAMA_HOME/conf directory contains some configuration files for Hama. These are:
- hama-env.sh - This file contains some environment variable settings used by Hama. You can use these to affect some aspects of Hama daemon behavior, such as where log files are stored, the maximum amount of heap used etc. The only variable you should need to change in this file is JAVA_HOME, which specifies the path to the Java 1.5.x installation used by Hama.
- groomservers - This file lists the hosts, one per line, where the GroomServer daemons will run. By default this contains the single entry localhost
- hama-default.xml - This file contains generic default settings for Hama daemons. Do not modify this file.
- hama-site.xml - This file contains site specific settings for all Hama daemons and BSP jobs. This file is empty by default. Settings in this file override those in hama-default.xml. This file should contain settings that must be respected by all servers and clients in a Hama installation.
The $HAMA_HOME/bin directory contains some script used to start up the Hama daemons.
- start-bspd.sh - Starts all Hama daemons, the BSPMaster, GroomServers and Zookeeper.
Note: You have to start Hama with the same user which is configured for Hadoop.
- BSPMaster and Zookeeper settings - Figure out where to run your HDFS namenode and BSPMaster. Set the variable bsp.master.address to the BSPMaster's intended host:port. Set the variable fs.default.name to the HDFS Namenode's intended host:port.
Here's an example of a hama-site.xml file:
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<description>The address of the bsp master server. Either the
literal string "local" or a host:port for distributed mode
The name of the default file system. Either the literal string
"local" or a host:port for HDFS.
<description>Comma separated list of servers in the ZooKeeper Quorum.
For example, "host1.mydomain.com,host2.mydomain.com,host3.mydomain.com".
By default this is set to localhost for local and pseudo-distributed modes
of operation. For a fully-distributed setup, this should be set to a full
list of ZooKeeper quorum servers. If HAMA_MANAGES_ZK is set in hama-env.sh
this is the list of servers which we will start/stop zookeeper on.
If you are managing your own ZooKeeper, you have to specify the port number as below:
See all Configuration Properties
NOTE: Skip this step if you're in Local Mode.
Run the command:
This will startup a BSPMaster, GroomServers and Zookeeper on your machine.
Run the command:
to stop all the daemons running on your cluster.