01_hadoop集群搭建

本文搭建了一个由四节点(master、slave1、slave2、slave3)构成的Hadoop完全分布式集群

虚拟机安装:VMWare

ip分配:

master内网IP:192.168.248.136
slave01内网IP:192.168.248.137
slave02内网IP:192.168.248.138
slave03内网IP:192.168.248.139

ssh免密登录

##创建hadoop用户
[root@localhost ~]# useradd -m hadoop
[root@localhost ~]# passwd hadoop
Changing password for user hadoop.
New password: 
BAD PASSWORD: The password is shorter than 8 characters
Retype new password: 
Sorry, passwords do not match.
New password: 
BAD PASSWORD: The password is shorter than 8 characters
Retype new password: ##123456
passwd: all authentication tokens updated successfully.

## 为hadoop添加sudo权限
[root@localhost ~]# vim /etc/sudoers
#在该行root ALL=(ALL) ALL下添加hadoop ALL=(ALL) ALL保存后退出,并切换回hadoop用户
[root@localhost ~]# su hadoop
[hadoop@localhost root]$
## 注意事项:四个节点的用户名必须相同,不然以后会对后面ssh及hadoop集群搭建产生巨大影响

##为了不直接使用IP,可以通过设置hosts文件达到ssh  slave1这样的的效果(四个节点设置相同)
192.168.248.136 master
192.168.248.137 slave01
192.168.248.138 slave02
192.168.248.139 slave03

#注意事项:不要在127.0.0.1后面添加主机名,如果加了master,会造成后面hadoop的一个很坑的问题,在slave节点应该解析出masterIP的时候解析出127.0.0.1,造成hadoop搭建完全正确,但是系统显示可用节点一直为0。

#修改hostname
#centos7默认的hostname是localhost,为了方便将每个节点hostname分别修改为master、slave01、slave02、slave03(以下以master节点为例)
[hadoop@localhost root]$ sudo hostnamectl set-hostname master
[hadoop@localhost root]$ hostname
master

#ssh设置
#设置master节点和两个slave节点之间的双向ssh免密通信

# 1. 首先生成master的rsa密钥
[hadoop@localhost root]$ ssh-keygen -t rsa 
Generating public/private rsa key pair.
Enter file in which to save the key (/home/hadoop/.ssh/id_rsa): 
Created directory '/home/hadoop/.ssh'.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/hadoop/.ssh/id_rsa.
Your public key has been saved in /home/hadoop/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:fX0pBEdHV++J+urYGSrz4MSdblBt8bXKqGyMPXDuoMU hadoop@master
The key's randomart image is:
+---[RSA 2048]----+
|           ..o.o+|
|           .o ..o|
|          . o.. o|
|         o o.o.oo|
|        S o +oooo|
|      oo...o.o.. |
|       EXo.o     |
|      =++X+ +    |
|     . .B*o=..   |
+----[SHA256]-----+

# 2. 将生成的rsa追加写入授权文件
[hadoop@localhost root]$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
# 3. 给授权文件权限
[hadoop@localhost root]$ chmod 600  ~/.ssh/authorized_keys

# 4. 进行本机ssh测试:$ssh maste r正常免密登陆后所有的ssh第一次都需要密码,此后都不需要密码
[hadoop@localhost root]$ ssh master
The authenticity of host 'master (192.168.248.136)' can't be established.
ECDSA key fingerprint is SHA256:OpsYYlUH+Uv1LebNZcfX5WGohmksEofsIN6IeAD5LIY.
ECDSA key fingerprint is MD5:41:e9:65:39:48:0c:5e:69:e5:a9:57:8c:20:a1:30:1a.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'master,192.168.248.136' (ECDSA) to the list of known hosts.
Last login: Sat Jun  8 20:49:39 2019
[hadoop@master ~]$

# 5. 将master上的authorized_keys传到slave01
[hadoop@localhost root]$ sudo scp ~/.ssh/id_rsa.pub hadoop@slave01:~/  
hadoop@slave01's password: 
id_rsa.pub

# 6. 登陆到slave1操作:$ssh slave1输入密码登陆  
[hadoop@localhost root]$ cat ~/id_rsa.pub >> ~/.ssh/authorized_keys
# 7. 修改authorized_keys权限
[hadoop@localhost root]$ chmod 600  ~/.ssh/authorized_keys

