温馨提示×

温馨提示×

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

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

Hadoop环境如何配置

发布时间:2021-12-07 14:11:03 来源:亿速云 阅读:129 作者:小新 栏目:云计算

这篇文章主要介绍了Hadoop环境如何配置,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。

    Hadoop环境安装完之后需要进行相应的配置

    Hadoop组件通过XML来配置,core-site.xml用于配置Common组件的属性,hdfs-site.xml文件用于配置HDFS属性,mapred-site.xml文件用于配置MapReduce属性,hdoop支持独立模式、伪分布模式、全分布模式,在不同模式下,各属性的配置:

组件属性独立模式伪分布模式全分布模式
commonfs.default.namefile:///(默认)hdfs://localhost/hdfs://namenode
hdfsdfs.replicationN/A13
mapreducemapred.job.tracker(hadoop2不用配置)local(默认)localhost:8021

jobtracker:8021    


    hadoop日志配置:在hadoop-env.sh中添加export HADOOP_LOG_DIR=/usr/lib/hadoop/logs

    我hadoop2的配置如下:

    core-site.xml

<configuration>
        <property>
                <name>fs.default.name</name>
                <value>hdfs://localhost/</value>
        </property>
        <property>
                <name>hadoop.tmp.dir</name>
                <value>/usr/lib/hadoop/tmp/</value>
        </property>
</configuration>

    hdfs-site.xml:

<configuration>
        <property>
                <name>dfs.default.name</name>
                <value>/usr/lib/hadoop/logs/</value>
        </property>
        <property>
                <name>dfs.replication</name>
                <value>1</value>
        </property>
        <property>
                <name>dfs.permissions</name>
                <value>false</value>
        </property>
</configuration>

    mapred-site.xml:

<configuration>
        <property>
                <name>mapreduce.framework.name</name>
                <value>Yarn</value>
        </property>
</configuration>

    yarn-site.xml:

<configuration>
        <property>
                <name>yarn.resourcemanager.resource-tracker.address</name>
                <value>localhost:8990</value>
        </property>
        <property>
                <name>yarn.resourcemanager.scheduler.address</name>
                <value>localhost:8991</value>
        </property>
        <property>
                <name>yarn.resourcemanager.scheduler.class</name>
                <value>org.apache.hadoop.yarn.server.resourcemanage.scheduler.capacity.CapacityScheduler</value>
        </property>
        <property>
                <name>yarn.resourcemanager.address</name>
                <value>localhost:8993</value>
        </property>
        <property>
                <name>yarn.nodemanager.local-dirs</name>
                <value>/usr/lib/hadoop/tmp/node</value>
        </property>
        <property>
                <name>yarn.nodemanager.address</name>
                <value>localhost:8994</value>
        </property>
        <property>
                <name>yarn.nodemanager.resource.memory-mb</name>
                <value>102040</value>
        </property>
        <property>
                <name>yarn.nodemanager.remote-app-log-dir</name>
                <value>/usr/lib/hadoop/tmp/app-logs</value>
        </property>
        <property>
                <name>yarn.nodemanager.log-dirs</name>
                <value>/usr/lib/hadoop/tmp/node</value>
        </property>
        <property>
                <name>yarn.nodemanager.aux-services</name>
                <value>mapreduce_shuffle</value>
        </property>
</configuration>

    slaves:

localhost

    完事之后执行hadoop namenode -fromat 格式化hdfs文件系统。

感谢你能够认真阅读完这篇文章,希望小编分享的“Hadoop环境如何配置”这篇文章对大家有帮助,同时也希望大家多多支持亿速云,关注亿速云行业资讯频道,更多相关知识等着你来学习!

向AI问一下细节

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

AI