【Hadoop】YARN伪分布式部署和MapReduce案例

发布时间:2020-06-03 08:29:03 作者:wangkunj
来源:网络 阅读:602

前言:
前几篇文章 我们介绍了HDFS组件的配置及启动,Yarn是Hadoop集群的资源与作业调度平台,下面介绍下Yarn的伪分布部署及MapReduce简单使用。

1.配置文件及启动
[hadoop@hadoop000 hadoop]$ pwd
/opt/software/hadoop-2.8.1/etc/hadoop
[hadoop@hadoop000 hadoop]$ cp mapred-site.xml.template mapred-site.xml
[hadoop@hadoop000 hadoop]$ vi mapred-site.xml
<configuration>
    <property>
        <name>mapreduce.framework.name</name>
        <value>yarn</value>
    </property>
</configuration>
[hadoop@hadoop000 hadoop]$ vi yarn-site.xml
<configuration>
    <property>
        <name>yarn.nodemanager.aux-services</name>
        <value>mapreduce_shuffle</value>
    </property>
</configuration>

[hadoop@hadoop000 hadoop]$ cd /opt/software/hadoop-2.8.1
[hadoop@hadoop000 hadoop-2.8.1]$ sbin/start-yarn.sh
starting yarn daemons
starting resourcemanager, logging to /opt/software/hadoop-2.8.1/logs/yarn-hadoop-resourcemanager-hadoop000.out
192.168.6.217: starting nodemanager, logging to /opt/software/hadoop-2.8.1/logs/yarn-hadoop-nodemanager-hadoop000.out
[hadoop@hadoop000 hadoop-2.8.1]$ jps
10512 ResourceManager --Yarn的进程
10004 SecondaryNameNode
9655 NameNode
10936 Jps
9806 DataNode
10623 NodeManager --Yarn的进程
#Yarn的两个进程:
   ResourceManager (资源管理)
   NodeManager     (节点管理)
#可参考官网:http://hadoop.apache.org/docs/r2.8.4/hadoop-project-dist/hadoop-common/SingleCluster.html
2.Yarn网站测试

【Hadoop】YARN伪分布式部署和MapReduce案例

3.MapReduce Job测试
[hadoop@hadoop000 hadoop-2.8.1]$ pwd
/opt/software/hadoop-2.8.1
[hadoop@hadoop000 hadoop-2.8.1]$ find ./ -name "*example*"
./lib/native/examples
./share/hadoop/mapreduce/sources/hadoop-mapreduce-examples-2.8.1-test-sources.jar
./share/hadoop/mapreduce/sources/hadoop-mapreduce-examples-2.8.1-sources.jar
./share/hadoop/mapreduce/lib-examples
./share/hadoop/mapreduce/hadoop-mapreduce-examples-2.8.1.jar
./share/doc/hadoop/hadoop-mapreduce-examples
./share/doc/hadoop/hadoop-yarn/hadoop-yarn-common/apidocs/org/apache/hadoop/yarn/webapp/example
./share/doc/hadoop/hadoop-auth-examples
./share/doc/hadoop/api/org/apache/hadoop/examples
./share/doc/hadoop/api/org/apache/hadoop/security/authentication/examples
./etc/hadoop/ssl-server.xml.example
./etc/hadoop/ssl-client.xml.example
[hadoop@hadoop000 hadoop-2.8.1]$ bin/hadoop jar ./share/hadoop/mapreduce/hadoop-mapreduce-examples-2.8.1.jar pi 5 10
4.结果解读

【Hadoop】YARN伪分布式部署和MapReduce案例
【Hadoop】YARN伪分布式部署和MapReduce案例

推荐阅读:
  1. Hadoop伪分布式部署(HDFS)
  2. Hadoop MapReduce

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

hadoop mapreduce 案例

上一篇:keepalived 非抢占模式 以及nginx状态监控

下一篇:从 webpack 到全面拥抱 Parcel #1 探索 Parcel

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》