ubuntu中安装hadoop集群

hadoop是由java 语言编写的主从结构分布式计算存储架构

准备工作:

  1. 操作系统: Ubuntu16.04

  2. 软件安装包:jdk-8u171-linux-x64.tar.gz ; hadoop-2.6.5.tar.gz

  3. 配置环境:3台虚拟机

             master:192.168.122.10node1 :192.168.122.11 node1 :192.168.122.12 
  • 前提条件:三台虚拟机已经配置过SSH和主机名,如果没有,请自行百度配置。

第一步:安装jdk

因为hadoop是由java编写的,所以底层需要依赖java环境, jdk下载地址,可选择合适的版本 http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

在master上操作

1.下载jdk

用wget下载,如下

root@master:/opt/tar# wget http://download.oracle.com/otn-pub/java/jdk/8u171-b11/512cd62ec5174c3487ac17c61aaa89e8/jdk-8u171-linux-x64.tar.gz
root@master:/opt/tar# l
jdk-8u171-linux-x64.tar.gz 

2.解压tar包

可以自己先创一个目录来解压方便以后管理,这次我就解压在opt目录下

root@master:/opt/tar# tar -zxvf jdk-8u171-linux-x64.tar.gz -C /opt/root@master:/opt# l
jdk1.8.0_171/

3.将jdk添加到环境变量中

root@master:/opt# vim /etc/profile

在文件末尾添加

export JAVA_HOME=/opt/jdk1.8.0_171
export PATH=$PATH:$JAVA_HOME/bin

4.刷新环境变量文件

root@master:/opt# echo $JAVA_HOME       #没刷新前的结果为空root@master:/opt# source  /etc/profile  #刷新
root@master:/opt# echo $JAVA_HOME
/opt/jdk1.8.0_171
root@master:/opt# java -version #看java版本 openjdk version "1.8.0_171" OpenJDK Runtime Environment (build 1.8.0_171-8u171-b11-0ubuntu0.16.04.1-b11) OpenJDK 64-Bit Server VM (build 25.171-b11, mixed mode) 
  • 到这里master的上面的jdk就安装好了 接下来就是将从节点上也安装,这里就可以将master上解压好和修改好的/etc/profile文件直接拷贝到从节点上了,这样比较方便,不然还得重复配置。

  • 这里我还是将jdk放在从节点的/opt目录下

root@master:/opt# scp -r jdk1.8.0_171/ node1:/opt       #拷贝jdk到node1
root@master:/opt# scp -r jdk1.8.0_171/ node2:/opt #拷贝jdk到node2 root@master:/opt# scp -r /etc/profile node2:/etc/ #拷贝环境变量文件到node1 root@master:/opt# scp -r /etc/profile node2:/etc/ #拷贝环境变量文件到node2 

在node1和node2上执行

source  /etc/profile  #刷新
  • 到这里三台虚拟机的JDK就全部安装好了!

第二步:安装hadoop

从网站http://hadoop.apache.org/releases.html找到合适的hadoop的二进制版本,本次我用的是2.6.5

image

1. 下载

root@master:/opt/tar# wget http://www-eu.apache.org/dist/hadoop/common/hadoop-2.6.5/hadoop-2.6.5.tar.gz

2.解压

root@master:/opt/tar# tar -zxvf hadoop-2.6.5.tar.gz -C /opt/root@master:/opt# l
hadoop-2.6.5/ jdk1.8.0_171/ 

3.修改配置文件

进入/opt/hadoop-2.6.5/etc/hadoop目录下,这里面都是配置文件

root@master:/opt/hadoop-2.6.5/etc/hadoop# l
capacity-scheduler.xml  hadoop-env.sh               httpfs-env.sh            kms-env.sh            mapred-env.sh               ssl-server.xml.example
configuration.xsl       hadoop-metrics2.properties  httpfs-log4j.properties  kms-log4j.properties  mapred-queues.xml.template  yarn-env.cmd
container-executor.cfg  hadoop-metrics.properties   httpfs-signature.secret  kms-site.xml          mapred-site.xml.template    yarn-env.sh
core-site.xml           hadoop-policy.xml           httpfs-site.xml          log4j.properties      slaves                      yarn-site.xml
hadoop-env.cmd          hdfs-site.xml               kms-acls.xml             mapred-env.cmd        ssl-client.xml.example

1.修改hadoop-env.sh

里面是启动的脚本文件,将jdk导入

root@master:/opt/hadoop-2.6.5/etc/hadoop# echo $JAVA_HOME   #获取jdk据对路径
/opt/jdk1.8.0_171
root@master:/opt/hadoop-2.6.5/etc/hadoop# vim hadoop-env.sh 

写入export JAVA_HOME=/opt/jdk1.8.0_171保存退出 image

2.修改core-site.xml

核心配置文件

root@master:/opt/hadoop-2.6.5/etc/hadoop# vim core-site.xml

写入

<configuration> <property> <name>fs.defaultFS</name> <value>hdfs://master:9000</value> </property> <property> <name>hadoop.tmp.dir</name> <value>file:/opt/hadoop-2.6.5/tmp</value> </property> </configuration> 

image

里面内容以key-value形式书写,规定hadoop的默认文件系统为hdfs以对应的路径和端口(9000)。hadoop产生的临时文件存放地址(/opt/hadoop-2.6.5/tmp)

3.hdfs-site.xml

这个文件不配置也行,就会用默认值,配置了就根据配置的内容来

root@master:/opt/hadoop-2.6.5/etc/hadoop# vim hdfs-site.xml
<configuration> <property> <name>dfs.namenode.secondy.http-address</name> <value>master:50090</value> </property> <property> <name>dfs.namenode.name.dir</name> <value>file:/opt/hadoop-2.6.5/tmp/dfs/name</value> </property> <property> <name>dfs.datanode.data.dir</name> <value>file:/opt/hadoop-2.6.5/tmp/dfs/name</value> </property> <property> <name>dfs.replication</name> <value>1</value> </property> </configuration> 

在这里面我配置了hdfs文件的副本数,默认为3份,但因为我的虚拟机空间不足,这里就配置了1份。大家也可以根据实际要求进行配置。

image

4.mapred-site.xml

这个文件是没有的,只提供一个tmp文件

root@master:/opt/hadoop-2.6.5/etc/hadoop# cp mapred-site.xml.template mapred-site.xml
root@master:/opt/hadoop-2.6.5/etc/hadoop# vim mapred-site.xml 
<configuration> <property> <name>mapreduce.framework.name</name> <value>yarn</value> </property> </configuration> 

mapreduce平行平台的名称(这里指定为yarn)

image

5.yarn-site.xml

root@master:/opt/hadoop-2.6.5/etc/hadoop# vim yarn-site.xml
<configuration> <!-- Site specific YARN configuration properties --> <property> <name>yarn.resourcemanager.hostname</name> <value>master</value> </property> <property> <name>yarn.nodemanager.aux-services</name> <value>mapreduce_shuffle</value> </property> </configuration> 

这里面配置yarn的resourcemanager在哪个节点上运行(这里我I设置为master),和yarn需要的shuffle服务。

image

  • 到这里master上的hadoop就配置好了,接下来就这这个hadoop文件复制到从节点上
root@master:/opt# scp -r hadoop-2.6.5/ node1:/opt/
root@master:/opt# scp -r hadoop-2.6.5/ node2:/opt/ 

2. 为Hadoop添加环境变量

输入命令:vim /etc/profile

添加如下内容: export HADOOP_HOME=/opt/hadoop-2.6.5 export PATH=$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin image

刷新

source  /etc/profile  #刷新
  • 将这些内容也写到从节点的文件下,或者通过scp传过去 从节点刷新。

3. 配置slaves

root@master:/opt/hadoop-2.6.5/etc/hadoop# vim slaves

image

  • 如图所示配置意味着master节点此时既充当主节点也充当从节点(这样可以少开一个虚拟机,节省资源,服务器性能好可以不这样做)

4. 格式化文件系统

输入命令:hdfs namenode -format 看到高亮语句证明格式化成功!

图

安装成功!

测试

启动namenode

root@master:/opt/hadoop-2.6.5/sbin# hadoop-daemon.sh start namenode
starting namenode, logging to /opt/hadoop-2.6.5/logs/hadoop-root-namenode-master.out root@master:/opt/hadoop-2.6.5/sbin# jps 2420 NameNode 3406 Jps 

成功!其中hadoop-daemon.sh是一个启动脚本

关闭namenode

root@master:/opt/hadoop-2.6.5/sbin# hadoop-daemon.sh stop namenode
stopping namenode
root@master:/opt/hadoop-2.6.5/sbin# jps 11754 Jps 

一键启动所有节点(集群) namenode+datanode

主节点

root@master:/opt/hadoop-2.6.5/etc/hadoop# start-all.sh
This script is Deprecated. Instead use start-dfs.sh and start-yarn.sh
Starting namenodes on [master]
master: starting namenode, logging to /opt/hadoop-2.6.5/logs/hadoop-root-namenode-master.out node1: starting datanode, logging to /opt/hadoop-2.6.5/logs/hadoop-root-datanode-node1.out node2: starting datanode, logging to /opt/hadoop-2.6.5/logs/hadoop-root-datanode-node2.out localhost: starting datanode, logging to /opt/hadoop-2.6.5/logs/hadoop-root-datanode-master.out Starting secondary namenodes [0.0.0.0] 0.0.0.0: starting secondarynamenode, logging to /opt/hadoop-2.6.5/logs/hadoop-root-secondarynamenode-master.out starting yarn daemons starting resourcemanager, logging to /opt/hadoop-2.6.5/logs/yarn-root-resourcemanager-master.out node1: starting nodemanager, logging to /opt/hadoop-2.6.5/logs/yarn-root-nodemanager-node1.out node2: starting nodemanager, logging to /opt/hadoop-2.6.5/logs/yarn-root-nodemanager-node2.out localhost: starting nodemanager, logging to /opt/hadoop-2.6.5/logs/yarn-root-nodemanager-master.out root@master:/opt/hadoop-2.6.5/etc/hadoop# jps 14961 ResourceManager 15204 NodeManager 13125 NameNode 16188 Jps 

从节点查

root@node1:/opt# jps
20656 NodeManager
19927 DataNode
21660 Jps
root@node2:~# jps
17553 DataNode
19514 Jps
18314 NodeManager

成功!

在hdfs中创建一个目录firstTestDir

root@master:/opt/hadoop-2.6.5/hadooptmp# hadoop dfs -ls /            #查看原始状态下的目录(没有)
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.root@master:/opt/hadoop-2.6.5/hadooptmp# hadoop dfs -mkdir /firstTestDir #创建目录 DEPRECATED: Use of this script to execute hdfs command is deprecated. Instead use the hdfs command for it. root@master:/opt/hadoop-2.6.5/hadooptmp# hadoop dfs -ls / #查看目录,已经存在 DEPRECATED: Use of this script to execute hdfs command is deprecated. Instead use the hdfs command for it. Found 1 items drwxr-xr-x - root supergroup 0 2018-05-13 21:13 /firstTestDir 

向这个目录下上传文件

这里我将root下的a.txt文件上传为例

root@master:~# l
a.txt 
root@master:~# hadoop dfs -put ./a.txt /firstTestDir            #上传文件a.txt
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.root@master:~# hadoop dfs -ls /firstTestDir        #查看是否成功,ok!
DEPRECATED: Use of this script to execute hdfs command is deprecated. Instead use the hdfs command for it. Found 1 items -rw-r--r-- 1 root supergroup 22002 2018-05-13 21:14 /firstTestDir/a.txt 

关闭所有组件

root@master:/opt/hadoop-2.6.5/etc/hadoop# stop-all.sh

可能遇到的问题:

1.格式化时出现问题

root@master:/opt/hadoop-2.6.5/etc/hadoop# hdfs namenode –format
18/05/12 20:50:16 INFO namenode.NameNode: STARTUP_MSG: 
/************************************************************ STARTUP_MSG: Starting NameNode STARTUP_MSG: host = localhost/127.0.0.1 STARTUP_MSG: args = [–format] STARTUP_MSG: version = 2.6.5 STARTUP_MSG: classpath = /opt/hadoop-2.6.5/etc/hadoop:/opt/hadoop-2.6.5/share/hadoop/common/lib/commons-httpclient-3.1.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/stax-api-1.0-2.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/avro-1.7.4.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/jackson-jaxrs-1.9.13.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/snappy-java-1.0.4.1.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/httpclient-4.2.5.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/httpcore-4.2.5.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/slf4j-api-1.7.5.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/zookeeper-3.4.6.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/guava-11.0.2.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/jackson-mapper-asl-1.9.13.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/mockito-all-1.8.5.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/jersey-core-1.9.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/commons-compress-1.4.1.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/jetty-util-6.1.26.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/commons-cli-1.2.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/jasper-runtime-5.5.23.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/hadoop-auth-2.6.5.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/apacheds-kerberos-codec-2.0.0-M15.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/activation-1.1.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/xz-1.0.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/curator-recipes-2.6.0.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/jaxb-impl-2.2.3-1.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/commons-logging-1.1.3.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/jetty-6.1.26.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/commons-collections-3.2.2.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/paranamer-2.3.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/servlet-api-2.5.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/jaxb-api-2.2.2.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/jersey-server-1.9.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/jettison-1.1.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/commons-beanutils-1.7.0.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/jersey-json-1.9.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/protobuf-java-2.5.0.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/log4j-1.2.17.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/api-asn1-api-1.0.0-M20.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/jets3t-0.9.0.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/commons-beanutils-core-1.8.0.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/junit-4.11.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/htrace-core-3.0.4.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/asm-3.2.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/jsr305-1.3.9.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/java-xmlbuilder-0.4.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/jasper-compiler-5.5.23.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/commons-codec-1.4.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/curator-framework-2.6.0.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/apacheds-i18n-2.0.0-M15.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/commons-configuration-1.6.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/api-util-1.0.0-M20.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/commons-lang-2.6.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/commons-math3-3.1.1.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/jsch-0.1.42.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/commons-el-1.0.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/netty-3.6.2.Final.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/curator-client-2.6.0.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/jsp-api-2.1.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/jackson-xc-1.9.13.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/jackson-core-asl-1.9.13.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/commons-io-2.4.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/hadoop-annotations-2.6.5.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/gson-2.2.4.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/commons-digester-1.8.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/xmlenc-0.52.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/hamcrest-core-1.3.jar:/opt/hadoop-2.6.5/share/hadoop/common/lib/commons-net-3.1.jar:/opt/hadoop-2.6.5/share/hadoop/common/hadoop-nfs-2.6.5.jar:/opt/hadoop-2.6.5/share/hadoop/common/hadoop-common-2.6.5.jar:/opt/hadoop-2.6.5/share/hadoop/common/hadoop-common-2.6.5-tests.jar:/opt/hadoop-2.6.5/share/hadoop/hdfs:/opt/hadoop-2.6.5/share/hadoop/hdfs/lib/guava-11.0.2.jar:/opt/hadoop-2.6.5/share/hadoop/hdfs/lib/jackson-mapper-asl-1.9.13.jar:/opt/hadoop-2.6.5/share/hadoop/hdfs/lib/jersey-core-1.9.jar:/opt/hadoop-2.6.5/share/hadoop/hdfs/lib/jetty-util-6.1.26.jar:/opt/hadoop-2.6.5/share/hadoop/hdfs/lib/commons-cli-1.2.jar:/opt/hadoop-2.6.5/share/hadoop/hdfs/lib/jasper-runtime-5.5.23.jar:/opt/hadoop-2.6.5/share/hadoop/hdfs/lib/commons-logging-1.1.3.jar:/opt/hadoop-2.6.5/share/hadoop/hdfs/lib/jetty-6.1.26.jar:/opt/hadoop-2.6.5/share/hadoop/hdfs/lib/commons-daemon-1.0.13.jar:/opt/hadoop-2.6.5/share/hadoop/hdfs/lib/xml-apis-1.3.04.jar:/opt/hadoop-2.6.5/share/hadoop/hdfs/lib/servlet-api-2.5.jar:/opt/hadoop-2.6.5/share/hadoop/hdfs/lib/jersey-server-1.9.jar:/opt/hadoop-2.6.5/share/hadoop/hdfs/lib/protobuf-java-2.5.0.jar:/opt/hadoop-2.6.5/share/hadoop/hdfs/lib/log4j-1.2.17.jar:/opt/hadoop-2.6.5/share/hadoop/hdfs/lib/htrace-core-3.0.4.jar:/opt/hadoop-2.6.5/share/hadoop/hdfs/lib/asm-3.2.jar:/opt/hadoop-2.6.5/share/hadoop/hdfs/lib/jsr305-1.3.9.jar:/opt/hadoop-2.6.5/share/hadoop/hdfs/lib/xercesImpl-2.9.1.jar:/opt/hadoop-2.6.5/share/hadoop/hdfs/lib/commons-codec-1.4.jar:/opt/hadoop-2.6.5/share/hadoop/hdfs/lib/commons-lang-2.6.jar:/opt/hadoop-2.6.5/share/hadoop/hdfs/lib/commons-el-1.0.jar:/opt/hadoop-2.6.5/share/hadoop/hdfs/lib/netty-3.6.2.Final.jar:/opt/hadoop-2.6.5/share/hadoop/hdfs/lib/jsp-api-2.1.jar:/opt/hadoop-2.6.5/share/hadoop/hdfs/lib/jackson-core-asl-1.9.13.jar:/opt/hadoop-2.6.5/share/hadoop/hdfs/lib/commons-io-2.4.jar:/opt/hadoop-2.6.5/share/hadoop/hdfs/lib/xmlenc-0.52.jar:/opt/hadoop-2.6.5/share/hadoop/hdfs/hadoop-hdfs-2.6.5-tests.jar:/opt/hadoop-2.6.5/share/hadoop/hdfs/hadoop-hdfs-2.6.5.jar:/opt/hadoop-2.6.5/share/hadoop/hdfs/hadoop-hdfs-nfs-2.6.5.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/lib/commons-httpclient-3.1.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/lib/stax-api-1.0-2.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/lib/jackson-jaxrs-1.9.13.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/lib/zookeeper-3.4.6.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/lib/guava-11.0.2.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/lib/jackson-mapper-asl-1.9.13.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/lib/jersey-core-1.9.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/lib/commons-compress-1.4.1.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/lib/jetty-util-6.1.26.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/lib/commons-cli-1.2.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/lib/activation-1.1.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/lib/xz-1.0.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/lib/jaxb-impl-2.2.3-1.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/lib/commons-logging-1.1.3.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/lib/jetty-6.1.26.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/lib/commons-collections-3.2.2.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/lib/servlet-api-2.5.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/lib/jaxb-api-2.2.2.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/lib/jersey-server-1.9.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/lib/jettison-1.1.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/lib/jersey-json-1.9.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/lib/jline-0.9.94.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/lib/protobuf-java-2.5.0.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/lib/log4j-1.2.17.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/lib/guice-3.0.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/lib/asm-3.2.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/lib/jersey-guice-1.9.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/lib/jsr305-1.3.9.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/lib/leveldbjni-all-1.8.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/lib/jersey-client-1.9.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/lib/commons-codec-1.4.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/lib/guice-servlet-3.0.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/lib/commons-lang-2.6.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/lib/netty-3.6.2.Final.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/lib/aopalliance-1.0.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/lib/jackson-xc-1.9.13.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/lib/jackson-core-asl-1.9.13.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/lib/commons-io-2.4.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/lib/javax.inject-1.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/hadoop-yarn-server-resourcemanager-2.6.5.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/hadoop-yarn-server-web-proxy-2.6.5.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/hadoop-yarn-api-2.6.5.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/hadoop-yarn-applications-distributedshell-2.6.5.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/hadoop-yarn-server-applicationhistoryservice-2.6.5.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/hadoop-yarn-server-common-2.6.5.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/hadoop-yarn-applications-unmanaged-am-launcher-2.6.5.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/hadoop-yarn-client-2.6.5.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/hadoop-yarn-common-2.6.5.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/hadoop-yarn-server-tests-2.6.5.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/hadoop-yarn-server-nodemanager-2.6.5.jar:/opt/hadoop-2.6.5/share/hadoop/yarn/hadoop-yarn-registry-2.6.5.jar:/opt/hadoop-2.6.5/share/hadoop/mapreduce/lib/avro-1.7.4.jar:/opt/hadoop-2.6.5/share/hadoop/mapreduce/lib/snappy-java-1.0.4.1.jar:/opt/hadoop-2.6.5/share/hadoop/mapreduce/lib/jackson-mapper-asl-1.9.13.jar:/opt/hadoop-2.6.5/share/hadoop/mapreduce/lib/jersey-core-1.9.jar:/opt/hadoop-2.6.5/share/hadoop/mapreduce/lib/commons-compress-1.4.1.jar:/opt/hadoop-2.6.5/share/hadoop/mapreduce/lib/xz-1.0.jar:/opt/hadoop-2.6.5/share/hadoop/mapreduce/lib/paranamer-2.3.jar:/opt/hadoop-2.6.5/share/hadoop/mapreduce/lib/jersey-server-1.9.jar:/opt/hadoop-2.6.5/share/hadoop/mapreduce/lib/protobuf-java-2.5.0.jar:/opt/hadoop-2.6.5/share/hadoop/mapreduce/lib/log4j-1.2.17.jar:/opt/hadoop-2.6.5/share/hadoop/mapreduce/lib/guice-3.0.jar:/opt/hadoop-2.6.5/share/hadoop/mapreduce/lib/junit-4.11.jar:/opt/hadoop-2.6.5/share/hadoop/mapreduce/lib/asm-3.2.jar:/opt/hadoop-2.6.5/share/hadoop/mapreduce/lib/jersey-guice-1.9.jar:/opt/hadoop-2.6.5/share/hadoop/mapreduce/lib/leveldbjni-all-1.8.jar:/opt/hadoop-2.6.5/share/hadoop/mapreduce/lib/guice-servlet-3.0.jar:/opt/hadoop-2.6.5/share/hadoop/mapreduce/lib/netty-3.6.2.Final.jar:/opt/hadoop-2.6.5/share/hadoop/mapreduce/lib/aopalliance-1.0.jar:/opt/hadoop-2.6.5/share/hadoop/mapreduce/lib/jackson-core-asl-1.9.13.jar:/opt/hadoop-2.6.5/share/hadoop/mapreduce/lib/commons-io-2.4.jar:/opt/hadoop-2.6.5/share/hadoop/mapreduce/lib/hadoop-annotations-2.6.5.jar:/opt/hadoop-2.6.5/share/hadoop/mapreduce/lib/hamcrest-core-1.3.jar:/opt/hadoop-2.6.5/share/hadoop/mapreduce/lib/javax.inject-1.jar:/opt/hadoop-2.6.5/share/hadoop/mapreduce/hadoop-mapreduce-client-jobclient-2.6.5.jar:/opt/hadoop-2.6.5/share/hadoop/mapreduce/hadoop-mapreduce-client-jobclient-2.6.5-tests.jar:/opt/hadoop-2.6.5/share/hadoop/mapreduce/hadoop-mapreduce-client-common-2.6.5.jar:/opt/hadoop-2.6.5/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.6.5.jar:/opt/hadoop-2.6.5/share/hadoop/mapreduce/hadoop-mapreduce-client-app-2.6.5.jar:/opt/hadoop-2.6.5/share/hadoop/mapreduce/hadoop-mapreduce-client-core-2.6.5.jar:/opt/hadoop-2.6.5/share/hadoop/mapreduce/hadoop-mapreduce-client-hs-plugins-2.6.5.jar:/opt/hadoop-2.6.5/share/hadoop/mapreduce/hadoop-mapreduce-client-shuffle-2.6.5.jar:/opt/hadoop-2.6.5/share/hadoop/mapreduce/hadoop-mapreduce-client-hs-2.6.5.jar:/opt/hadoop-2.6.5/contrib/capacity-scheduler/*.jar STARTUP_MSG: build = https://github.com/apache/hadoop.git -r e8c9fe0b4c252caf2ebf1464220599650f119997; compiled by 'sjlee' on 2016-10-02T23:43Z STARTUP_MSG: java = 1.8.0_171 ************************************************************/ 18/05/12 20:50:16 INFO namenode.NameNode: registered UNIX signal handlers for [TERM, HUP, INT] 18/05/12 20:50:16 INFO namenode.NameNode: createNameNode [–format] Usage: java NameNode [-backup] |  [-checkpoint] |  [-format [-clusterid cid ] [-force] [-nonInteractive] ] |  [-upgrade [-clusterid cid] [-renameReserved<k-v pairs>] ] |  [-upgradeOnly [-clusterid cid] [-renameReserved<k-v pairs>] ] |  [-rollback] |  [-rollingUpgrade <rollback|downgrade|started> ] |  [-finalize] |  [-importCheckpoint] |  [-initializeSharedEdits] |  [-bootstrapStandby] |  [-recover [ -force] ] |  [-metadataVersion ] ] 18/05/12 20:50:16 INFO namenode.NameNode: SHUTDOWN_MSG: /************************************************************ SHUTDOWN_MSG: Shutting down NameNode at localhost/127.0.0.1 ************************************************************/ 

原因 hdfs namenode –format "-format"中的-是中文横线,改成英文就好了

2. 通过hadoop dfsadmin -report命令查看到的全是0值,或者上传文件时提示失败,报错是没有可用的datanode。

解决方法,

  • 1.可能是/etc/hosts文件里的主机名和ip对应有问题,可删除没用的对应或易混淆的。
  • 2.防火墙没关
  • 3.ssh没配成功
  • 4.可能多次格式化后namenode和datanode上的clusterID不一致,删除主从节点上的tmp文件,重新格式化。
  • 5.节点的内存。

转载于:https://www.cnblogs.com/weiguoaa/p/9034382.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/427712.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

linux 内核3.8,[Beaglebone] BBB迁移到linux 3.8实时内核

8种机械键盘轴体对比本人程序员&#xff0c;要买一个写代码的键盘&#xff0c;请问红轴和茶轴怎么选&#xff1f;动机之前使用TI SDK提供的3.2标准内核&#xff0c;在和fpga进行高速通信时出现CPU 100%中断响应延迟严重(偶尔>50ms)造成数据丢包。为达到严格的中断响应速度(&…

软考解析:2017年上半年下午试卷

软考解析&#xff1a;2017年上半年下午试卷 第一题&#xff1a;数据流图 第二题&#xff1a;数据库设计 第三题&#xff1a;面向对象开发 真题 理论 类图 状态图 解题思路 第四题&#xff1a;算法与数据结构 第五题&#xff1a;设计模式与Java转载于:https://www.cnblogs.com/…

