before installing Hama, you should first ensure that Hadoop is installed in the system and that the version used by this cluster is hadoop-2.3.0First, download and unzip the Hama file
: Http://www.apache.org/dyn/closer.cgi/hama, selected is the latest version: hama0.6.4. The storage location after decompression is set by itself.
Second, modify the configuration file
- Add Java_home variable (set to machine value in distributed case) in hama-env.sh file
- Configure Hama-site.xml (distributed, all machines are configured identically)
Bsp.master.address is the BSP master address. The Fs.default.name parameter is set to the Namenode address in Hadoop. Hama.zookeeper.quorum and Hama.zookeeper.property.clientPort two parameters and zookeeper, set to become zookeeper quorum server, Single-machine pseudo-distributed is the native address.
4. Configure the Groomservers file. Hama has a similar master-slave structure to Hadoop, which holds the IP address from the node, one row per IP. (in distributed case only need to configure the machine where the Bspmaster is located)
5. The hama0.6.4 comes with a Hadoop core pack of 1.2.0, which is inconsistent with the cluster hadoop2.3.0 and needs to be replaced by the hadoop-core-2.3.0* found in the Lib folder of Hadoop. Jar and Hadoop-test-2.3.0*.jar, copy to Hama's Lib directory, and delete Hadoop-core-1.2.0.jar and Hadoop-test-1.2.0.jar two files.
6. You may not find the wrong class at this time, you need to add the missing jar package. (Import jar packages and Protobuf-java-2.5.0.jar from Hadoop to Hama/lib)
Third, write Hama job
Create a new Java project under Eclipse and import all the jar packages required for Hama installation into the project.
Examples of pi calculation in the official website:
View Piestimator
Export the project to a jar file and send it to the cluster to run. To run the command:
$HAMA _home/bin/hama Jar Jarname.jar
Output:
Current Supersteps number:0 ()
Current Supersteps Number:4 ()
The total number of supersteps:4 (Master super Steps)
Counters:8 (total 8 counters, as follows 8.) List of all counters to be perfected)
Org.apache.hama.bsp.jobinprogress$jobcounter
Supersteps=4 (bspmaster number of super steps)
Launched_tasks=3 (total number of tasks)
Org.apache.hama.bsp.bsppeerimpl$peercounter
SUPERSTEP_SUM=12 (total number of super steps, task number *bspmaster Super Step number)
Message_bytes_transfered=48 (bytes of transmitted information)
time_in_sync_ms=657 (synchronous consumption time)
Total_messages_sent=6 (number of sending information bars)
Total_messages_received=6 (number of receiving messages)
task_output_records=2 (number of task output records)
PageRank Example:
View PageRank
Output:
Copyright NOTICE: This article for Bo Master http://www.zuiniusn.com original article, without Bo Master permission not reproduced.
Apache Hama Installation Deployment