Hama安装配置
下载解压
-
下载网址:http://archive.apache.org/dist/hama/
-
赋予用户权限
-
解压配置:
-
修改hama-env.sh:在Hama中进入conf文件夹,修改hama-env.sh文件,在其中加入Java的home 路径(jdk的路径)
-
修改hama-site.xml,这是hama配置的核心文件
- 在中加入 以下代码,是本地就配置为local,即将value中的内容分别改为local,local,localhost
-
<configuration>
<property>
<name>bsp.master.address</name>
<value>local</value>
<description>The address of the bsp master server. Either the
literal string "local" or a host:port for distributed mode
</description>
</property>
<property>
<name>fs.default.name</name>
<value>local</value>
<description>
The name of the default file system. Either the literal string
"local" or a host:port for HDFS.
</description>
</property>
<property>
<name>hama.zookeeper.quorum</name>
<value>localhost</value>
<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.
</description>
</property>
</configuration>
修改文件
Hama使用案例
随机生成 100 个节点、1000 条边的图结构数据,运行 PageRank 算法
- 在hama的bin/hama/下,进行jar jia 文件名,生成的文件位于hama 下的randomgraph。他表示100个节点,1000条边的数据存储在两个文件中
./bin/hama jar hama-examples-0.7.1.jar gen fastgen -v 100 -e 10 -o randomgraph -t 2
- 执行pagerank,结果保存在pagerankresult文件中
./bin/hama jar hama-examples-0.7.1.jar pagerank -i randomgraph -o pagerankresult -t 4
【参考资料】
hadoop集群下安装及配置hama
Hama图计算模型