hadoop-env.sh

  1. export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.222.b10-0.el7_6.x86_64/jre
  2. export HADOOP_LOG_DIR=/var/log/hadoop

hadoop-env.sh中的JAVA_HOME必须硬编码,要不然找不到JAVA_HOME。
原因:the value is lost as ssh connections to other hosts is made inside the code

core-site.xml

  1. <property>
  2. <name>hadoop.tmp.dir</name>
  3. <value>/var/hadoop/tmp</value>
  4. </property>

机架感知(Rack-aware)

默认不开启。机架感知脚本接收IP返回RackID(例如Rack1)

  1. <property>
  2. <name>topology.script.file.name</name>
  3. <value>/path/to/script</value>
  4. </property>