配盖 master上的 hadoop
hadoop的配置文件都在 usr/ocal/ hadoopetc hadoop目录中.我们需要修改的配文件共有7个
1.编辑 slaves文件,设置集群的子节点。除 localhost,添加 slave1和 slave2:
-
[rootomaster hoop)# vi slaves
-
slave
-
slave
2编辑 hadoop-env.sh文件,修改第25行的 JAVA HOME为jdk的安装目录。(在i中显示行号使用: sat number: hadoop-env. sh
17 w Set Hadoop-specific environment variables here
19 The only required environment variable is JAVA HOME. All others are 20 optional. When running a distributed configuration it is best to 2I set JAVA HOME in this file, so that it is correctly defined on 22 remote nodes23
24# The ava implementation to use
P5 export JAVA_HOME=/usr/Local/jdk
27 The jsvc implementation to use. J]svc is required to run secure datanodes 28 that bind to privileged ports to provide authentication of data transfer 29 protocol. Jsvc is not required if SASL is configured for authentication c 30 data transfer protocol using non-privileged ports 31 #export JSVC HOME=S(JSVC HOME)
3编yarn- env. sh文件,修改23行内容。脚除#解注释这行配置,修改 JAVA HOME为jdk的安装目录。
yarn-env. s
16 User for YARN daemons
17 export HADOOP_YARN USER=S(HADOOP_YARN USER: -yarny18
19 resolve links -$0 may be a softlink
2i"ort YARN CONF DIR="s(YARN CONF DIR: -SHADOOP YARN HOME/conf2e
22 some Java parameters
export JAVA_HOME=/usr/Local/jdk
If [SJAVA HOME!= 1; then 25 #echo "run Java in $JAVA HOME
26 JAVA HOME=SJAVA HOME
27f1
2B
29 if [“SJAVA HOME”=""]: then
30 echo " Error: JAVA HOME is not set 31 exit 1



