<configuration>
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
<property>
<name>mapreduce.jobhistory.address</name>
<value>nn1:10020</value>
</property>
<property>
<name>mapreduce.jobhistory.webapp.address</name>
<value>nn2:19888</value>
</property>
<property>
<name>mapred.compress.map.output</name>
<value>true</value>
</property>
<property>
<name>mapred.map.output.compression.codec</name>
<value>com.hadoop.compression.lzo.LzoCodec</value>
</property>
<property>
<name>mapred.child.env</name>
<value>LD_LIBRARY_PATH=/usr/local/lzo/lib</value>
</property>
</configuration>
3.5同步hadoop到各个节点,并配置上述相关文件
4.启动服务
4.1在各个节点启动zookeeper,查看状态
zkServer.sh start
zkServer.sh status
在主节点格式化zookeeper
hdfs zkfc -formatZK
4.2在各个节点启日志程序
hadoop-daemon.sh start journalnode
4.3在主namenode节点格式化hadoop
hadoop namenode -format
4.4在主namenode节点启动namenode进程
hadoop-daemon.sh start namenode
4.5在备节点执行命令,这个是把备namenode节点的目录格式化并把元数据从主namenode节点同步过来
hdfs namenode –bootstrapStandby
hadoop-daemon.sh start namenode 启动namenode
yarn-daemon.sh start resourcemanager 启动resourcemanager
4.6启动其他相关服务
start-dfs.sh
start-yarn.sh
4.7 查看高可用状态
hdfs haadmin -getServiceState nn1/nn2 查看namenode
yarn rmadmin -getServiceState rm1/rm2 查看resourcemanager
4.8登录web查看状态
:50070
:8088
下面关于Hadoop的文章您也可能喜欢,不妨看看: