ubuntu中安装hadoop集群
hadoop是由java 語(yǔ)言編寫(xiě)的主從結(jié)構(gòu)分布式計(jì)算存儲(chǔ)架構(gòu)
準(zhǔn)備工作:
操作系統(tǒng): Ubuntu16.04
軟件安裝包:jdk-8u171-linux-x64.tar.gz ; hadoop-2.6.5.tar.gz
配置環(huán)境:3臺(tái)虛擬機(jī)
master:192.168.122.10node1 :192.168.122.11 node1 :192.168.122.12- 前提條件:三臺(tái)虛擬機(jī)已經(jīng)配置過(guò)SSH和主機(jī)名,如果沒(méi)有,請(qǐng)自行百度配置。
第一步:安裝jdk
因?yàn)閔adoop是由java編寫(xiě)的,所以底層需要依賴(lài)java環(huán)境, 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.gz2.解壓tar包
可以自己先創(chuàng)一個(gè)目錄來(lái)解壓方便以后管理,這次我就解壓在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添加到環(huán)境變量中
root@master:/opt# vim /etc/profile在文件末尾添加
export JAVA_HOME=/opt/jdk1.8.0_171 export PATH=$PATH:$JAVA_HOME/bin4.刷新環(huán)境變量文件
root@master:/opt# echo $JAVA_HOME #沒(méi)刷新前的結(jié)果為空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就安裝好了 接下來(lái)就是將從節(jié)點(diǎn)上也安裝,這里就可以將master上解壓好和修改好的/etc/profile文件直接拷貝到從節(jié)點(diǎn)上了,這樣比較方便,不然還得重復(fù)配置。
-
這里我還是將jdk放在從節(jié)點(diǎn)的/opt目錄下
在node1和node2上執(zhí)行
source /etc/profile #刷新- 到這里三臺(tái)虛擬機(jī)的JDK就全部安裝好了!
第二步:安裝hadoop
從網(wǎng)站http://hadoop.apache.org/releases.html找到合適的hadoop的二進(jìn)制版本,本次我用的是2.6.5
1. 下載
root@master:/opt/tar# wget http://www-eu.apache.org/dist/hadoop/common/hadoop-2.6.5/hadoop-2.6.5.tar.gz2.解壓
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.修改配置文件
進(jìn)入/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.example1.修改hadoop-env.sh
里面是啟動(dòng)的腳本文件,將jdk導(dǎo)入
root@master:/opt/hadoop-2.6.5/etc/hadoop# echo $JAVA_HOME #獲取jdk據(jù)對(duì)路徑 /opt/jdk1.8.0_171 root@master:/opt/hadoop-2.6.5/etc/hadoop# vim hadoop-env.sh寫(xiě)入export JAVA_HOME=/opt/jdk1.8.0_171保存退出?
2.修改core-site.xml
核心配置文件
root@master:/opt/hadoop-2.6.5/etc/hadoop# vim core-site.xml寫(xiě)入
<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>里面內(nèi)容以key-value形式書(shū)寫(xiě),規(guī)定hadoop的默認(rèn)文件系統(tǒng)為hdfs以對(duì)應(yīng)的路徑和端口(9000)。hadoop產(chǎn)生的臨時(shí)文件存放地址(/opt/hadoop-2.6.5/tmp)
3.hdfs-site.xml
這個(gè)文件不配置也行,就會(huì)用默認(rèn)值,配置了就根據(jù)配置的內(nèi)容來(lái)
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文件的副本數(shù),默認(rèn)為3份,但因?yàn)槲业奶摂M機(jī)空間不足,這里就配置了1份。大家也可以根據(jù)實(shí)際要求進(jìn)行配置。
4.mapred-site.xml
這個(gè)文件是沒(méi)有的,只提供一個(gè)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平行平臺(tái)的名稱(chēng)(這里指定為yarn)
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在哪個(gè)節(jié)點(diǎn)上運(yùn)行(這里我I設(shè)置為master),和yarn需要的shuffle服務(wù)。
- 到這里master上的hadoop就配置好了,接下來(lái)就這這個(gè)hadoop文件復(fù)制到從節(jié)點(diǎn)上
2. 為Hadoop添加環(huán)境變量
輸入命令:vim /etc/profile
添加如下內(nèi)容: export HADOOP_HOME=/opt/hadoop-2.6.5 export PATH=$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin?
刷新
source /etc/profile #刷新- 將這些內(nèi)容也寫(xiě)到從節(jié)點(diǎn)的文件下,或者通過(guò)scp傳過(guò)去 從節(jié)點(diǎn)刷新。
3. 配置slaves
root@master:/opt/hadoop-2.6.5/etc/hadoop# vim slaves- 如圖所示配置意味著master節(jié)點(diǎn)此時(shí)既充當(dāng)主節(jié)點(diǎn)也充當(dāng)從節(jié)點(diǎn)(這樣可以少開(kāi)一個(gè)虛擬機(jī),節(jié)省資源,服務(wù)器性能好可以不這樣做)
4. 格式化文件系統(tǒng)
輸入命令:hdfs namenode -format 看到高亮語(yǔ)句證明格式化成功!
安裝成功!
測(cè)試
啟動(dòng)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是一個(gè)啟動(dòng)腳本
關(guān)閉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一鍵啟動(dòng)所有節(jié)點(diǎn)(集群) namenode+datanode
主節(jié)點(diǎn)
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從節(jié)點(diǎn)查看
root@node1:/opt# jps 20656 NodeManager 19927 DataNode 21660 Jps root@node2:~# jps 17553 DataNode 19514 Jps 18314 NodeManager成功!
在hdfs中創(chuàng)建一個(gè)目錄firstTestDir
root@master:/opt/hadoop-2.6.5/hadooptmp# hadoop dfs -ls / #查看原始狀態(tài)下的目錄(沒(méi)有) 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 #創(chuàng)建目錄 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 / #查看目錄,已經(jīng)存在 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向這個(gè)目錄下上傳文件
這里我將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關(guān)閉所有組件
root@master:/opt/hadoop-2.6.5/etc/hadoop# stop-all.sh可能遇到的問(wèn)題:
1.格式化時(shí)出現(xiàn)問(wèn)題
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. 通過(guò)hadoop dfsadmin -report命令查看到的全是0值,或者上傳文件時(shí)提示失敗,報(bào)錯(cuò)是沒(méi)有可用的datanode。
解決方法,
- 1.可能是/etc/hosts文件里的主機(jī)名和ip對(duì)應(yīng)有問(wèn)題,可刪除沒(méi)用的對(duì)應(yīng)或易混淆的。
- 2.防火墻沒(méi)關(guān)
- 3.ssh沒(méi)配成功
- 4.可能多次格式化后namenode和datanode上的clusterID不一致,刪除主從節(jié)點(diǎn)上的tmp文件,重新格式化。
- 5.節(jié)點(diǎn)的內(nèi)存。
轉(zhuǎn)載于:https://www.cnblogs.com/ameijiemu/p/9034423.html
《新程序員》:云原生和全面數(shù)字化實(shí)踐50位技術(shù)專(zhuān)家共同創(chuàng)作,文字、視頻、音頻交互閱讀總結(jié)
以上是生活随笔為你收集整理的ubuntu中安装hadoop集群的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 接收列表
- 下一篇: Linux CentOS7.0下JAVA