【hadoop】6.hadoop配置文件

簡介

經過本教程您能夠學習到oop

  1. hadoop配置文件的組成;
  2. hadoop配置文件的主要內容。

Hadoop配置文件分兩類:學習

  • 默認配置文件
  • 自定義配置文件

只有用戶想修改某一默認配置值時,才須要修改自定義配置文件,更改相應屬性值。code

一、默認配置文件

(1)默認配置文件:存放在hadoop相應的jar包中。xml

  • hadoop-common-2.7.2.jar/ core-default.xml
  • hadoop-hdfs-2.7.2.jar/ hdfs-default.xml
  • hadoop-yarn-common-2.7.2.jar/ yarn-default.xml
  • hadoop-mapreduce-client-core-2.7.2.jar/ core-default.xml

經過這些配置文件,咱們能夠了解到各類配置屬性的初始值。例如咱們以前在core-site.xml中配置的臨時目錄的路徑以及文件存儲協議,在core-site.xml中能夠找到對應的配置項,而且瞭解到其默認值:教程

···
<property>
  <name>hadoop.tmp.dir</name>
  <value>/tmp/hadoop-${user.name}</value>
  <description>A base for other temporary directories.</description>
</property>
···
<!-- file system properties -->
<property>
  <name>fs.defaultFS</name>
  <value>file:///</value>
  <description>The name of the default file system.  A URI whose
  scheme and authority determine the FileSystem implementation.  The
  uri's scheme determines the config property (fs.SCHEME.impl) naming
  the FileSystem implementation class.  The uri's authority is used to
  determine the host, port, etc. for a filesystem.</description>
</property>
···

這些文檔咱們能夠手動保存下來,也能夠在官網查詢到具體的信息,在有需求的同時查看對應的配置項默認值及其描述。ip

二、自定義配置文件

其位置位於${HADOOP_HOME}/etc下,也就是咱們用來配置一些覆蓋默認屬性的配置文件,其名字和默認配置文件的名字一一對應一致。hadoop

相關文章
相關標籤/搜索