PHP配置开发环境

PHP配置开发环境 1.建3个文件夹&#xff1a; 2&#xff1a;找到apache的安装包 3&#xff1a;可以随意写 4&#xff1a; 5&#xff1a;找到你的apache的路径 6&#xff1a;注意&#xff1a;不要解压到当前文件夹 7&#xff1a;剪切替换名字修改为php 8&#xff1a;在apache >…

linux下tar包安装sudo命令,ubuntu12.04LTS安装gv-412-Linux-x86.tar.gz方法

折腾了2天多&#xff0c;终于装好了。操作系统Ubuntu 12.04 LTS (在win7系统下用ubuntu的windows安装工具安装的&#xff0c;有点类似双系统)gaussian view程序gv-412-Linux-x86.tar.gz(软件可以从这里找到一些Linux&WinGaussian&gview下载地址)特别提示下面的设计到的…

6章 Models

传统的MVC结构中&#xff0c;有模型这么一个概念。Django中&#xff0c;Models又是怎么一回事呢? 刚才生成的这些乱七八糟的数据迁移就是Django自带的一些应用 INSTALLED_APPS [django.contrib.admin,django.contrib.auth,django.contrib.contenttypes,django.contrib.sessio…

android activity之间传递对象,Android Activity之间的数据传递

一、通过startActivity来进行Activity的传值在Android中&#xff0c;如果我们要通过一个Activity来启动另一个Activity&#xff0c;可以使用 startActivity(Intent intent)方法来传入一个Intent对象&#xff0c;这个Intent对象我们可以精确的指定我们需要跳转的Activity上&…