# 8.  在master 进行免密登录测试
[hadoop@localhost root]$ ssh slave01
Last login: Sat Jun  8 21:01:17 2019 from master

# 9.  同理对slave02、slave03操作

jdk的安装

[hadoop@localhost app]$ ls
jdk1.8.0_211  jdk-8u211-linux-x64.tar.gz

[hadoop@localhost app]$ vim ~/.bashrc
export JAVA_HOME=/usr/local/app/jdk1.8.0_211
export PATH=$PATH:$JAVA_HOME/bin

# 使环境变量生效:
[hadoop@localhost app]$ source ~/.bashrc

Hadoop的安装

##1. 目的:获得正确配置的完全分布式Hadoop集群(以下操作均在master主机下操作)
# 安装前所有节点都需要需要关闭防火墙和selinux
[hadoop@localhost app]$ sudo systemctl stop firewalld.service
[sudo] password for hadoop: 
[hadoop@localhost app]$ 
[hadoop@localhost app]$ sudo systemctl disable firewalld.service
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.

##2. 下载并上传hadoop
[hadoop@localhost app]$ ll
total 548284
drwxr-xr-x. 9  501 dialout       149 Nov 13  2018 hadoop-2.9.2
-rw-r--r--. 1 root root    366447449 Jun  8 20:49 hadoop-2.9.2.tar.gz
drwxr-xr-x. 7   10     143       245 Apr  2 11:51 jdk1.8.0_211
-rw-r--r--. 1 root root    194990602 Jun  8 01:12 jdk-8u211-linux-x64.tar.gz

## 注意事项:hadoop有32位和64位之分,官网默认二进制安装文件是32位的,但是本文操作系统是64位,会在后面hadoop集群使用中产生一个warning但是不影响正常操作。

hadoop的master节点的配置

配置hadoop的配置文件core-site.xml  hdfs-site.xml  mapred-site.xml  yarn-site.xml  slaves

配置文件的位置:

[hadoop@localhost hadoop]$ pwd
/usr/local/app/hadoop-2.9.2/etc/hadoop
[hadoop@localhost hadoop]$ ls
capacity-scheduler.xml      hadoop-policy.xml        kms-log4j.properties        ssl-client.xml.example
configuration.xsl           hdfs-site.xml            kms-site.xml                ssl-server.xml.example
container-executor.cfg      httpfs-env.sh            log4j.properties            yarn-env.cmd
core-site.xml               httpfs-log4j.properties  mapred-env.cmd              yarn-env.sh
hadoop-env.cmd              httpfs-signature.secret  mapred-env.sh               yarn-site.xml
hadoop-env.sh               httpfs-site.xml          mapred-queues.xml.template
hadoop-metrics2.properties  kms-acls.xml             mapred-site.xml.template
hadoop-metrics.properties   kms-env.sh               slaves

core-site.xml配置


  
    fs.default.name
    hdfs://master:9000
  
  
    hadoop.tmp.dir
    file:/home/hadoop/hadoop/tmp
  

hdfs-site.xml


  
    dfs.replication
    2
  
  
    dfs.namenode.name.dir
    file:/home/hadoop/hadoop/tmp/dfs/name
  
  
    dfs.datanode.data.dir
    file:/home/hadoop/hadoop/tmp/dfs/data
  
  
    dfs.namenode.secondary.http-address
    master:9001
  

mapred-site.xml


  
    mapreduce.framework.name
    yarn
  

yarn-site.xml


  
    yarn.resourcemanager.hostname
    master
  
  
    yarn.nodemanager.aux-services
    mapreduce_shuffle
  
  
    yarn.log-aggregation-enable
    true
  
  
    yarn.log-aggregation.retain-seconds
    604800
  

slaves

[hadoop@localhost hadoop]$ cat slaves 
slave01
slave02
slave03

复制hadoop到其他节点

https://www.cnblogs.com/pcxie/p/7747317.html

配置环境变量

配置环境变量,修改~/.bashrc文件,添加行(每个节点都需要此步操作,以master节点为例):

