手机版
你好,游客 登录 注册
背景:
阅读新闻

Hadoop伪分布式模式测试(hadoop-0.20.2)

[日期:2011-12-02] 来源:Linux社区  作者:ChenBridge [字体:大 中 小]

# 配置系统

conf/core-site.xml:
<configuration>
     <property>
         <name>fs.default.name</name>
         <value>hdfs://localhost:9000</value>
     </property>
</configuration>

conf/hdfs-site.xml:
<configuration>
     <property>
         <name>dfs.replication</name>
         <value>1</value>
     </property>
</configuration>

conf/mapred-site.xml:
<configuration>
     <property>
         <name>mapred.job.tracker</name>
         <value>localhost:9001</value>
     </property>
</configuration>

# 配置SSH
$ ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa
$ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys

# 格式化
$ bin/Hadoop namenode -format

# 启动服务
$ bin/start-all.sh

# 浏览服务
NameNode - http://localhost:50070/
JobTracker - http://localhost:50030/

# 复制文件
$ bin/hadoop fs -put conf input

# 运行程序
$ bin/hadoop jar hadoop-0.20.2-examples.jar grep input output 'dfs[a-z.]+'

# 查看输出
$ bin/hadoop fs -get output output
$ cat output/*
$ bin/hadoop fs -cat output/*

# 停止服务
$ bin/stop-all.sh

linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款