【大数据处理技术】实验11

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图计算模型

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值