[UE4]更新UI的三种方式

一、函数绑定 二、属性绑定 只会列出匹配的数据类型。 三、事件驱动更新 啦啦啦啦啦 结论&#xff1a;函数和属性绑定的原理都是每帧都去调用绑定的函数/属性&#xff0c;效率比较低下&#xff0c;一般不推荐使用。事件驱动更新的效率最好&#xff0c;性能最好。 在正式的产品开…

使用handler倒计时

点击button暂停 public class MainActivity extends AppCompatActivity {BindView(R.id.button)Button button;BindView(R.id.first_textview)TextView textView;Handler mHandler;volatile boolean flagtrue;Object objectnew Object();MThread mThread;Overrideprotected voi…

android实现3种定位的切换,Android 滑动定位+吸附悬停效果实现

在前两篇文章中&#xff0c;分别介绍了tablayoutscrollview 和 tablayoutrecyclerview 实现的滑动定位的功能&#xff0c;文章链接&#xff1a;Android 实现锚点定位Android tabLayoutrecyclerView实现锚点定位仔细看的话&#xff0c;这种滑动定位的功能&#xff0c;还可以整体…

unity mmd不支持android,MMD模型导入Unity的解决方案

前言学了Unity后&#xff0c;总是感觉缺少资源&#xff0c;包括人物、物品模型、动作数据、贴图、特效&#xff0c;各种插件&#xff0c;还被骗去学了几天各种美术软件。说起模型和动作数据&#xff0c;就又想到MMD&#xff0c;毕竟有那么现成的资源&#xff0c;虽然不能商用&a…

android中的 listview,Android中ListView的初步认识(一)

ListView是安卓开发中常用的组件之一&#xff0c;它的作用是在一个垂直的列表中展现出所需的项目。接下来&#xff0c;我们看一下ListView的实现方法&#xff1a;第一种 是常见的在XML中定义然后在activity中使用findViewById来获取的方式(这个相当基础了&#xff0c;直接代码)…

android开发app初始化,安卓快速开发框架(一)XBaseAndroid初始化使用

XBaseAndroid如果您需要使用最新版可以去github查看。该文章描述的是1.0.9.4版本。使用AndroidStudio 3.0创建一个新的安卓项目如果您不知道如何创建&#xff0c;请猛戳此处。配置仓库引用项目结构.png点击build.gradle(Project)&#xff0c;添加以下maven仓库。allprojects {r…

Python之模块与包(下)

1、什么是包 #官网解释 Packages are a way of structuring Python’s module namespace by using “dotted module names” 包是一种通过使用‘.模块名’来组织python模块名称空间的方式。 #具体的&#xff1a;包就是一个包含有__init__.py文件的文件夹&#xff0c;所以其实我…

接口测试学习——操作MySQL

第一步要导入第三方的jar包。&#xff08;jemeter不能直接连接MySQL&#xff09; 操作方法就是点击“测试计划”&#xff0c;右侧展开的页面中选择【浏览】&#xff0c;选择MySQL的jar包。导入即可。 第二步&#xff1a;创建数据库链接的配置&#xff1a;MySQL的路径URL、端口号…

html5网页自动滚动,Html5 滚动穿透的方法

问题背景&#xff1a;网站需要在移动端完成适配,针对移动端H5以及web端采用的都是bluma这种flex布局解决方案在H5中使用的列表采用的是 react-virtualized 来绘制表格为了展示表格中单行数据的具体详情&#xff0c;通常的解决方案是采用新页面或者是弹窗来完成。这里采用的是弹…

mac如何看html5视频播放器,苹果Mac系统看HTML5视频教程介绍

上一回&#xff0c;小编教了大家一个Mac用 HTML5 免费看优酷和土豆等付费视频&#xff0c;这回小编又找到一个用HTML5看视频的好方法&#xff0c;很多很好用的资源&#xff0c;你可以在Mac上看各种地方台的直播以及乐视、凤凰卫视、TVB、东森等港澳台电视节目哦&#xff01;大部…

html中设置负边距的意义,css负边距之详解

自从1998年CSS2作为推荐以来&#xff0c;表格的使用渐渐退去&#xff0c;成为历史。正因为此&#xff0c;从那以后CSS布局成为了优雅代码的代名词。对于所有设计师使用过的CSS概念&#xff0c;负边距作为最少讨论到的定位方式要记上一功。这就像是在线纹身-每个人都会做&#x…

warning: expression result unuesd 可能原因是函数忘了加括号,

转载于:https://www.cnblogs.com/chulin/p/9082833.html

vue基础18(vue-cli脚手架项目中组件的使用)

vue-cli脚手架项目中组件的使用 在webpack-simple模板中&#xff0c;包括webpck模板。一个.vue文件就是一个组件。 为什么会这样呢&#xff1f;因为webpack干活了&#xff01;webpack的将我们所有的资源文件进行打包。同时webpack还能将我们的html&#xff08;template&#xf…

js和layerjs配合实现的拖拽表格列

前几天想着实现表格列的拖拽 写了个例子 一直不完美 经过修改感觉还算完美了 拖拽过程不会复制文字并且还能实现layerjs本身自带的表格排序功能。 1、首先引入layer.css jquery layui.all.js 2、布局页面 <div class"divT"> <table class"l…