#hadoop environment vars
export HADOOP_HOME=/home/hadoop/hadoop
export HADOOP_INSTALL=$HADOOP_HOME
export HADOOP_MAPRED_HOME=$HADOOP_HOME
export HADOOP_COMMON_HOME=$HADOOP_HOME
export HADOOP_HDFS_HOME=$HADOOP_HOME
export YARN_HOME=$HADOOP_HOME
export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native
export PATH=$PATH:$HADOOP_HOME/sbin:$HADOOP_HOME/bin

格式化namenode:

[hadoop@master hadoop-2.9.2]$ hadoop namenode -format
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.

19/06/09 10:07:56 INFO namenode.NameNode: STARTUP_MSG: 
/************************************************************
STARTUP_MSG: Starting NameNode
STARTUP_MSG:   host = master/192.168.248.136
STARTUP_MSG:   args = [-format]
STARTUP_MSG:   version = 2.9.2
STARTUP_MSG:   classpath = /usr/local/app/hadoop-2.9.2/etc/hadoop:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/jaxb-impl-2.2.3-1.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/activation-1.1.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/woodstox-core-5.0.3.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/commons-configuration-1.6.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/commons-beanutils-1.7.0.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/xz-1.0.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/htrace-core4-4.1.0-incubating.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/junit-4.11.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/snappy-java-1.0.5.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/stax-api-1.0-2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/apacheds-i18n-2.0.0-M15.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/jaxb-api-2.2.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/mockito-all-1.8.5.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/slf4j-api-1.7.25.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/jackson-jaxrs-1.9.13.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/commons-logging-1.1.3.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/avro-1.7.7.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/curator-recipes-2.7.1.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/jetty-sslengine-6.1.26.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/jersey-json-1.9.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/log4j-1.2.17.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/commons-cli-1.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/commons-digester-1.8.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/servlet-api-2.5.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/protobuf-java-2.5.0.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/jcip-annotations-1.0-1.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/xmlenc-0.52.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/jackson-xc-1.9.13.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/jetty-util-6.1.26.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/httpclient-4.5.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/guava-11.0.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/commons-compress-1.4.1.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/commons-io-2.4.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/jackson-core-asl-1.9.13.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/stax2-api-3.1.4.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/jersey-core-1.9.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/jsp-api-2.1.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/commons-codec-1.4.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/netty-3.6.2.Final.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/jetty-6.1.26.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/commons-beanutils-core-1.8.0.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/jersey-server-1.9.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/java-xmlbuilder-0.4.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/paranamer-2.3.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/zookeeper-3.4.6.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/commons-collections-3.2.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/jettison-1.1.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/asm-3.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/api-asn1-api-1.0.0-M20.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/apacheds-kerberos-codec-2.0.0-M15.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/hamcrest-core-1.3.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/jsch-0.1.54.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/httpcore-4.4.4.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/json-smart-1.3.1.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/hadoop-annotations-2.9.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/api-util-1.0.0-M20.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/curator-framework-2.7.1.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/commons-net-3.1.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/gson-2.2.4.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/jets3t-0.9.0.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/commons-lang-2.6.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/jackson-mapper-asl-1.9.13.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/commons-math3-3.1.1.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/commons-lang3-3.4.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/jsr305-3.0.0.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/nimbus-jose-jwt-4.41.1.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/hadoop-auth-2.9.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/lib/curator-client-2.7.1.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/hadoop-common-2.9.2-tests.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/hadoop-common-2.9.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/common/hadoop-nfs-2.9.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/hdfs:/usr/local/app/hadoop-2.9.2/share/hadoop/hdfs/lib/htrace-core4-4.1.0-incubating.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/hdfs/lib/xercesImpl-2.9.1.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/hdfs/lib/commons-logging-1.1.3.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/hdfs/lib/jackson-annotations-2.7.8.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/hdfs/lib/log4j-1.2.17.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/hdfs/lib/commons-cli-1.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/hdfs/lib/xml-apis-1.3.04.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/hdfs/lib/servlet-api-2.5.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/hdfs/lib/protobuf-java-2.5.0.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/hdfs/lib/xmlenc-0.52.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/hdfs/lib/jetty-util-6.1.26.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/hdfs/lib/guava-11.0.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/hdfs/lib/okio-1.6.0.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/hdfs/lib/commons-io-2.4.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/hdfs/lib/jackson-core-asl-1.9.13.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/hdfs/lib/jersey-core-1.9.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/hdfs/lib/okhttp-2.7.5.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/hdfs/lib/commons-codec-1.4.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/hdfs/lib/netty-3.6.2.Final.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/hdfs/lib/jetty-6.1.26.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/hdfs/lib/jersey-server-1.9.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/hdfs/lib/asm-3.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/hdfs/lib/hadoop-hdfs-client-2.9.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/hdfs/lib/commons-lang-2.6.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/hdfs/lib/leveldbjni-all-1.8.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/hdfs/lib/jackson-databind-2.7.8.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/hdfs/lib/jackson-core-2.7.8.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/hdfs/lib/jackson-mapper-asl-1.9.13.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/hdfs/lib/netty-all-4.0.23.Final.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/hdfs/lib/commons-daemon-1.0.13.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/hdfs/lib/jsr305-3.0.0.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/hdfs/hadoop-hdfs-2.9.2-tests.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/hdfs/hadoop-hdfs-nfs-2.9.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/hdfs/hadoop-hdfs-rbf-2.9.2-tests.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/hdfs/hadoop-hdfs-rbf-2.9.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/hdfs/hadoop-hdfs-native-client-2.9.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/hdfs/hadoop-hdfs-client-2.9.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/hdfs/hadoop-hdfs-native-client-2.9.2-tests.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/hdfs/hadoop-hdfs-2.9.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/hdfs/hadoop-hdfs-client-2.9.2-tests.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/jaxb-impl-2.2.3-1.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/activation-1.1.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/woodstox-core-5.0.3.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/aopalliance-1.0.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/commons-configuration-1.6.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/commons-beanutils-1.7.0.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/guice-servlet-3.0.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/xz-1.0.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/htrace-core4-4.1.0-incubating.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/snappy-java-1.0.5.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/stax-api-1.0-2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/apacheds-i18n-2.0.0-M15.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/java-util-1.9.0.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/jaxb-api-2.2.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/jackson-jaxrs-1.9.13.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/commons-logging-1.1.3.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/avro-1.7.7.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/curator-recipes-2.7.1.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/jetty-sslengine-6.1.26.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/geronimo-jcache_1.0_spec-1.0-alpha-1.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/jersey-json-1.9.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/log4j-1.2.17.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/commons-cli-1.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/commons-digester-1.8.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/servlet-api-2.5.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/protobuf-java-2.5.0.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/jcip-annotations-1.0-1.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/xmlenc-0.52.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/jackson-xc-1.9.13.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/jetty-util-6.1.26.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/fst-2.50.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/httpclient-4.5.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/guava-11.0.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/mssql-jdbc-6.2.1.jre7.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/commons-compress-1.4.1.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/commons-io-2.4.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/jackson-core-asl-1.9.13.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/stax2-api-3.1.4.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/jersey-core-1.9.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/jsp-api-2.1.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/commons-codec-1.4.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/netty-3.6.2.Final.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/jetty-6.1.26.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/commons-beanutils-core-1.8.0.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/jersey-server-1.9.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/guice-3.0.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/java-xmlbuilder-0.4.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/metrics-core-3.0.1.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/jersey-client-1.9.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/jersey-guice-1.9.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/paranamer-2.3.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/zookeeper-3.4.6.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/commons-collections-3.2.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/jettison-1.1.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/asm-3.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/api-asn1-api-1.0.0-M20.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/apacheds-kerberos-codec-2.0.0-M15.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/jsch-0.1.54.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/httpcore-4.4.4.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/ehcache-3.3.1.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/json-smart-1.3.1.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/api-util-1.0.0-M20.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/curator-framework-2.7.1.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/commons-net-3.1.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/gson-2.2.4.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/jets3t-0.9.0.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/commons-lang-2.6.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/HikariCP-java7-2.4.12.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/json-io-2.5.1.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/leveldbjni-all-1.8.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/jackson-mapper-asl-1.9.13.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/commons-math3-3.1.1.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/commons-lang3-3.4.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/javax.inject-1.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/jsr305-3.0.0.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/nimbus-jose-jwt-4.41.1.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/lib/curator-client-2.7.1.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/hadoop-yarn-server-timeline-pluginstorage-2.9.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/hadoop-yarn-applications-distributedshell-2.9.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/hadoop-yarn-registry-2.9.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/hadoop-yarn-server-sharedcachemanager-2.9.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/hadoop-yarn-applications-unmanaged-am-launcher-2.9.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/hadoop-yarn-server-applicationhistoryservice-2.9.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/hadoop-yarn-server-tests-2.9.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/hadoop-yarn-api-2.9.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/hadoop-yarn-common-2.9.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/hadoop-yarn-server-web-proxy-2.9.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/hadoop-yarn-server-nodemanager-2.9.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/hadoop-yarn-server-resourcemanager-2.9.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/hadoop-yarn-server-common-2.9.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/hadoop-yarn-server-router-2.9.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/yarn/hadoop-yarn-client-2.9.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/mapreduce/lib/aopalliance-1.0.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/mapreduce/lib/guice-servlet-3.0.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/mapreduce/lib/xz-1.0.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/mapreduce/lib/junit-4.11.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/mapreduce/lib/snappy-java-1.0.5.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/mapreduce/lib/avro-1.7.7.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/mapreduce/lib/log4j-1.2.17.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/mapreduce/lib/protobuf-java-2.5.0.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/mapreduce/lib/commons-compress-1.4.1.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/mapreduce/lib/commons-io-2.4.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/mapreduce/lib/jackson-core-asl-1.9.13.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/mapreduce/lib/jersey-core-1.9.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/mapreduce/lib/netty-3.6.2.Final.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/mapreduce/lib/jersey-server-1.9.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/mapreduce/lib/guice-3.0.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/mapreduce/lib/jersey-guice-1.9.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/mapreduce/lib/paranamer-2.3.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/mapreduce/lib/asm-3.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/mapreduce/lib/hamcrest-core-1.3.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/mapreduce/lib/hadoop-annotations-2.9.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/mapreduce/lib/leveldbjni-all-1.8.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/mapreduce/lib/jackson-mapper-asl-1.9.13.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/mapreduce/lib/javax.inject-1.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/mapreduce/hadoop-mapreduce-client-app-2.9.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/mapreduce/hadoop-mapreduce-client-hs-plugins-2.9.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/mapreduce/hadoop-mapreduce-client-hs-2.9.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.9.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/mapreduce/hadoop-mapreduce-client-core-2.9.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/mapreduce/hadoop-mapreduce-client-shuffle-2.9.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/mapreduce/hadoop-mapreduce-client-common-2.9.2.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/mapreduce/hadoop-mapreduce-client-jobclient-2.9.2-tests.jar:/usr/local/app/hadoop-2.9.2/share/hadoop/mapreduce/hadoop-mapreduce-client-jobclient-2.9.2.jar:/usr/local/app/hadoop-2.9.2/contrib/capacity-scheduler/*.jar:/usr/local/app/hadoop-2.9.2/contrib/capacity-scheduler/*.jar
STARTUP_MSG:   build = https://git-wip-us.apache.org/repos/asf/hadoop.git -r 826afbeae31ca687bc2f8471dc841b66ed2c6704; compiled by 'ajisaka' on 2018-11-13T12:42Z
STARTUP_MSG:   java = 1.8.0_211
************************************************************/
19/06/09 10:07:56 INFO namenode.NameNode: registered UNIX signal handlers for [TERM, HUP, INT]
19/06/09 10:07:56 INFO namenode.NameNode: createNameNode [-format]
19/06/09 10:07:56 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Formatting using clusterid: CID-da015fb7-3abe-4065-8db3-21d1e73fcb6e
19/06/09 10:07:57 INFO namenode.FSEditLog: Edit logging is async:true
19/06/09 10:07:57 INFO namenode.FSNamesystem: KeyProvider: null
19/06/09 10:07:57 INFO namenode.FSNamesystem: fsLock is fair: true
19/06/09 10:07:57 INFO namenode.FSNamesystem: Detailed lock hold time metrics enabled: false
19/06/09 10:07:57 INFO namenode.FSNamesystem: fsOwner             = hadoop (auth:SIMPLE)
19/06/09 10:07:57 INFO namenode.FSNamesystem: supergroup          = supergroup
19/06/09 10:07:57 INFO namenode.FSNamesystem: isPermissionEnabled = true
19/06/09 10:07:57 INFO namenode.FSNamesystem: HA Enabled: false
19/06/09 10:07:57 INFO common.Util: dfs.datanode.fileio.profiling.sampling.percentage set to 0. Disabling file IO profiling
19/06/09 10:07:57 INFO blockmanagement.DatanodeManager: dfs.block.invalidate.limit: configured=1000, counted=60, effected=1000
19/06/09 10:07:57 INFO blockmanagement.DatanodeManager: dfs.namenode.datanode.registration.ip-hostname-check=true
19/06/09 10:07:57 INFO blockmanagement.BlockManager: dfs.namenode.startup.delay.block.deletion.sec is set to 000:00:00:00.000
19/06/09 10:07:57 INFO blockmanagement.BlockManager: The block deletion will start around 2019 Jun 09 10:07:57
19/06/09 10:07:57 INFO util.GSet: Computing capacity for map BlocksMap
19/06/09 10:07:57 INFO util.GSet: VM type       = 64-bit
19/06/09 10:07:57 INFO util.GSet: 2.0% max memory 966.7 MB = 19.3 MB
19/06/09 10:07:57 INFO util.GSet: capacity      = 2^21 = 2097152 entries
19/06/09 10:07:57 INFO blockmanagement.BlockManager: dfs.block.access.token.enable=false
19/06/09 10:07:57 WARN conf.Configuration: No unit for dfs.heartbeat.interval(3) assuming SECONDS
19/06/09 10:07:57 WARN conf.Configuration: No unit for dfs.namenode.safemode.extension(30000) assuming MILLISECONDS
19/06/09 10:07:57 INFO blockmanagement.BlockManagerSafeMode: dfs.namenode.safemode.threshold-pct = 0.9990000128746033
19/06/09 10:07:57 INFO blockmanagement.BlockManagerSafeMode: dfs.namenode.safemode.min.datanodes = 0
19/06/09 10:07:57 INFO blockmanagement.BlockManagerSafeMode: dfs.namenode.safemode.extension = 30000
19/06/09 10:07:57 INFO blockmanagement.BlockManager: defaultReplication         = 2
19/06/09 10:07:57 INFO blockmanagement.BlockManager: maxReplication             = 512
19/06/09 10:07:57 INFO blockmanagement.BlockManager: minReplication             = 1
19/06/09 10:07:57 INFO blockmanagement.BlockManager: maxReplicationStreams      = 2
19/06/09 10:07:57 INFO blockmanagement.BlockManager: replicationRecheckInterval = 3000
19/06/09 10:07:57 INFO blockmanagement.BlockManager: encryptDataTransfer        = false
19/06/09 10:07:57 INFO blockmanagement.BlockManager: maxNumBlocksToLog          = 1000
19/06/09 10:07:57 INFO namenode.FSNamesystem: Append Enabled: true
19/06/09 10:07:58 INFO namenode.FSDirectory: GLOBAL serial map: bits=24 maxEntries=16777215
19/06/09 10:07:58 INFO util.GSet: Computing capacity for map INodeMap
19/06/09 10:07:58 INFO util.GSet: VM type       = 64-bit
19/06/09 10:07:58 INFO util.GSet: 1.0% max memory 966.7 MB = 9.7 MB
19/06/09 10:07:58 INFO util.GSet: capacity      = 2^20 = 1048576 entries
19/06/09 10:07:58 INFO namenode.FSDirectory: ACLs enabled? false
19/06/09 10:07:58 INFO namenode.FSDirectory: XAttrs enabled? true
19/06/09 10:07:58 INFO namenode.NameNode: Caching file names occurring more than 10 times
19/06/09 10:07:58 INFO snapshot.SnapshotManager: Loaded config captureOpenFiles: falseskipCaptureAccessTimeOnlyChange: false
19/06/09 10:07:58 INFO util.GSet: Computing capacity for map cachedBlocks
19/06/09 10:07:58 INFO util.GSet: VM type       = 64-bit
19/06/09 10:07:58 INFO util.GSet: 0.25% max memory 966.7 MB = 2.4 MB
19/06/09 10:07:58 INFO util.GSet: capacity      = 2^18 = 262144 entries
19/06/09 10:07:58 INFO metrics.TopMetrics: NNTop conf: dfs.namenode.top.window.num.buckets = 10
19/06/09 10:07:58 INFO metrics.TopMetrics: NNTop conf: dfs.namenode.top.num.users = 10
19/06/09 10:07:58 INFO metrics.TopMetrics: NNTop conf: dfs.namenode.top.windows.minutes = 1,5,25
19/06/09 10:07:58 INFO namenode.FSNamesystem: Retry cache on namenode is enabled
19/06/09 10:07:58 INFO namenode.FSNamesystem: Retry cache will use 0.03 of total heap and retry cache entry expiry time is 600000 millis
19/06/09 10:07:58 INFO util.GSet: Computing capacity for map NameNodeRetryCache
19/06/09 10:07:58 INFO util.GSet: VM type       = 64-bit
19/06/09 10:07:58 INFO util.GSet: 0.029999999329447746% max memory 966.7 MB = 297.0 KB
19/06/09 10:07:58 INFO util.GSet: capacity      = 2^15 = 32768 entries
19/06/09 10:07:58 INFO namenode.FSImage: Allocated new BlockPoolId: BP-1687626419-192.168.248.136-1560046078739
19/06/09 10:07:58 INFO common.Storage: Storage directory /home/hadoop/hadoop/tmp/dfs/name has been successfully formatted.
19/06/09 10:07:58 INFO namenode.FSImageFormatProtobuf: Saving image file /home/hadoop/hadoop/tmp/dfs/name/current/fsimage.ckpt_0000000000000000000 using no compression
19/06/09 10:07:58 INFO namenode.FSImageFormatProtobuf: Image file /home/hadoop/hadoop/tmp/dfs/name/current/fsimage.ckpt_0000000000000000000 of size 325 bytes saved in 0 seconds .
19/06/09 10:07:58 INFO namenode.NNStorageRetentionManager: Going to retain 1 images with txid >= 0
19/06/09 10:07:58 INFO namenode.NameNode: SHUTDOWN_MSG: 
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at master/192.168.248.136
************************************************************/

