3 Hadoop集群部署
3.1 部署环境
boco201,192.168.100.201,CentOS8
boco202,192.168.100.201,CentOS8
boco203,192.168.100.201,CentOS8
3.2 软件安装
1、各主机新增hadoop用户,useradd hadoop;passwd hadoop
2、各主机修改,vi /etc/sudoers,增加:
xiaozhanfeng ALL=(ALL) ALL
hadoop ALL=(ALL) ALL
3、各主机设置hadoop用户ssh免密钥
su - hadoop
ssh-keygen -t rsa;ssh-copy-id boco201;ssh-copy-id boco202;ssh-copy-id boco203
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:5i18E9JbGcCg7iMxvnwS+x9KmAb4UFnQDU4gpkZDptw hadoop@boco203
The key's randomart image is:
+---[RSA 3072]----+
|o*o++o .o. |
|B.o=. .. .. |
|oooE. . . |
|.o . . o |
|o . o . S o o |
| o o.* + o + |
| . *o+ = = |
| oo+.o + . |
| o+o.. |
+----[SHA256]-----+
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/hadoop/.ssh/id_rsa.pub"
The authenticity of host 'boco201 (192.168.100.201)' can't be established.
ECDSA key fingerprint is SHA256:TUEy5x3KSulBEm3yJUhyVvZpH7PWzvkZNLCcB8giP6A.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
hadoop@boco201's password:
Number of key(s) added: 1
Now try logging into the machine, with: "ssh 'boco201'"
and check to make sure that only the key(s) you wanted were added.
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/hadoop/.ssh/id_rsa.pub"
The authenticity of host 'boco202 (192.168.100.202)' can't be established.
ECDSA key fingerprint is SHA256:TUEy5x3KSulBEm3yJUhyVvZpH7PWzvkZNLCcB8giP6A.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
hadoop@boco202's password:
Number of key(s) added: 1
Now try logging into the machine, with: "ssh 'boco202'"
and check to make sure that only the key(s) you wanted were added.
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/hadoop/.ssh/id_rsa.pub"
The authenticity of host 'boco203 (::1)' can't be established.
ECDSA key fingerprint is SHA256:TUEy5x3KSulBEm3yJUhyVvZpH7PWzvkZNLCcB8giP6A.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
hadoop@boco203's password:
Number of key(s) added: 1
Now try logging into the machine, with: "ssh 'boco203'"
and check to make sure that only the key(s) you wanted were added.
4、下载安装包
wget https://mirrors.tuna.tsinghua.edu.cn/apache/hadoop/common/hadoop-2.10.1/hadoop-2.10.1.tar.gz
wget https://mirrors.bfsu.edu.cn/apache/hadoop/common/hadoop-2.10.1/hadoop-2.10.1.tar.gz
5、解压安装
tar -zxvf hadoop-2.10.1.tar.gz -C /opt/hadoop-2.10.1/
3.3 集群配置
3.3.1 配置文件路径
/opt/hadoop-2.10.1/etc/hadoop
3.3.2 core-site.xml
<configuration>
<!-- 指定HDFS中NameNode的地址 -->
<property>
<name>fs.defaultFS</name>
<value>hdfs://boco201:9000</value>
</property>
<!-- 指定hadoop运行时产生文件的存储目录 -->
<property>
<name>hadoop.tmp.dir</name>
<value>/data/hadoop</value>
</property>
</configuration>
scp core-site.xml hadoop@boco202:/opt/hadoop-2.10.1/etc/hadoop/
scp core-site.xml hadoop@boco203:/opt/hadoop-2.10.1/etc/hadoop/
3.3.3 hadoop-env.sh
添加:export JAVA_HOME=/usr/java/jdk1.8.0_271
scp hadoop-env.sh hadoop@boco202:/opt/hadoop-2.10.1/etc/hadoop/
scp hadoop-env.sh hadoop@boco203:/opt/hadoop-2.10.1/etc/hadoop/
3.3.4 hdfs-site.xml
<configuration>
<!-- 设置dfs副本数,不设置默认是3个 -->
<property>
<name>dfs.replication</name>
<value>2</value>
</property>
<!-- 设置secondname的端口 -->
<property>
<name>dfs.namenode.secondary.http-address</name>
<value>boco202:50090</value>
</property>
</configuration>
scp hdfs-site.xml hadoop@boco202:/opt/hadoop-2.10.1/etc/hadoop/
scp hdfs-site.xml hadoop@boco203:/opt/hadoop-2.10.1/etc/hadoop/
3.3.5 slaves
boco201
boco202
boco203
scp slaves hadoop@boco202:/opt/hadoop-2.10.1/etc/hadoop/
scp slaves hadoop@boco203:/opt/hadoop-2.10.1/etc/hadoop/
3.3.6 mapred-env.sh
添加:export JAVA_HOME=/usr/java/jdk1.8.0_271
scp mapred-env.sh hadoop@boco202:/opt/hadoop-2.10.1/etc/hadoop/
scp mapred-env.sh hadoop@boco203:/opt/hadoop-2.10.1/etc/hadoop/
3.3.7 mapred-site.xml
mv mapred-site.xml.template mapred-site.xml
vi mapred-site.xml
<configuration>
<!-- 指定mr运行在yarn上 -->
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
</configuration>
3.3.8 yarn-env.sh
添加:export JAVA_HOME=/usr/java/jdk1.8.0_271
scp yarn-env.sh hadoop@boco202:/opt/hadoop-2.10.1/etc/hadoop/
scp yarn-env.sh hadoop@boco203:/opt/hadoop-2.10.1/etc/hadoop/
3.3.9 yarn-site.xml
<configuration>
<!-- Site specific YARN configuration properties -->
<!-- reducer获取数据的方式 -->
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
<!-- 指定YARN的ResourceManager的地址 -->
<property>
<name>yarn.resourcemanager.hostname</name>
<value>boco202</value>
</property>
</configuration>
scp yarn-site.xml hadoop@boco202:/opt/hadoop-2.10.1/etc/hadoop/
scp yarn-site.xml hadoop@boco203:/opt/hadoop-2.10.1/etc/hadoop/
3.3.10 /etc/profile
export HADOOP_HOME=/opt/hadoop-2.10.1
export PATH=$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin
3.4 集群启动
3.4.1 格式化namenode
使用hadoop用户进行操作,后续操作同样要求
如果集群是第一次启动,需要格式化namenode
hdfs namenode -format
20/12/07 20:19:01 INFO namenode.NameNode: STARTUP_MSG:
/************************************************************
STARTUP_MSG: Starting NameNode
STARTUP_MSG: host = boco201/127.0.0.1
STARTUP_MSG: args = [-format]
STARTUP_MSG: version = 2.10.1
STARTUP_MSG: classpath = /opt/hadoop-2.10.1/etc/hadoop:/opt/hadoop-2.10.1/share/hadoop/common/lib/commons-collections-3.2.2.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/servlet-api-2.5.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/jetty-6.1.26.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/jetty-util-6.1.26.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/jetty-sslengine-6.1.26.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/jsp-api-2.1.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/jersey-core-1.9.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/jersey-json-1.9.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/jettison-1.1.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/jaxb-impl-2.2.3-1.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/jaxb-api-2.2.2.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/stax-api-1.0-2.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/activation-1.1.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/jackson-core-asl-1.9.13.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/jackson-mapper-asl-1.9.13.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/jackson-jaxrs-1.9.13.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/jackson-xc-1.9.13.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/jersey-server-1.9.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/asm-3.2.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/log4j-1.2.17.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/jets3t-0.9.0.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/java-xmlbuilder-0.4.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/commons-lang-2.6.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/commons-configuration-1.6.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/commons-digester-1.8.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/commons-beanutils-1.9.4.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/commons-lang3-3.4.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/slf4j-api-1.7.25.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/avro-1.7.7.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/paranamer-2.3.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/snappy-java-1.0.5.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/commons-compress-1.19.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/protobuf-java-2.5.0.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/gson-2.2.4.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/hadoop-auth-2.10.1.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/nimbus-jose-jwt-7.9.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/jcip-annotations-1.0-1.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/json-smart-1.3.1.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/apacheds-kerberos-codec-2.0.0-M15.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/apacheds-i18n-2.0.0-M15.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/api-asn1-api-1.0.0-M20.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/api-util-1.0.0-M20.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/zookeeper-3.4.14.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/spotbugs-annotations-3.1.9.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/audience-annotations-0.5.0.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/netty-3.10.6.Final.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/curator-framework-2.13.0.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/curator-client-2.13.0.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/jsch-0.1.55.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/curator-recipes-2.13.0.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/htrace-core4-4.1.0-incubating.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/stax2-api-3.1.4.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/woodstox-core-5.0.3.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/junit-4.11.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/hamcrest-core-1.3.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/mockito-all-1.8.5.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/hadoop-annotations-2.10.1.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/guava-11.0.2.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/jsr305-3.0.2.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/commons-cli-1.2.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/commons-math3-3.1.1.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/xmlenc-0.52.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/httpclient-4.5.2.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/httpcore-4.4.4.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/commons-logging-1.1.3.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/commons-codec-1.4.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/commons-io-2.4.jar:/opt/hadoop-2.10.1/share/hadoop/common/lib/commons-net-3.1.jar:/opt/hadoop-2.10.1/share/hadoop/common/hadoop-common-2.10.1.jar:/opt/hadoop-2.10.1/share/hadoop/common/hadoop-common-2.10.1-tests.jar:/opt/hadoop-2.10.1/share/hadoop/common/hadoop-nfs-2.10.1.jar:/opt/hadoop-2.10.1/share/hadoop/hdfs:/opt/hadoop-2.10.1/share/hadoop/hdfs/lib/commons-codec-1.4.jar:/opt/hadoop-2.10.1/share/hadoop/hdfs/lib/log4j-1.2.17.jar:/opt/hadoop-2.10.1/share/hadoop/hdfs/lib/commons-logging-1.1.3.jar:/opt/hadoop-2.10.1/share/hadoop/hdfs/lib/jsr305-3.0.2.jar:/opt/hadoop-2.10.1/share/hadoop/hdfs/lib/netty-3.10.6.Final.jar:/opt/hadoop-2.10.1/share/hadoop/hdfs/lib/guava-11.0.2.jar:/opt/hadoop-2.10.1/share/hadoop/hdfs/lib/commons-cli-1.2.jar:/opt/hadoop-2.10.1/share/hadoop/hdfs/lib/xmlenc-0.52.jar:/opt/hadoop-2.10.1/share/hadoop/hdfs/lib/commons-io-2.4.jar:/opt/hadoop-2.10.1/share/hadoop/hdfs/lib/servlet-api-2.5.jar:/opt/hadoop-2.10.1/share/hadoop/hdfs/lib/jetty-6.1.26.jar:/opt/hadoop-2.10.1/share/hadoop/hdfs/lib/jetty-util-6.1.26.jar:/opt/hadoop-2.10.1/share/hadoop/hdfs/lib/jersey-core-1.9.jar:/opt/hadoop-2.10.1/share/hadoop/hdfs/lib/jackson-core-asl-1.9.13.jar:/opt/hadoop-2.10.1/share/hadoop/hdfs/lib/jackson-mapper-asl-1.9.13.jar:/opt/hadoop-2.10.1/share/hadoop/hdfs/lib/jersey-server-1.9.jar:/opt/hadoop-2.10.1/share/hadoop/hdfs/lib/asm-3.2.jar:/opt/hadoop-2.10.1/share/hadoop/hdfs/lib/commons-lang-2.6.jar:/opt/hadoop-2.10.1/share/hadoop/hdfs/lib/protobuf-java-2.5.0.jar:/opt/hadoop-2.10.1/share/hadoop/hdfs/lib/htrace-core4-4.1.0-incubating.jar:/opt/hadoop-2.10.1/share/hadoop/hdfs/lib/hadoop-hdfs-client-2.10.1.jar:/opt/hadoop-2.10.1/share/hadoop/hdfs/lib/okhttp-2.7.5.jar:/opt/hadoop-2.10.1/share/hadoop/hdfs/lib/okio-1.6.0.jar:/opt/hadoop-2.10.1/share/hadoop/hdfs/lib/commons-daemon-1.0.13.jar:/opt/hadoop-2.10.1/share/hadoop/hdfs/lib/netty-all-4.1.50.Final.jar:/opt/hadoop-2.10.1/share/hadoop/hdfs/lib/xercesImpl-2.12.0.jar:/opt/hadoop-2.10.1/share/hadoop/hdfs/lib/xml-apis-1.4.01.jar:/opt/hadoop-2.10.1/share/hadoop/hdfs/lib/leveldbjni-all-1.8.jar:/opt/hadoop-2.10.1/share/hadoop/hdfs/lib/jackson-databind-2.9.10.6.jar:/opt/hadoop-2.10.1/share/hadoop/hdfs/lib/jackson-annotations-2.9.10.jar:/opt/hadoop-2.10.1/share/hadoop/hdfs/lib/jackson-core-2.9.10.jar:/opt/hadoop-2.10.1/share/hadoop/hdfs/hadoop-hdfs-2.10.1.jar:/opt/hadoop-2.10.1/share/hadoop/hdfs/hadoop-hdfs-2.10.1-tests.jar:/opt/hadoop-2.10.1/share/hadoop/hdfs/hadoop-hdfs-client-2.10.1.jar:/opt/hadoop-2.10.1/share/hadoop/hdfs/hadoop-hdfs-client-2.10.1-tests.jar:/opt/hadoop-2.10.1/share/hadoop/hdfs/hadoop-hdfs-native-client-2.10.1.jar:/opt/hadoop-2.10.1/share/hadoop/hdfs/hadoop-hdfs-native-client-2.10.1-tests.jar:/opt/hadoop-2.10.1/share/hadoop/hdfs/hadoop-hdfs-rbf-2.10.1.jar:/opt/hadoop-2.10.1/share/hadoop/hdfs/hadoop-hdfs-rbf-2.10.1-tests.jar:/opt/hadoop-2.10.1/share/hadoop/hdfs/hadoop-hdfs-nfs-2.10.1.jar:/opt/hadoop-2.10.1/share/hadoop/yarn:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/commons-cli-1.2.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/log4j-1.2.17.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/commons-compress-1.19.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/servlet-api-2.5.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/commons-codec-1.4.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/jetty-util-6.1.26.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/jersey-core-1.9.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/jersey-client-1.9.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/jackson-core-asl-1.9.13.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/jackson-mapper-asl-1.9.13.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/jackson-jaxrs-1.9.13.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/jackson-xc-1.9.13.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/guice-servlet-3.0.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/guice-3.0.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/javax.inject-1.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/aopalliance-1.0.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/commons-io-2.4.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/jersey-server-1.9.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/asm-3.2.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/jersey-json-1.9.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/jettison-1.1.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/jaxb-impl-2.2.3-1.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/jersey-guice-1.9.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/commons-math3-3.1.1.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/xmlenc-0.52.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/httpclient-4.5.2.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/httpcore-4.4.4.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/commons-net-3.1.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/commons-collections-3.2.2.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/jetty-6.1.26.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/jetty-sslengine-6.1.26.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/jsp-api-2.1.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/jets3t-0.9.0.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/java-xmlbuilder-0.4.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/commons-configuration-1.6.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/commons-digester-1.8.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/commons-beanutils-1.9.4.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/commons-lang3-3.4.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/avro-1.7.7.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/paranamer-2.3.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/snappy-java-1.0.5.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/gson-2.2.4.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/nimbus-jose-jwt-7.9.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/jcip-annotations-1.0-1.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/json-smart-1.3.1.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/apacheds-kerberos-codec-2.0.0-M15.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/apacheds-i18n-2.0.0-M15.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/api-asn1-api-1.0.0-M20.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/api-util-1.0.0-M20.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/zookeeper-3.4.14.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/spotbugs-annotations-3.1.9.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/audience-annotations-0.5.0.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/netty-3.10.6.Final.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/curator-framework-2.13.0.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/curator-client-2.13.0.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/jsch-0.1.55.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/curator-recipes-2.13.0.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/htrace-core4-4.1.0-incubating.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/stax2-api-3.1.4.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/woodstox-core-5.0.3.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/leveldbjni-all-1.8.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/geronimo-jcache_1.0_spec-1.0-alpha-1.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/ehcache-3.3.1.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/HikariCP-java7-2.4.12.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/mssql-jdbc-6.2.1.jre7.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/metrics-core-3.0.1.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/fst-2.50.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/java-util-1.9.0.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/json-io-2.5.1.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/commons-lang-2.6.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/guava-11.0.2.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/jsr305-3.0.2.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/commons-logging-1.1.3.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/jaxb-api-2.2.2.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/stax-api-1.0-2.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/activation-1.1.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/protobuf-java-2.5.0.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/hadoop-yarn-api-2.10.1.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/hadoop-yarn-common-2.10.1.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/hadoop-yarn-registry-2.10.1.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/hadoop-yarn-server-common-2.10.1.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/hadoop-yarn-server-nodemanager-2.10.1.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/hadoop-yarn-server-web-proxy-2.10.1.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/hadoop-yarn-server-applicationhistoryservice-2.10.1.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/hadoop-yarn-server-resourcemanager-2.10.1.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/hadoop-yarn-server-tests-2.10.1.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/hadoop-yarn-client-2.10.1.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/hadoop-yarn-server-sharedcachemanager-2.10.1.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/hadoop-yarn-server-timeline-pluginstorage-2.10.1.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/hadoop-yarn-server-router-2.10.1.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/hadoop-yarn-applications-distributedshell-2.10.1.jar:/opt/hadoop-2.10.1/share/hadoop/yarn/hadoop-yarn-applications-unmanaged-am-launcher-2.10.1.jar:/opt/hadoop-2.10.1/share/hadoop/mapreduce/lib/protobuf-java-2.5.0.jar:/opt/hadoop-2.10.1/share/hadoop/mapreduce/lib/avro-1.7.7.jar:/opt/hadoop-2.10.1/share/hadoop/mapreduce/lib/jackson-core-asl-1.9.13.jar:/opt/hadoop-2.10.1/share/hadoop/mapreduce/lib/jackson-mapper-asl-1.9.13.jar:/opt/hadoop-2.10.1/share/hadoop/mapreduce/lib/paranamer-2.3.jar:/opt/hadoop-2.10.1/share/hadoop/mapreduce/lib/snappy-java-1.0.5.jar:/opt/hadoop-2.10.1/share/hadoop/mapreduce/lib/commons-compress-1.19.jar:/opt/hadoop-2.10.1/share/hadoop/mapreduce/lib/hadoop-annotations-2.10.1.jar:/opt/hadoop-2.10.1/share/hadoop/mapreduce/lib/commons-io-2.4.jar:/opt/hadoop-2.10.1/share/hadoop/mapreduce/lib/jersey-core-1.9.jar:/opt/hadoop-2.10.1/share/hadoop/mapreduce/lib/jersey-server-1.9.jar:/opt/hadoop-2.10.1/share/hadoop/mapreduce/lib/asm-3.2.jar:/opt/hadoop-2.10.1/share/hadoop/mapreduce/lib/log4j-1.2.17.jar:/opt/hadoop-2.10.1/share/hadoop/mapreduce/lib/netty-3.10.6.Final.jar:/opt/hadoop-2.10.1/share/hadoop/mapreduce/lib/leveldbjni-all-1.8.jar:/opt/hadoop-2.10.1/share/hadoop/mapreduce/lib/guice-3.0.jar:/opt/hadoop-2.10.1/share/hadoop/mapreduce/lib/javax.inject-1.jar:/opt/hadoop-2.10.1/share/hadoop/mapreduce/lib/aopalliance-1.0.jar:/opt/hadoop-2.10.1/share/hadoop/mapreduce/lib/jersey-guice-1.9.jar:/opt/hadoop-2.10.1/share/hadoop/mapreduce/lib/guice-servlet-3.0.jar:/opt/hadoop-2.10.1/share/hadoop/mapreduce/lib/junit-4.11.jar:/opt/hadoop-2.10.1/share/hadoop/mapreduce/lib/hamcrest-core-1.3.jar:/opt/hadoop-2.10.1/share/hadoop/mapreduce/hadoop-mapreduce-client-core-2.10.1.jar:/opt/hadoop-2.10.1/share/hadoop/mapreduce/hadoop-mapreduce-client-common-2.10.1.jar:/opt/hadoop-2.10.1/share/hadoop/mapreduce/hadoop-mapreduce-client-shuffle-2.10.1.jar:/opt/hadoop-2.10.1/share/hadoop/mapreduce/hadoop-mapreduce-client-app-2.10.1.jar:/opt/hadoop-2.10.1/share/hadoop/mapreduce/hadoop-mapreduce-client-hs-2.10.1.jar:/opt/hadoop-2.10.1/share/hadoop/mapreduce/hadoop-mapreduce-client-jobclient-2.10.1.jar:/opt/hadoop-2.10.1/share/hadoop/mapreduce/hadoop-mapreduce-client-hs-plugins-2.10.1.jar:/opt/hadoop-2.10.1/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.10.1.jar:/opt/hadoop-2.10.1/share/hadoop/mapreduce/hadoop-mapreduce-client-jobclient-2.10.1-tests.jar:/opt/hadoop-2.10.1/contrib/capacity-scheduler/*.jar
STARTUP_MSG: build = https://github.com/apache/hadoop -r 1827467c9a56f133025f28557bfc2c562d78e816; compiled by 'centos' on 2020-09-14T13:17Z
STARTUP_MSG: java = 1.8.0_272
************************************************************/
20/12/07 20:19:01 INFO namenode.NameNode: registered UNIX signal handlers for [TERM, HUP, INT]
20/12/07 20:19:02 INFO namenode.NameNode: createNameNode [-format]
Formatting using clusterid: CID-c51102af-9748-42e2-8f19-ec160ca5ed8a
20/12/07 20:19:12 INFO namenode.FSEditLog: Edit logging is async:true
20/12/07 20:19:12 INFO namenode.FSNamesystem: KeyProvider: null
20/12/07 20:19:12 INFO namenode.FSNamesystem: fsLock is fair: true
20/12/07 20:19:12 INFO namenode.FSNamesystem: Detailed lock hold time metrics enabled: false
20/12/07 20:19:13 INFO namenode.FSNamesystem: fsOwner = root (auth:SIMPLE)
20/12/07 20:19:13 INFO namenode.FSNamesystem: supergroup = supergroup
20/12/07 20:19:13 INFO namenode.FSNamesystem: isPermissionEnabled = true
20/12/07 20:19:13 INFO namenode.FSNamesystem: HA Enabled: false
20/12/07 20:19:13 INFO common.Util: dfs.datanode.fileio.profiling.sampling.percentage set to 0. Disabling file IO profiling
20/12/07 20:19:14 INFO blockmanagement.DatanodeManager: dfs.block.invalidate.limit: configured=1000, counted=60, effected=1000
20/12/07 20:19:14 INFO blockmanagement.DatanodeManager: dfs.namenode.datanode.registration.ip-hostname-check=true
20/12/07 20:19:14 INFO blockmanagement.BlockManager: dfs.namenode.startup.delay.block.deletion.sec is set to 000:00:00:00.000
20/12/07 20:19:14 INFO blockmanagement.BlockManager: The block deletion will start around 2020 十二月 07 20:19:14
20/12/07 20:19:14 INFO util.GSet: Computing capacity for map BlocksMap
20/12/07 20:19:14 INFO util.GSet: VM type = 64-bit
20/12/07 20:19:14 INFO util.GSet: 2.0% max memory 966.7 MB = 19.3 MB
20/12/07 20:19:14 INFO util.GSet: capacity = 2^21 = 2097152 entries
20/12/07 20:19:15 INFO blockmanagement.BlockManager: dfs.block.access.token.enable=false
20/12/07 20:19:15 WARN conf.Configuration: No unit for dfs.heartbeat.interval(3) assuming SECONDS
20/12/07 20:19:15 WARN conf.Configuration: No unit for dfs.namenode.safemode.extension(30000) assuming MILLISECONDS
20/12/07 20:19:15 INFO blockmanagement.BlockManagerSafeMode: dfs.namenode.safemode.threshold-pct = 0.9990000128746033
20/12/07 20:19:15 INFO blockmanagement.BlockManagerSafeMode: dfs.namenode.safemode.min.datanodes = 0
20/12/07 20:19:15 INFO blockmanagement.BlockManagerSafeMode: dfs.namenode.safemode.extension = 30000
20/12/07 20:19:15 INFO blockmanagement.BlockManager: defaultReplication = 2
20/12/07 20:19:15 INFO blockmanagement.BlockManager: maxReplication = 512
20/12/07 20:19:15 INFO blockmanagement.BlockManager: minReplication = 1
20/12/07 20:19:15 INFO blockmanagement.BlockManager: maxReplicationStreams = 2
20/12/07 20:19:15 INFO blockmanagement.BlockManager: replicationRecheckInterval = 3000
20/12/07 20:19:15 INFO blockmanagement.BlockManager: encryptDataTransfer = false
20/12/07 20:19:15 INFO blockmanagement.BlockManager: maxNumBlocksToLog = 1000
20/12/07 20:19:15 INFO namenode.FSNamesystem: Append Enabled: true
20/12/07 20:19:16 INFO namenode.FSDirectory: GLOBAL serial map: bits=24 maxEntries=16777215
20/12/07 20:19:16 INFO util.GSet: Computing capacity for map INodeMap
20/12/07 20:19:16 INFO util.GSet: VM type = 64-bit
20/12/07 20:19:16 INFO util.GSet: 1.0% max memory 966.7 MB = 9.7 MB
20/12/07 20:19:16 INFO util.GSet: capacity = 2^20 = 1048576 entries
20/12/07 20:19:16 INFO namenode.FSDirectory: ACLs enabled? false
20/12/07 20:19:16 INFO namenode.FSDirectory: XAttrs enabled? true
20/12/07 20:19:16 INFO namenode.NameNode: Caching file names occurring more than 10 times
20/12/07 20:19:16 INFO snapshot.SnapshotManager: Loaded config captureOpenFiles: falseskipCaptureAccessTimeOnlyChange: false
20/12/07 20:19:16 INFO util.GSet: Computing capacity for map cachedBlocks
20/12/07 20:19:16 INFO util.GSet: VM type = 64-bit
20/12/07 20:19:16 INFO util.GSet: 0.25% max memory 966.7 MB = 2.4 MB
20/12/07 20:19:16 INFO util.GSet: capacity = 2^18 = 262144 entries
20/12/07 20:19:17 INFO metrics.TopMetrics: NNTop conf: dfs.namenode.top.window.num.buckets = 10
20/12/07 20:19:17 INFO metrics.TopMetrics: NNTop conf: dfs.namenode.top.num.users = 10
20/12/07 20:19:17 INFO metrics.TopMetrics: NNTop conf: dfs.namenode.top.windows.minutes = 1,5,25
20/12/07 20:19:17 INFO namenode.FSNamesystem: Retry cache on namenode is enabled
20/12/07 20:19:17 INFO namenode.FSNamesystem: Retry cache will use 0.03 of total heap and retry cache entry expiry time is 600000 millis
20/12/07 20:19:17 INFO util.GSet: Computing capacity for map NameNodeRetryCache
20/12/07 20:19:17 INFO util.GSet: VM type = 64-bit
20/12/07 20:19:17 INFO util.GSet: 0.029999999329447746% max memory 966.7 MB = 297.0 KB
20/12/07 20:19:17 INFO util.GSet: capacity = 2^15 = 32768 entries
20/12/07 20:19:17 INFO namenode.FSImage: Allocated new BlockPoolId: BP-1548081670-127.0.0.1-1607390357528
20/12/07 20:19:17 INFO common.Storage: Storage directory /data/hadoop/dfs/name has been successfully formatted.
20/12/07 20:19:18 INFO namenode.FSImageFormatProtobuf: Saving image file /data/hadoop/dfs/name/current/fsimage.ckpt_0000000000000000000 using no compression
20/12/07 20:19:20 INFO namenode.FSImageFormatProtobuf: Image file /data/hadoop/dfs/name/current/fsimage.ckpt_0000000000000000000 of size 322 bytes saved in 2 seconds .
20/12/07 20:19:21 INFO namenode.NNStorageRetentionManager: Going to retain 1 images with txid >= 0
20/12/07 20:19:21 INFO namenode.FSImage: FSImageSaver clean checkpoint: txid = 0 when meet shutdown.
20/12/07 20:19:21 INFO namenode.NameNode: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at boco201/127.0.0.1
************************************************************/
3.4.2 启动HDFS
start-dfs.sh
Starting namenodes on [boco201]
boco201: starting namenode, logging to /opt/hadoop-2.10.1/logs/hadoop-hadoop-namenode-boco201.out
boco201: starting datanode, logging to /opt/hadoop-2.10.1/logs/hadoop-hadoop-datanode-boco201.out
boco202: starting datanode, logging to /opt/hadoop-2.10.1/logs/hadoop-hadoop-datanode-boco202.out
boco203: starting datanode, logging to /opt/hadoop-2.10.1/logs/hadoop-hadoop-datanode-boco203.out
Starting secondary namenodes [boco202]
boco202: starting secondarynamenode, logging to /opt/hadoop-2.10.1/logs/hadoop-hadoop-secondarynamenode-boco202.out
3.4.3 启动YARN
注意:Namenode和ResourceManger如果不是同一台机器,不能在NameNode上启动yarn,应该在ResouceManager所在的机器上启动yarn。本文中环境,在boco202。
start-yarn.sh
starting yarn daemons
starting resourcemanager, logging to /opt/hadoop-2.10.1/logs/yarn-hadoop-resourcemanager-boco202.out
boco201: starting nodemanager, logging to /opt/hadoop-2.10.1/logs/yarn-hadoop-nodemanager-boco201.out
boco203: starting nodemanager, logging to /opt/hadoop-2.10.1/logs/yarn-hadoop-nodemanager-boco203.out
boco202: starting nodemanager, logging to /opt/hadoop-2.10.1/logs/yarn-hadoop-nodemanager-boco202.out
3.4.4 WEB管理
http://192.168.100.201:50070/dfshealth.html#tab-overview
Hadoop集群部署记录
最新推荐文章于 2023-05-25 08:58:09 发布