~]# tar -zxvf hadoop-2.10.0.tar.gz -C /opt/module/
~]# vim /etc/profile.d/hadoop_config.sh
##HADOOP_HOME
export HADOOP_HOME=/opt/module/hadoop-2.10.0
export PATH=$PATH:$HADOOP_HOME/bin
export PATH=$PATH:$HADOOP_HOME/sbin
~]# hadoop version
Hadoop 2.10.0
Subversion ssh://git.corp.linkedin.com:29418/hadoop/hadoop.git -r e2f1f118e465e787d8567dfa6e2f3b72a0eb9194
Compiled by jhung on 2019-10-22T19:10Z
Compiled with protoc 2.5.0
From source with checksum 7b2d8877c5ce8c9a2cca5c7e81aa4026
This command was run using /opt/module/hadoop-2.10.0/share/hadoop/common/hadoop-common-2.10.0.jar
配置:/opt/module/hadoop-2.10.0/etc/hadoop/hadoop-env.sh
export JAVA_HOME=/opt/module/jdk1.8.0_162
配置:/opt/module/hadoop-2.10.0/etc/hadoop/core-site.xml
<configuration>
<property>
<name>fs.defaultFSname>
<value>hdfs://localhost:9000value>
property>
<property>
<name>hadoop.tmp.dirname>
<value>/opt/module/hadoop-2.10.0/data/tmpvalue>
property>
configuration>
配置:/opt/module/hadoop-2.10.0/etc/hadoop/hdfs-site.xml
<configuration>
<property>
<name>dfs.replicationname>
<value>1value>
property>
configuration>
namenode格式化
[root@VM_0_11_centos hadoop-2.10.0]# bin/hadoop namenode -format
或者bin/hdfs namenode -format
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.
19/12/05 21:28:13 INFO namenode.NameNode: STARTUP_MSG:
/************************************************************
STARTUP_MSG: Starting NameNode
STARTUP_MSG: host = VM_0_11_centos/127.0.0.1
STARTUP_MSG: args = [-format]
STARTUP_MSG: version = 2.10.0
STARTUP_MSG: classpath = /opt/module/hadoop-2.10.0/etc/hadoop:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/mockito-all-1.8.5.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/commons-collections-3.2.2.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/stax2-api-3.1.4.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/api-util-1.0.0-M20.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/jsch-0.1.54.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/zookeeper-3.4.9.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/stax-api-1.0-2.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/slf4j-api-1.7.25.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/commons-compress-1.19.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/jersey-json-1.9.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/apacheds-kerberos-codec-2.0.0-M15.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/curator-recipes-2.7.1.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/jackson-mapper-asl-1.9.13.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/httpcore-4.4.4.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/jackson-xc-1.9.13.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/commons-net-3.1.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/commons-io-2.4.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/jetty-6.1.26.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/netty-3.10.6.Final.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/jaxb-api-2.2.2.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/jcip-annotations-1.0-1.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/gson-2.2.4.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/hamcrest-core-1.3.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/jsp-api-2.1.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/curator-client-2.7.1.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/snappy-java-1.0.5.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/commons-math3-3.1.1.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/jackson-jaxrs-1.9.13.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/jetty-util-6.1.26.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/commons-digester-1.8.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/commons-beanutils-1.9.4.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/jaxb-impl-2.2.3-1.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/apacheds-i18n-2.0.0-M15.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/curator-framework-2.7.1.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/java-xmlbuilder-0.4.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/jersey-core-1.9.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/commons-logging-1.1.3.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/commons-configuration-1.6.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/junit-4.11.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/servlet-api-2.5.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/jsr305-3.0.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/avro-1.7.7.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/jackson-core-asl-1.9.13.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/api-asn1-api-1.0.0-M20.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/woodstox-core-5.0.3.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/htrace-core4-4.1.0-incubating.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/guava-11.0.2.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/commons-lang3-3.4.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/commons-lang-2.6.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/jets3t-0.9.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/hadoop-annotations-2.10.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/log4j-1.2.17.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/jetty-sslengine-6.1.26.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/nimbus-jose-jwt-4.41.1.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/hadoop-auth-2.10.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/commons-codec-1.4.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/jettison-1.1.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/xmlenc-0.52.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/activation-1.1.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/paranamer-2.3.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/commons-cli-1.2.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/asm-3.2.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/protobuf-java-2.5.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/httpclient-4.5.2.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/json-smart-1.3.1.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/lib/jersey-server-1.9.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/hadoop-nfs-2.10.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/hadoop-common-2.10.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/common/hadoop-common-2.10.0-tests.jar:/opt/module/hadoop-2.10.0/share/hadoop/hdfs:/opt/module/hadoop-2.10.0/share/hadoop/hdfs/lib/leveldbjni-all-1.8.jar:/opt/module/hadoop-2.10.0/share/hadoop/hdfs/lib/jackson-mapper-asl-1.9.13.jar:/opt/module/hadoop-2.10.0/share/hadoop/hdfs/lib/commons-io-2.4.jar:/opt/module/hadoop-2.10.0/share/hadoop/hdfs/lib/jackson-databind-2.7.8.jar:/opt/module/hadoop-2.10.0/share/hadoop/hdfs/lib/jetty-6.1.26.jar:/opt/module/hadoop-2.10.0/share/hadoop/hdfs/lib/netty-3.10.6.Final.jar:/opt/module/hadoop-2.10.0/share/hadoop/hdfs/lib/jetty-util-6.1.26.jar:/opt/module/hadoop-2.10.0/share/hadoop/hdfs/lib/jackson-annotations-2.7.8.jar:/opt/module/hadoop-2.10.0/share/hadoop/hdfs/lib/jersey-core-1.9.jar:/opt/module/hadoop-2.10.0/share/hadoop/hdfs/lib/commons-logging-1.1.3.jar:/opt/module/hadoop-2.10.0/share/hadoop/hdfs/lib/okhttp-2.7.5.jar:/opt/module/hadoop-2.10.0/share/hadoop/hdfs/lib/servlet-api-2.5.jar:/opt/module/hadoop-2.10.0/share/hadoop/hdfs/lib/jsr305-3.0.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/hdfs/lib/jackson-core-asl-1.9.13.jar:/opt/module/hadoop-2.10.0/share/hadoop/hdfs/lib/hadoop-hdfs-client-2.10.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/hdfs/lib/htrace-core4-4.1.0-incubating.jar:/opt/module/hadoop-2.10.0/share/hadoop/hdfs/lib/guava-11.0.2.jar:/opt/module/hadoop-2.10.0/share/hadoop/hdfs/lib/jackson-core-2.7.8.jar:/opt/module/hadoop-2.10.0/share/hadoop/hdfs/lib/commons-lang-2.6.jar:/opt/module/hadoop-2.10.0/share/hadoop/hdfs/lib/log4j-1.2.17.jar:/opt/module/hadoop-2.10.0/share/hadoop/hdfs/lib/commons-codec-1.4.jar:/opt/module/hadoop-2.10.0/share/hadoop/hdfs/lib/commons-daemon-1.0.13.jar:/opt/module/hadoop-2.10.0/share/hadoop/hdfs/lib/xmlenc-0.52.jar:/opt/module/hadoop-2.10.0/share/hadoop/hdfs/lib/netty-all-4.0.23.Final.jar:/opt/module/hadoop-2.10.0/share/hadoop/hdfs/lib/xercesImpl-2.12.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/hdfs/lib/xml-apis-1.4.01.jar:/opt/module/hadoop-2.10.0/share/hadoop/hdfs/lib/commons-cli-1.2.jar:/opt/module/hadoop-2.10.0/share/hadoop/hdfs/lib/asm-3.2.jar:/opt/module/hadoop-2.10.0/share/hadoop/hdfs/lib/protobuf-java-2.5.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/hdfs/lib/okio-1.6.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/hdfs/lib/jersey-server-1.9.jar:/opt/module/hadoop-2.10.0/share/hadoop/hdfs/hadoop-hdfs-native-client-2.10.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/hdfs/hadoop-hdfs-client-2.10.0-tests.jar:/opt/module/hadoop-2.10.0/share/hadoop/hdfs/hadoop-hdfs-rbf-2.10.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/hdfs/hadoop-hdfs-2.10.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/hdfs/hadoop-hdfs-client-2.10.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/hdfs/hadoop-hdfs-native-client-2.10.0-tests.jar:/opt/module/hadoop-2.10.0/share/hadoop/hdfs/hadoop-hdfs-rbf-2.10.0-tests.jar:/opt/module/hadoop-2.10.0/share/hadoop/hdfs/hadoop-hdfs-2.10.0-tests.jar:/opt/module/hadoop-2.10.0/share/hadoop/hdfs/hadoop-hdfs-nfs-2.10.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/commons-collections-3.2.2.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/stax2-api-3.1.4.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/geronimo-jcache_1.0_spec-1.0-alpha-1.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/api-util-1.0.0-M20.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/jsch-0.1.54.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/zookeeper-3.4.9.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/stax-api-1.0-2.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/commons-compress-1.19.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/jersey-json-1.9.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/leveldbjni-all-1.8.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/json-io-2.5.1.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/apacheds-kerberos-codec-2.0.0-M15.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/curator-recipes-2.7.1.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/jackson-mapper-asl-1.9.13.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/httpcore-4.4.4.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/jackson-xc-1.9.13.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/commons-net-3.1.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/commons-io-2.4.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/ehcache-3.3.1.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/jetty-6.1.26.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/netty-3.10.6.Final.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/jaxb-api-2.2.2.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/jersey-guice-1.9.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/jcip-annotations-1.0-1.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/gson-2.2.4.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/jsp-api-2.1.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/java-util-1.9.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/curator-client-2.7.1.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/snappy-java-1.0.5.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/commons-math3-3.1.1.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/jackson-jaxrs-1.9.13.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/jetty-util-6.1.26.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/commons-digester-1.8.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/commons-beanutils-1.9.4.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/guice-3.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/jaxb-impl-2.2.3-1.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/fst-2.50.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/apacheds-i18n-2.0.0-M15.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/aopalliance-1.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/curator-framework-2.7.1.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/java-xmlbuilder-0.4.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/jersey-core-1.9.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/HikariCP-java7-2.4.12.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/commons-logging-1.1.3.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/commons-configuration-1.6.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/metrics-core-3.0.1.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/servlet-api-2.5.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/jsr305-3.0.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/avro-1.7.7.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/jackson-core-asl-1.9.13.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/jersey-client-1.9.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/mssql-jdbc-6.2.1.jre7.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/api-asn1-api-1.0.0-M20.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/woodstox-core-5.0.3.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/htrace-core4-4.1.0-incubating.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/guava-11.0.2.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/commons-lang3-3.4.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/commons-lang-2.6.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/javax.inject-1.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/jets3t-0.9.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/guice-servlet-3.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/log4j-1.2.17.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/jetty-sslengine-6.1.26.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/nimbus-jose-jwt-4.41.1.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/commons-codec-1.4.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/jettison-1.1.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/xmlenc-0.52.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/activation-1.1.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/paranamer-2.3.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/commons-cli-1.2.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/asm-3.2.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/protobuf-java-2.5.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/httpclient-4.5.2.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/json-smart-1.3.1.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/lib/jersey-server-1.9.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/hadoop-yarn-applications-distributedshell-2.10.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/hadoop-yarn-server-web-proxy-2.10.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/hadoop-yarn-server-applicationhistoryservice-2.10.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/hadoop-yarn-client-2.10.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/hadoop-yarn-server-resourcemanager-2.10.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/hadoop-yarn-server-tests-2.10.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/hadoop-yarn-api-2.10.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/hadoop-yarn-applications-unmanaged-am-launcher-2.10.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/hadoop-yarn-server-nodemanager-2.10.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/hadoop-yarn-server-sharedcachemanager-2.10.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/hadoop-yarn-server-timeline-pluginstorage-2.10.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/hadoop-yarn-server-router-2.10.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/hadoop-yarn-registry-2.10.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/hadoop-yarn-server-common-2.10.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/yarn/hadoop-yarn-common-2.10.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/mapreduce/lib/commons-compress-1.19.jar:/opt/module/hadoop-2.10.0/share/hadoop/mapreduce/lib/leveldbjni-all-1.8.jar:/opt/module/hadoop-2.10.0/share/hadoop/mapreduce/lib/jackson-mapper-asl-1.9.13.jar:/opt/module/hadoop-2.10.0/share/hadoop/mapreduce/lib/commons-io-2.4.jar:/opt/module/hadoop-2.10.0/share/hadoop/mapreduce/lib/netty-3.10.6.Final.jar:/opt/module/hadoop-2.10.0/share/hadoop/mapreduce/lib/jersey-guice-1.9.jar:/opt/module/hadoop-2.10.0/share/hadoop/mapreduce/lib/hamcrest-core-1.3.jar:/opt/module/hadoop-2.10.0/share/hadoop/mapreduce/lib/snappy-java-1.0.5.jar:/opt/module/hadoop-2.10.0/share/hadoop/mapreduce/lib/guice-3.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/mapreduce/lib/aopalliance-1.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/mapreduce/lib/jersey-core-1.9.jar:/opt/module/hadoop-2.10.0/share/hadoop/mapreduce/lib/junit-4.11.jar:/opt/module/hadoop-2.10.0/share/hadoop/mapreduce/lib/avro-1.7.7.jar:/opt/module/hadoop-2.10.0/share/hadoop/mapreduce/lib/jackson-core-asl-1.9.13.jar:/opt/module/hadoop-2.10.0/share/hadoop/mapreduce/lib/javax.inject-1.jar:/opt/module/hadoop-2.10.0/share/hadoop/mapreduce/lib/hadoop-annotations-2.10.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/mapreduce/lib/guice-servlet-3.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/mapreduce/lib/log4j-1.2.17.jar:/opt/module/hadoop-2.10.0/share/hadoop/mapreduce/lib/paranamer-2.3.jar:/opt/module/hadoop-2.10.0/share/hadoop/mapreduce/lib/asm-3.2.jar:/opt/module/hadoop-2.10.0/share/hadoop/mapreduce/lib/protobuf-java-2.5.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/mapreduce/lib/jersey-server-1.9.jar:/opt/module/hadoop-2.10.0/share/hadoop/mapreduce/hadoop-mapreduce-client-jobclient-2.10.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/mapreduce/hadoop-mapreduce-client-hs-plugins-2.10.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.10.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/mapreduce/hadoop-mapreduce-client-app-2.10.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/mapreduce/hadoop-mapreduce-client-core-2.10.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/mapreduce/hadoop-mapreduce-client-hs-2.10.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/mapreduce/hadoop-mapreduce-client-jobclient-2.10.0-tests.jar:/opt/module/hadoop-2.10.0/share/hadoop/mapreduce/hadoop-mapreduce-client-shuffle-2.10.0.jar:/opt/module/hadoop-2.10.0/share/hadoop/mapreduce/hadoop-mapreduce-client-common-2.10.0.jar:/contrib/capacity-scheduler/*.jar:/contrib/capacity-scheduler/*.jar
STARTUP_MSG: build = ssh://git.corp.linkedin.com:29418/hadoop/hadoop.git -r e2f1f118e465e787d8567dfa6e2f3b72a0eb9194; compiled by 'jhung' on 2019-10-22T19:10Z
STARTUP_MSG: java = 1.8.0_162
************************************************************/
19/12/05 21:28:13 INFO namenode.NameNode: registered UNIX signal handlers for [TERM, HUP, INT]
19/12/05 21:28:13 INFO namenode.NameNode: createNameNode [-format]
Formatting using clusterid: CID-af385f58-0574-4517-ac50-0186de3e5ab2
19/12/05 21:28:15 INFO namenode.FSEditLog: Edit logging is async:true
19/12/05 21:28:15 INFO namenode.FSNamesystem: KeyProvider: null
19/12/05 21:28:15 INFO namenode.FSNamesystem: fsLock is fair: true
19/12/05 21:28:15 INFO namenode.FSNamesystem: Detailed lock hold time metrics enabled: false
19/12/05 21:28:15 INFO namenode.FSNamesystem: fsOwner = root (auth:SIMPLE)
19/12/05 21:28:15 INFO namenode.FSNamesystem: supergroup = supergroup
19/12/05 21:28:15 INFO namenode.FSNamesystem: isPermissionEnabled = true
19/12/05 21:28:15 INFO namenode.FSNamesystem: HA Enabled: false
19/12/05 21:28:15 INFO common.Util: dfs.datanode.fileio.profiling.sampling.percentage set to 0. Disabling file IO profiling
19/12/05 21:28:15 INFO blockmanagement.DatanodeManager: dfs.block.invalidate.limit: configured=1000, counted=60, effected=1000
19/12/05 21:28:15 INFO blockmanagement.DatanodeManager: dfs.namenode.datanode.registration.ip-hostname-check=true
19/12/05 21:28:15 INFO blockmanagement.BlockManager: dfs.namenode.startup.delay.block.deletion.sec is set to 000:00:00:00.000
19/12/05 21:28:15 INFO blockmanagement.BlockManager: The block deletion will start around 2019 Dec 05 21:28:15
19/12/05 21:28:15 INFO util.GSet: Computing capacity for map BlocksMap
19/12/05 21:28:15 INFO util.GSet: VM type = 64-bit
19/12/05 21:28:15 INFO util.GSet: 2.0% max memory 966.7 MB = 19.3 MB
19/12/05 21:28:15 INFO util.GSet: capacity = 2^21 = 2097152 entries
19/12/05 21:28:15 INFO blockmanagement.BlockManager: dfs.block.access.token.enable=false
19/12/05 21:28:15 WARN conf.Configuration: No unit for dfs.heartbeat.interval(3) assuming SECONDS
19/12/05 21:28:15 WARN conf.Configuration: No unit for dfs.namenode.safemode.extension(30000) assuming MILLISECONDS
19/12/05 21:28:15 INFO blockmanagement.BlockManagerSafeMode: dfs.namenode.safemode.threshold-pct = 0.9990000128746033
19/12/05 21:28:15 INFO blockmanagement.BlockManagerSafeMode: dfs.namenode.safemode.min.datanodes = 0
19/12/05 21:28:15 INFO blockmanagement.BlockManagerSafeMode: dfs.namenode.safemode.extension = 30000
19/12/05 21:28:15 INFO blockmanagement.BlockManager: defaultReplication = 1
19/12/05 21:28:15 INFO blockmanagement.BlockManager: maxReplication = 512
19/12/05 21:28:15 INFO blockmanagement.BlockManager: minReplication = 1
19/12/05 21:28:15 INFO blockmanagement.BlockManager: maxReplicationStreams = 2
19/12/05 21:28:15 INFO blockmanagement.BlockManager: replicationRecheckInterval = 3000
19/12/05 21:28:15 INFO blockmanagement.BlockManager: encryptDataTransfer = false
19/12/05 21:28:15 INFO blockmanagement.BlockManager: maxNumBlocksToLog = 1000
19/12/05 21:28:15 INFO namenode.FSNamesystem: Append Enabled: true
19/12/05 21:28:16 INFO namenode.FSDirectory: GLOBAL serial map: bits=24 maxEntries=16777215
19/12/05 21:28:16 INFO util.GSet: Computing capacity for map INodeMap
19/12/05 21:28:16 INFO util.GSet: VM type = 64-bit
19/12/05 21:28:16 INFO util.GSet: 1.0% max memory 966.7 MB = 9.7 MB
19/12/05 21:28:16 INFO util.GSet: capacity = 2^20 = 1048576 entries
19/12/05 21:28:16 INFO namenode.FSDirectory: ACLs enabled? false
19/12/05 21:28:16 INFO namenode.FSDirectory: XAttrs enabled? true
19/12/05 21:28:16 INFO namenode.NameNode: Caching file names occurring more than 10 times
19/12/05 21:28:16 INFO snapshot.SnapshotManager: Loaded config captureOpenFiles: falseskipCaptureAccessTimeOnlyChange: false
19/12/05 21:28:16 INFO util.GSet: Computing capacity for map cachedBlocks
19/12/05 21:28:16 INFO util.GSet: VM type = 64-bit
19/12/05 21:28:16 INFO util.GSet: 0.25% max memory 966.7 MB = 2.4 MB
19/12/05 21:28:16 INFO util.GSet: capacity = 2^18 = 262144 entries
19/12/05 21:28:16 INFO metrics.TopMetrics: NNTop conf: dfs.namenode.top.window.num.buckets = 10
19/12/05 21:28:16 INFO metrics.TopMetrics: NNTop conf: dfs.namenode.top.num.users = 10
19/12/05 21:28:16 INFO metrics.TopMetrics: NNTop conf: dfs.namenode.top.windows.minutes = 1,5,25
19/12/05 21:28:16 INFO namenode.FSNamesystem: Retry cache on namenode is enabled
19/12/05 21:28:16 INFO namenode.FSNamesystem: Retry cache will use 0.03 of total heap and retry cache entry expiry time is 600000 millis
19/12/05 21:28:16 INFO util.GSet: Computing capacity for map NameNodeRetryCache
19/12/05 21:28:16 INFO util.GSet: VM type = 64-bit
19/12/05 21:28:16 INFO util.GSet: 0.029999999329447746% max memory 966.7 MB = 297.0 KB
19/12/05 21:28:16 INFO util.GSet: capacity = 2^15 = 32768 entries
19/12/05 21:28:16 INFO namenode.FSImage: Allocated new BlockPoolId: BP-564765981-127.0.0.1-1575552496224
19/12/05 21:28:16 INFO common.Storage: Storage directory /tmp/hadoop-root/dfs/name has been successfully formatted.
19/12/05 21:28:16 INFO namenode.FSImageFormatProtobuf: Saving image file /tmp/hadoop-root/dfs/name/current/fsimage.ckpt_0000000000000000000 using no compression
19/12/05 21:28:16 INFO namenode.FSImageFormatProtobuf: Image file /tmp/hadoop-root/dfs/name/current/fsimage.ckpt_0000000000000000000 of size 323 bytes saved in 0 seconds .
19/12/05 21:28:16 INFO namenode.NNStorageRetentionManager: Going to retain 1 images with txid >= 0
19/12/05 21:28:16 INFO namenode.FSImage: FSImageSaver clean checkpoint: txid = 0 when meet shutdown.
19/12/05 21:28:16 INFO namenode.NameNode: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at VM_0_11_centos/127.0.0.1
************************************************************/
启动
[root@VM_0_11_centos hadoop-2.10.0]# sbin/start-dfs.sh
Starting namenodes on [localhost]
localhost: starting namenode, logging to /opt/module/hadoop-2.10.0/logs/hadoop-root-namenode-VM_0_11_centos.out
localhost: starting datanode, logging to /opt/module/hadoop-2.10.0/logs/hadoop-root-datanode-VM_0_11_centos.out
Starting secondary namenodes [0.0.0.0]
The authenticity of host '0.0.0.0 (0.0.0.0)' can't be established.
ECDSA key fingerprint is SHA256:aNI4wsuKhkgVoUayrPKkj+ExSXnMPGMrj7AbXitVsVw.
ECDSA key fingerprint is MD5:72:c1:b5:d6:1d:10:5f:a8:52:79:4d:f1:82:95:b2:66.
Are you sure you want to continue connecting (yes/no)? yes
0.0.0.0: Warning: Permanently added '0.0.0.0' (ECDSA) to the list of known hosts.
0.0.0.0: starting secondarynamenode, logging to /opt/module/hadoop-2.10.0/logs/hadoop-root-secondarynamenode-VM_0_11_centos.out
[root@VM_0_11_centos hadoop-2.10.0]#
或者
[root@VM_0_11_centos hadoop-2.10.0]# sbin/hadoop-daemon.sh start namenode
starting namenode, logging to /opt/module/hadoop-2.10.0/logs/hadoop-root-namenode-VM_0_11_centos.out
[root@VM_0_11_centos hadoop-2.10.0]# sbin/hadoop-daemon.sh start datanode
starting datanode, logging to /opt/module/hadoop-2.10.0/logs/hadoop-root-datanode-VM_0_11_centos.out
[root@VM_0_11_centos hadoop-2.10.0]# jps
4690 NameNode
4806 DataNode
5287 Jps
5053 SecondaryNameNode
[root@VM_0_11_centos hadoop-2.10.0]#
[root@VM_0_11_centos hadoop-2.10.0]# jps -l
4690 org.apache.hadoop.hdfs.server.namenode.NameNode
4806 org.apache.hadoop.hdfs.server.datanode.DataNode
5414 sun.tools.jps.Jps
5053 org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode
[root@VM_0_11_centos hadoop-2.10.0]#
HDFS的Web界面默认端口号是50070
http://106.54.246.249:50070/
nn,dn 版本号
[root@michael hadoop-2.10.0]# cat /opt/module/hadoop-2.10.0/data/tmp/dfs/name/current/VERSION
#Sat Dec 14 08:40:37 CST 2019
namespaceID=623446727
clusterID=CID-d6902ad6-573c-4eca-8c85-4224765c834b
cTime=1576284037082
storageType=NAME_NODE
blockpoolID=BP-1450870641-172.17.0.11-1576284037082
layoutVersion=-63
[root@michael hadoop-2.10.0]# cat /opt/module/hadoop-2.10.0/data/tmp/dfs/data/current/VERSION
#Sat Dec 14 08:41:39 CST 2019
storageID=DS-254bef80-fb42-4ce4-86ea-c1677686bba0
clusterID=CID-d6902ad6-573c-4eca-8c85-4224765c834b
cTime=0
datanodeUuid=f681c12c-e813-4aa2-aa00-094bf8f21508
storageType=DATA_NODE
layoutVersion=-57
[root@michael hadoop-2.10.0]#
简单使用dfs
[root@VM]# hdfs dfs -ls /
[root@VM]# hdfs dfs -mkdir -p /user/michael/input
[root@VM]# hdfs dfs -put /etc/profile /user/michael/input/profile
[root@VM]# hdfs dfs -ls /user/michael/input
Found 1 items
-rw-r--r-- 1 root supergroup 1882 2019-12-08 22:02 /user/michael/input/profile
[root@VM]# hdfs dfs -cat /user/michael/input/profile
[root@VM]# hadoop jar /opt/module/hadoop-2.10.0/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.10.0.jar wordcount /user/michael/input /user/michael/output
配置yarn
配置/opt/module/hadoop-2.10.0/etc/hadoop/yarn-env.sh
export JAVA_HOME=/opt/module/jdk1.8.0_144
配置/opt/module/hadoop-2.10.0/etc/hadoop/yarn-site.xml
<configuration>
<property>
<name>yarn.nodemanager.aux-servicesname>
<value>mapreduce_shufflevalue>
property>
<property>
<name>yarn.resourcemanager.hostnamename>
<value>localhostvalue>
property>
configuration>
配置:/opt/module/hadoop-2.10.0/etc/hadoop/mapred-env.sh
export JAVA_HOME=/opt/module/jdk1.8.0_144
配置:/opt/module/hadoop-2.10.0/etc/hadoop/mapred-site.xml
<configuration>
<property>
<name>mapreduce.framework.namename>
<value>yarnvalue>
property>
configuration>
启动yarn
[root@VM_0_11_centos hadoop-2.10.0]# sbin/start-yarn.sh
starting yarn daemons
starting resourcemanager, logging to /opt/module/hadoop-2.10.0/logs/yarn-root-resourcemanager-VM_0_11_centos.out
localhost: starting nodemanager, logging to /opt/module/hadoop-2.10.0/logs/yarn-root-nodemanager-VM_0_11_centos.out
或者
[root@VM_0_11_centos hadoop-2.10.0]# sbin/yarn-daemon.sh start resourcemanager
[root@VM_0_11_centos hadoop-2.10.0]# sbin/yarn-daemon.sh start nodemanager
[root@VM_0_11_centos hadoop-2.10.0]# jps -l
4690 org.apache.hadoop.hdfs.server.namenode.NameNode
4806 org.apache.hadoop.hdfs.server.datanode.DataNode
5991 org.apache.hadoop.yarn.server.resourcemanager.ResourceManager
6458 sun.tools.jps.Jps
6093 org.apache.hadoop.yarn.server.nodemanager.NodeManager
5053 org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode
[root@VM_0_11_centos hadoop-2.10.0]#
YARN的Web界面默认端口号是8088
http://106.54.246.249:8088/cluster
[root@VM_0_11_centos hadoop-2.10.0]# bin/hdfs dfs -rm -R /user/michael/output
[root@VM_0_11_centos hadoop-2.10.0]# bin/hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.2.jar wordcount /user/michael/input /user/michael/output
[root@VM_0_11_centos hadoop-2.10.0]# bin/hdfs dfs -cat /user/michael/output
[root@VM_0_11_centos hadoop-2.10.0]# bin/hadoop fs -ls /
[root@VM_0_11_centos hadoop-2.10.0]#
[root@VM_0_11_centos hadoop-2.10.0]# bin/hadoop fs -ls /
[root@VM_0_11_centos hadoop-2.10.0]# bin/hadoop fs -mkdir /michael
[root@VM_0_11_centos hadoop-2.10.0]# vim /root/test/test01.txt
[root@VM_0_11_centos hadoop-2.10.0]# bin/hadoop fs -put /root/test/test01.txt /michael
[root@VM_0_11_centos hadoop-2.10.0]# bin/hadoop fs -ls /
Found 1 items
drwxr-xr-x - root supergroup 0 2019-12-05 22:04 /michael
[root@VM_0_11_centos hadoop-2.10.0]# bin/hadoop fs -ls /michael
Found 1 items
-rw-r--r-- 1 root supergroup 23 2019-12-05 22:04 /michael/test01.txt
[root@VM_0_11_centos hadoop-2.10.0]# bin/hadoop fs -ls /michael/test01.txt
-rw-r--r-- 1 root supergroup 23 2019-12-05 22:04 /michael/test01.txt
[root@VM_0_11_centos hadoop-2.10.0]# bin/hadoop fs -ls /michael/test01.txt1
[root@VM_0_11_centos hadoop-2.10.0]# bin/hadoop fs -rm /michael/test01.txt
Deleted /michael/test01.txt
[root@VM_0_11_centos hadoop-2.10.0]# bin/hadoop fs -cat /michael/test01.txt
cat: `/michael/test01.txt': No such file or directory
[root@VM_0_11_centos hadoop-2.10.0]# bin/hadoop fs -get /michael/test01.txt /
[root@VM_0_11_centos hadoop-2.10.0]# ll /test01.txt
-rw-r--r-- 1 root root 1309 Dec 5 22:23 /test01.txt