启动:

[hadoop@master sbin]$ ./start-dfs.sh 
19/06/09 10:13:45 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Starting namenodes on [master]
master: starting namenode, logging to /usr/local/app/hadoop-2.9.2/logs/hadoop-hadoop-namenode-master.out
slave01: starting datanode, logging to /usr/local/app/hadoop-2.9.2/logs/hadoop-hadoop-datanode-slave01.out
slave03: starting datanode, logging to /usr/local/app/hadoop-2.9.2/logs/hadoop-hadoop-datanode-slave03.out
slave02: starting datanode, logging to /usr/local/app/hadoop-2.9.2/logs/hadoop-hadoop-datanode-slave02.out
Starting secondary namenodes [master]
master: starting secondarynamenode, logging to /usr/local/app/hadoop-2.9.2/logs/hadoop-hadoop-secondarynamenode-master.out
19/06/09 10:14:06 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
[hadoop@master sbin]$ ./start-yarn.sh 
starting yarn daemons
starting resourcemanager, logging to /usr/local/app/hadoop-2.9.2/logs/yarn-hadoop-resourcemanager-master.out
slave03: starting nodemanager, logging to /usr/local/app/hadoop-2.9.2/logs/yarn-hadoop-nodemanager-slave03.out
slave01: starting nodemanager, logging to /usr/local/app/hadoop-2.9.2/logs/yarn-hadoop-nodemanager-slave01.out
slave02: starting nodemanager, logging to /usr/local/app/hadoop-2.9.2/logs/yarn-hadoop-nodemanager-slave02.out
[hadoop@master sbin]$ jps
8449 SecondaryNameNode
8612 ResourceManager
8759 Jps
8255 NameNode

Web浏览器输入ip:50070,查看管理界面

你可能感兴趣的:(01_hadoop集群搭建)