1、检查网络配置
[root@hadoop-master ~]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=hadoop-master
GATEWAY=192.168.126.2

[root@hadoop-master ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.126.130 hadoop-master hadoop-master.dragon.org
127.0.0.1 hadoop-master hadoop-master.dragon.org

[root@hadoop-master ~]# hostname
hadoop-master

2、检查ssh

3、检查jdk安装
java -version
javac -verison

cat /etc/profile
cat ~/.bash_profile

4、检查hadoop安装和配置文件
hadoop version

cat /etc/profile
cat ~/.bash_profile

检查 hadoop-env.sh 的 export JAVA_HOME
检查 yarn-env.sh 的 export JAVA_HOME
检查 mapored-env.sh 的 export JAVA_HOME

[hadoop@hadoop-master hadoop]$ grep -n "JAVA_HOME" hadoop-env.sh
19:# The only required environment variable is JAVA_HOME. All others are
21:# set JAVA_HOME in this file, so that it is correctly defined on
25:export JAVA_HOME=/opt/modules/jdk1.7.0_80

[hadoop@hadoop-master hadoop]$ grep -n "JAVA_HOME" mapred-env.sh
16:# export JAVA_HOME=/home/y/libexec/jdk1.6.0/
18:export JAVA_HOME=/opt/modules/jdk1.7.0_80

[hadoop@hadoop-master hadoop]$ grep -n "JAVA_HOME" yarn-env.sh
23:# export JAVA_HOME=/home/y/libexec/jdk1.6.0/
24:export JAVA_HOME=/opt/modules/jdk1.7.0_80
25:if [ "$JAVA_HOME" != "" ]; then
26: #echo "run java in $JAVA_HOME"
27: JAVA_HOME=$JAVA_HOME
30:if [ "$JAVA_HOME" = "" ]; then
31: echo "Error: JAVA_HOME is not set."
35:JAVA=$JAVA_HOME/bin/java

检查hadoop配置文件
[hadoop@hadoop-master ~]$ cd /opt/modules/hadoop-2.6.0/etc/hadoop
[hadoop@hadoop-master hadoop]$ cat hadoop-env.sh
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Set Hadoop-specific environment variables here.

# The only required environment variable is JAVA_HOME. All others are
# optional. When running a distributed configuration it is best to
# set JAVA_HOME in this file, so that it is correctly defined on
# remote nodes.

# The java implementation to use.
export JAVA_HOME=/opt/modules/jdk1.7.0_80

# The jsvc implementation to use. Jsvc is required to run secure datanodes
# that bind to privileged ports to provide authentication of data transfer
# protocol. Jsvc is not required if SASL is configured for authentication of
# data transfer protocol using non-privileged ports.
#export JSVC_HOME=${JSVC_HOME}

export HADOOP_CONF_DIR=${HADOOP_CONF_DIR:-"/etc/hadoop"}

# Extra Java CLASSPATH elements. Automatically insert capacity-scheduler.
for f in $HADOOP_HOME/contrib/capacity-scheduler/*.jar; do
if [ "$HADOOP_CLASSPATH" ]; then
export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:$f
else
export HADOOP_CLASSPATH=$f
fi
done

# The maximum amount of heap to use, in MB. Default is 1000.
#export HADOOP_HEAPSIZE=
#export HADOOP_NAMENODE_INIT_HEAPSIZE=""

# Extra Java runtime options. Empty by default.
export HADOOP_OPTS="$HADOOP_OPTS -Djava.net.preferIPv4Stack=true"

# Command specific options appended to HADOOP_OPTS when specified
export HADOOP_NAMENODE_OPTS="-Dhadoop.security.logger=${HADOOP_SECURITY_LOGGER:-INFO,RFAS} -Dhdfs.audit.logger=${HDFS_AUDIT_LOGGER:-INFO,NullAppender} $HADOOP_NAMENODE_OPTS"
export HADOOP_DATANODE_OPTS="-Dhadoop.security.logger=ERROR,RFAS $HADOOP_DATANODE_OPTS"

export HADOOP_SECONDARYNAMENODE_OPTS="-Dhadoop.security.logger=${HADOOP_SECURITY_LOGGER:-INFO,RFAS} -Dhdfs.audit.logger=${HDFS_AUDIT_LOGGER:-INFO,NullAppender} $HADOOP_SECONDARYNAMENODE_OPTS"

export HADOOP_NFS3_OPTS="$HADOOP_NFS3_OPTS"
export HADOOP_PORTMAP_OPTS="-Xmx512m $HADOOP_PORTMAP_OPTS"

# The following applies to multiple commands (fs, dfs, fsck, distcp etc)
export HADOOP_CLIENT_OPTS="-Xmx512m $HADOOP_CLIENT_OPTS"
#HADOOP_JAVA_PLATFORM_OPTS="-XX:-UsePerfData $HADOOP_JAVA_PLATFORM_OPTS"

# On secure datanodes, user to run the datanode as after dropping privileges.
# This **MUST** be uncommented to enable secure HDFS if using privileged ports
# to provide authentication of data transfer protocol. This **MUST NOT** be
# defined if SASL is configured for authentication of data transfer protocol
# using non-privileged ports.
export HADOOP_SECURE_DN_USER=${HADOOP_SECURE_DN_USER}

# Where log files are stored. $HADOOP_HOME/logs by default.
#export HADOOP_LOG_DIR=${HADOOP_LOG_DIR}/$USER

# Where log files are stored in the secure data environment.
export HADOOP_SECURE_DN_LOG_DIR=${HADOOP_LOG_DIR}/${HADOOP_HDFS_USER}

###
# HDFS Mover specific parameters
###
# Specify the JVM options to be used when starting the HDFS Mover.
# These options will be appended to the options specified as HADOOP_OPTS
# and therefore may override any similar flags set in HADOOP_OPTS
#
# export HADOOP_MOVER_OPTS=""

###
# Advanced Users Only!
###

# The directory where pid files are stored. /tmp by default.
# NOTE: this should be set to a directory that can only be written to by
# the user that will run the hadoop daemons. Otherwise there is the
# potential for a symlink attack.
export HADOOP_PID_DIR=${HADOOP_PID_DIR}
export HADOOP_SECURE_DN_PID_DIR=${HADOOP_PID_DIR}

# A string representing this instance of hadoop. $USER by default.
export HADOOP_IDENT_STRING=$USER
[hadoop@hadoop-master hadoop]$ cat yarn-env.sh
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# User for YARN daemons
export HADOOP_YARN_USER=${HADOOP_YARN_USER:-yarn}

# resolve links - $0 may be a softlink
export YARN_CONF_DIR="${YARN_CONF_DIR:-$HADOOP_YARN_HOME/conf}"

# some Java parameters
# export JAVA_HOME=/home/y/libexec/jdk1.6.0/
export JAVA_HOME=/opt/modules/jdk1.7.0_80
if [ "$JAVA_HOME" != "" ]; then
#echo "run java in $JAVA_HOME"
JAVA_HOME=$JAVA_HOME
fi

if [ "$JAVA_HOME" = "" ]; then
echo "Error: JAVA_HOME is not set."
exit 1
fi

JAVA=$JAVA_HOME/bin/java
JAVA_HEAP_MAX=-Xmx1000m

# For setting YARN specific HEAP sizes please use this
# Parameter and set appropriately
# YARN_HEAPSIZE=1000

# check envvars which might override default args
if [ "$YARN_HEAPSIZE" != "" ]; then
JAVA_HEAP_MAX="-Xmx""$YARN_HEAPSIZE""m"
fi

# Resource Manager specific parameters

# Specify the max Heapsize for the ResourceManager using a numerical value
# in the scale of MB. For example, to specify an jvm option of -Xmx1000m, set
# the value to 1000.
# This value will be overridden by an Xmx setting specified in either YARN_OPTS
# and/or YARN_RESOURCEMANAGER_OPTS.
# If not specified, the default value will be picked from either YARN_HEAPMAX
# or JAVA_HEAP_MAX with YARN_HEAPMAX as the preferred option of the two.
#export YARN_RESOURCEMANAGER_HEAPSIZE=1000

# Specify the max Heapsize for the timeline server using a numerical value
# in the scale of MB. For example, to specify an jvm option of -Xmx1000m, set
# the value to 1000.
# This value will be overridden by an Xmx setting specified in either YARN_OPTS
# and/or YARN_TIMELINESERVER_OPTS.
# If not specified, the default value will be picked from either YARN_HEAPMAX
# or JAVA_HEAP_MAX with YARN_HEAPMAX as the preferred option of the two.
#export YARN_TIMELINESERVER_HEAPSIZE=1000

# Specify the JVM options to be used when starting the ResourceManager.
# These options will be appended to the options specified as YARN_OPTS
# and therefore may override any similar flags set in YARN_OPTS
#export YARN_RESOURCEMANAGER_OPTS=

# Node Manager specific parameters

# Specify the max Heapsize for the NodeManager using a numerical value
# in the scale of MB. For example, to specify an jvm option of -Xmx1000m, set
# the value to 1000.
# This value will be overridden by an Xmx setting specified in either YARN_OPTS
# and/or YARN_NODEMANAGER_OPTS.
# If not specified, the default value will be picked from either YARN_HEAPMAX
# or JAVA_HEAP_MAX with YARN_HEAPMAX as the preferred option of the two.
#export YARN_NODEMANAGER_HEAPSIZE=1000

# Specify the JVM options to be used when starting the NodeManager.
# These options will be appended to the options specified as YARN_OPTS
# and therefore may override any similar flags set in YARN_OPTS
#export YARN_NODEMANAGER_OPTS=

# so that filenames w/ spaces are handled correctly in loops below
IFS=

# default log directory & file
if [ "$YARN_LOG_DIR" = "" ]; then
YARN_LOG_DIR="$HADOOP_YARN_HOME/logs"
fi
if [ "$YARN_LOGFILE" = "" ]; then
YARN_LOGFILE='yarn.log'
fi

# default policy file for service-level authorization
if [ "$YARN_POLICYFILE" = "" ]; then
YARN_POLICYFILE="hadoop-policy.xml"
fi

# restore ordinary behaviour
unset IFS

YARN_OPTS="$YARN_OPTS -Dhadoop.log.dir=$YARN_LOG_DIR"
YARN_OPTS="$YARN_OPTS -Dyarn.log.dir=$YARN_LOG_DIR"
YARN_OPTS="$YARN_OPTS -Dhadoop.log.file=$YARN_LOGFILE"
YARN_OPTS="$YARN_OPTS -Dyarn.log.file=$YARN_LOGFILE"
YARN_OPTS="$YARN_OPTS -Dyarn.home.dir=$YARN_COMMON_HOME"
YARN_OPTS="$YARN_OPTS -Dyarn.id.str=$YARN_IDENT_STRING"
YARN_OPTS="$YARN_OPTS -Dhadoop.root.logger=${YARN_ROOT_LOGGER:-INFO,console}"
YARN_OPTS="$YARN_OPTS -Dyarn.root.logger=${YARN_ROOT_LOGGER:-INFO,console}"
if [ "x$JAVA_LIBRARY_PATH" != "x" ]; then
YARN_OPTS="$YARN_OPTS -Djava.library.path=$JAVA_LIBRARY_PATH"
fi
YARN_OPTS="$YARN_OPTS -Dyarn.policy.file=$YARN_POLICYFILE"

[hadoop@hadoop-master hadoop]$ cat mapred-env.sh
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# export JAVA_HOME=/home/y/libexec/jdk1.6.0/

export JAVA_HOME=/opt/modules/jdk1.7.0_80

export HADOOP_JOB_HISTORYSERVER_HEAPSIZE=1000

export HADOOP_MAPRED_ROOT_LOGGER=INFO,RFA

#export HADOOP_JOB_HISTORYSERVER_OPTS=
#export HADOOP_MAPRED_LOG_DIR="" # Where log files are stored. $HADOOP_MAPRED_HOME/logs by default.
#export HADOOP_JHS_LOGGER=INFO,RFA # Hadoop JobSummary logger.
#export HADOOP_MAPRED_PID_DIR= # The pid files are stored. /tmp by default.
#export HADOOP_MAPRED_IDENT_STRING= #A string representing this instance of hadoop. $USER by default
#export HADOOP_MAPRED_NICENESS= #The scheduling priority for daemons. Defaults to 0.
[hadoop@hadoop-master hadoop]$ cat slaves
hadoop-master
[hadoop@hadoop-master hadoop]$ cat core-site.xml
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. See accompanying LICENSE file.
-->

<configuration>
<property>
<name>hadoop.tmp.dir</name>
<value>file:/opt/data/hadoop/tmp</value>
</property>
<property>
<name>fs.defaultFS</name>
<value>hdfs://localhost:9000</value>
</property>
</configuration>

[hadoop@hadoop-master hadoop]$ cat hdfs-site.xml
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. See accompanying LICENSE file.
-->

<configuration>

<property>
<name>dfs.replication</name>
<value>1</value>
</property>

<property>
<name>dfs.namenode.name.dir</name>
<value>file:/opt/data/hadoop/dfs/name</value>
</property>

<property>
<name>dfs.datanode.data.dir</name>
<value>file:/opt/data/hadoop/dfs/data</value>
</property>

<property>
<name>dfs.permissions</name>
<value>false</value>
</property>

</configuration>
[hadoop@hadoop-master hadoop]$ cat mapred-site.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. See accompanying LICENSE file.
-->

<!-- Put site-specific property overrides in this file. -->

<configuration>
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
</configuration>

[hadoop@hadoop-master hadoop]$ cat yarn-site.xml
<?xml version="1.0"?>
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. See accompanying LICENSE file.
-->
<configuration>
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
</configuration>

5、启动验证hadoop分布式
#hadoop -namenode -format

start-dfs.sh
start-yarn.sh

jps

hdfs dfs -ls /
hdfs dfs -mkdir
hdfs dfs -put

hadoop jar

hadoop2.6.0实践:002 检查伪分布式环境搭建相关推荐

  1. Hadoop2.2.0伪分布式环境搭建(附:64位下编译Hadoop-2.2.0过程)

    Hadoop2.2.0伪分布式环境搭建: 写在前面:Hadoop2.2.0默认是支持32位的OS,如果想要在64位OS下运行的话,可以通过在64位OS下面编译Hadoop2.2.0来实现,编译的操作步 ...

  2. HDFS伪分布式环境搭建-很不错

    HDFS伪分布式环境搭建 原创 ZeroOne01 2018-03-24 19:51:20 评论(0) 655人阅读 HDFS概述及设计目标 什么是HDFS: 是Hadoop实现的一个分布式文件系统( ...

  3. Hadoop单机和伪分布式环境搭建

    hadoop环境搭建 1.三个环境        单机.伪分布式.分布式 2.三个分支       apache版本(Apache基金会)       cdh版本(cloudera公司)       ...

  4. Hadoop学习总结(3)——Hadoop伪分布式环境搭建

    一.Hadoop运行模式 Local (Standalone) Mode 本地模式 适用于开发人员测试Debug 使用本地文件系统 Pseudo-Distributed Mode 伪分布式模式 适用于 ...

  5. 第1关:伪分布式环境搭建

    实验环境: hadoop2.7: JDK8: HBase2.1.1: hadoop已安装: JDK已安装,环境变量已配置: HBase压缩包已下载,存放在/opt目录下. 在搭建环境之前我们首先来了解 ...

  6. Hadoop入门基础教程 Hadoop之伪分布式环境搭建

    伪分布式模式即单节点集群模式,所有的守护进程都运行在同一台机器上.这种模式下增加了代码调试功能,可以查看内存.HDFS文件系统的输入/输出,以及与其他守护进程交互.以Hadoop用户远程登录K-Mas ...

  7. Hadoop小兵笔记【六】hadoop2.2.0伪分布式环境搭建疑难-JobHistory显示Job信息为空

    问题现象 运行Hadoop2.2.0自带的wordcount实例: Job运行成功: http://Master:8080/cluster/app查看Job信息为空: http://Master:19 ...

  8. Hadoop小兵笔记【五】hadoop2.2.0伪分布式环境搭建疑难-第一个用例wordcount失败

    问题现象 问题原因 由于参考了之前研究生阶段下载的资料,按照真分布式环境一步步配置,觉得只是将datanode同时存放在namenode,将hdfs-site.xml文件中的dfs.replicati ...

  9. Ubuntu 14.10 安装 hadoop-2.6.0单机配置和伪分布式配置

    安装openssh-server(用于远程连接) sudo apt-get install ssh openssh-server sudo apt-get install ssh openssh-cl ...

最新文章

  1. 快速指南:在DevOps中实现持续交付
  2. 活在无尽梦境的后续 β
  3. 嵌入式论文3000字_SCI英文论文一般多少字
  4. mongodb数组字段prefix匹配返回
  5. c++面向对象高级编程 总目录
  6. mysql双主 绿色_mysql (双主,互主)
  7. 屏幕小于6英寸的手机_vivo新机成最轻薄手机?6.56英寸屏幕,重量仅178g
  8. opengl png图片 qt_QT中使用OpenGL绘图
  9. 标签在线调整 http://labelary.com/viewer.html
  10. Awvs 12.x安装教程
  11. matlab画图函数双精度,Matlab中图像函数大全2_matlab函数大全
  12. 一键进入高通9008模式_专属冬天的热饮,一键进入圣诞模式!
  13. python根据经纬度计算两点之间距离
  14. 01惯性导航常用坐标系与地球参考椭球
  15. winrar.exe 命令行参数
  16. MATLAB中plot函数使用
  17. 分布式机器学习的集群方案介绍之HPC实现
  18. http请求包与请求返回的是什么
  19. 各位集美兄得看过来! 利用AI给青春有你2的选手们做数据分析挖掘(一):基于PaddlePaddle爬虫选手信息
  20. 大规模字符串的近似匹配问题(带详细注释的C++实现)

热门文章

  1. 浅谈Java throw, throws, try catch异常处理
  2. 防火墙冗余-ASA5520 Failover
  3. 开源Wiki系统:XWiki 2.0.2 发布
  4. PHP全栈学习笔记20
  5. shared_ptr 的使用及注意事项
  6. HDU 3046Pleasant sheep and big big wolf(切最小网络流)
  7. [C# 网络编程系列]专题六:UDP编程
  8. 基于Annotation的输入校验
  9. APUE读书笔记-09进程关系(04)
  10. 去年黑客用的未知软件漏洞数量增长一倍 创下纪录