每日总结

配置集群

1核心配置文件

配置core-site.xml

[atguigu@hadoop102 ~]$ cd $HADOOP_HOME/etc/hadoop

[atguigu@hadoop102 hadoop]$ vicore-site.xml

文件内容如下:

<?xml version="1.0" encoding="UTF-8"?>

<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

 

<configuration>

    <!-- 指定NameNode的地址 -->

    <property>

        <name>fs.defaultFS</name>

        <value>hdfs://hadoop102:8020</value>

    </property>

 

    <!-- 指定hadoop数据的存储目录 -->

    <property>

        <name>hadoop.tmp.dir</name>

        <value>/opt/module/hadoop-3.1.3/data</value>

    </property>

 

    <!-- 配置HDFS网页登录使用的静态用户为atguigu -->

    <property>

        <name>hadoop.http.staticuser.user</name>

        <value>atguigu</value>

    </property>

</configuration>

2HDFS配置文件

配置hdfs-site.xml

[atguigu@hadoop102 hadoop]$ vihdfs-site.xml

文件内容如下:

<?xml version="1.0" encoding="UTF-8"?>

<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

 

<configuration>

<!-- nn web端访问地址-->

<property>

        <name>dfs.namenode.http-address</name>

        <value>hadoop102:9870</value>

    </property>

<!-- 2nn web端访问地址-->

    <property>

        <name>dfs.namenode.secondary.http-address</name>

        <value>hadoop104:9868</value>

    </property>

</configuration>

3YARN配置文件

配置yarn-site.xml

[atguigu@hadoop102 hadoop]$ viyarn-site.xml

文件内容如下:

<?xml version="1.0" encoding="UTF-8"?>

<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

 

<configuration>

    <!-- 指定MRshuffle -->

    <property>

        <name>yarn.nodemanager.aux-services</name>

        <value>mapreduce_shuffle</value>

    </property>

 

    <!-- 指定ResourceManager的地址-->

    <property>

        <name>yarn.resourcemanager.hostname</name>

        <value>hadoop103</value>

    </property>

 

    <!-- 环境变量的继承 -->

    <property>

        <name>yarn.nodemanager.env-whitelist</name>

        <value>JAVA_HOME,HADOOP_COMMON_HOME,HADOOP_HDFS_HOME,HADOOP_CONF_DIR,CLASSPATH_PREPEND_DISTCACHE,HADOOP_YARN_HOME,HADOOP_MAPRED_HOME</value>

    </property>

</configuration>

4MapReduce配置文件

配置mapred-site.xml

[atguigu@hadoop102 hadoop]$ vimapred-site.xml

文件内容如下:

<?xml version="1.0" encoding="UTF-8"?>

<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

 

<configuration>

<!-- 指定MapReduce程序运行在Yarn -->

    <property>

        <name>mapreduce.framework.name</name>

        <value>yarn</value>

    </property>

</configuration>

posted @ 2021-10-22 16:15  小萌新一枚lll  阅读(35)  评论(0编辑  收藏  举报