hadoop的部署以及应用

1.基础环境

[[email protected] ~]$ cat  /etc/redhat-release 
CentOS Linux release 7.2.1511 (Core) 
[[email protected] ~]$ 
[[email protected] ~]$ getenforce 
Disabled
[[email protected] ~]$ systemctl  status  firewalld 
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
[[email protected] ~]$

2.IP以及对应节点

IP 主机名 hadoop node hadoop  进程名称
192.168.56.100 master master namenode,jobtracker
192.168.56.101 slave1 slave datanode,tasktracker
192.168.56.102 slave2 slave datanode,tasktracker
192.168.56.103 slave3 slave datanode,tasktracker
[[email protected] ~]# cat  /etc/hosts
192.168.56.100  Master
192.168.56.101  slave1
192.168.56.102  slave2
192.168.56.103  slave3
[[email protected] ~]#

3.增加hadoop用户,所有节点

useradd  hadoop
echo hadoop|passwd  --stdin  hadoop

4.jdk

[[email protected] application]# ll
total 4
lrwxrwxrwx 1 root root   24 Jul 10 01:35 jdk -> /application/jdk1.8.0_60
drwxr-xr-x 8 root root 4096 Aug  5  2015 jdk1.8.0_60
[[email protected] application]# pwd
/application
[[email protected] application]# 
[[email protected] ~]# java  -version 
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
[[email protected] ~]#

5.master(192.168.56.100)上的hadoop用户可以ssh所有slave节点的hadoop用户下

6.设置hadoop安装路径 以及环境变量(所有节点)

su  -  hadoop
tar xf  hadoop-2.7.0tar.gz
/home/hadoop/hadoop-2.7.0
vi /etc/profile  添加hadoop环境变量
export HADOOP_HOME=/home/hadoop/hadoop-2.7.0
export PATH=$PATH:$HADOOP_HOME/bin
source /etc/profile

7.修改hadoop的环境的Java环境变量

/home/hadoop/hadoop-2.7.0/etc/hadoop
vi hadoop-env.sh 添加
###JAVA_HOME
export JAVA_HOME=/application/jdk/

8.修改hadoop的配置文件

cd  /home/hadoop/hadoop-2.7.0/etc/hadoop
1.##############################
[[email protected] hadoop]$ cat core-site.xml
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License. See accompanying LICENSE file.
-->

<!-- Put site-specific property overrides in this file. -->
<configuration>
<property>
 <name>fs.default.name</name>
  <value>hdfs://master:9000</value>
</property>
<property>
  <name>hadoop.tmp.dir</name>
 <value>/home/hadoop/tmp</value>
</property>
</configuration>
[[email protected] hadoop]$ 
2.###################################(默认不存在 拷贝个模板即可)
[[email protected] hadoop]$ cat mapred-site.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License. See accompanying LICENSE file.
-->

<!-- Put site-specific property overrides in this file. -->
<configuration>
<property>
  <name>mapred.job.tracker</name>
  <value>master:9001</value>
</property>
<property>
  <name>mapred.local.dir</name>
 <value>/home/hadoop/tmp</value>
</property>
</configuration>
[[email protected] hadoop]$ 
3.#########################################
[[email protected] hadoop]$ cat  hdfs-site.xml
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License. See accompanying LICENSE file.
-->

<!-- Put site-specific property overrides in this file. -->
<configuration>
<property>
<name>dfs.name.dir</name>
<value>/home/hadoop/name1,/home/hadoop/name2,/home/hadoop/name3</value> 
<description>  </description>
</property>
<property>
<name>dfs.data.dir</name>
<value>/home/hadoop/data1,/home/hadoop/data2,/home/hadoop/data3</value>
<description> </description>
</property>
<property>
  <name>dfs.replication</name>
  <value>3</value>
</property>
</configuration>
[[email protected] hadoop]$ 
[[email protected] hadoop]$ cat masters 
master
[hadoop[email protected] hadoop]$ cat slaves 
slave1
slave2
slave3
[[email protected] hadoop]$

9.分发到slave节点

scp   -r  /home/hadoop/hadoop-2.7.0  slave1:/home/hadoop/
scp   -r  /home/hadoop/hadoop-2.7.0  slave2:/home/hadoop/
scp   -r  /home/hadoop/hadoop-2.7.0  slave3:/home/hadoop/

10.master 节点测试

/home/hadoop/name1 /home/hadoop/name2  /home/hadoop/name3  这三个目录不要创建,如果创建会提示
重新reload

cd  /home/hadoop/hadoop-2.7.0
[[email protected] hadoop-2.7.0]$ ./bin/hadoop namenode -format
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.

17/07/10 02:57:34 INFO namenode.NameNode: STARTUP_MSG: 
/************************************************************
STARTUP_MSG: Starting NameNode
STARTUP_MSG:   host = Master/192.168.56.100
STARTUP_MSG:   args = [-format]
STARTUP_MSG:   version = 2.7.0
STARTUP_MSG:   classpath = /home/hadoop/hadoop-2.7.0/etc/hadoop:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/commons-lang-2.6.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/hadoop-auth-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/curator-recipes-2.7.1.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/asm-3.2.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/commons-collections-3.2.1.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/xmlenc-0.52.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/htrace-core-3.1.0-incubating.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/jetty-util-6.1.26.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/commons-beanutils-core-1.8.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/commons-digester-1.8.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/jsp-api-2.1.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/httpcore-4.2.5.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/jersey-core-1.9.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/mockito-all-1.8.5.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/hadoop-annotations-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/jackson-mapper-asl-1.9.13.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/junit-4.11.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/commons-logging-1.1.3.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/commons-configuration-1.6.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/api-util-1.0.0-M20.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/jaxb-impl-2.2.3-1.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/commons-compress-1.4.1.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/jersey-json-1.9.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/jettison-1.1.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/jackson-jaxrs-1.9.13.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/hamcrest-core-1.3.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/commons-net-3.1.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/commons-cli-1.2.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/api-asn1-api-1.0.0-M20.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/commons-math3-3.1.1.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/jackson-xc-1.9.13.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/stax-api-1.0-2.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/commons-codec-1.4.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/jsr305-3.0.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/snappy-java-1.0.4.1.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/jetty-6.1.26.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/guava-11.0.2.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/netty-3.6.2.Final.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/avro-1.7.4.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/paranamer-2.3.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/commons-beanutils-1.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/jackson-core-asl-1.9.13.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/jsch-0.1.42.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/apacheds-kerberos-codec-2.0.0-M15.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/jets3t-0.9.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/activation-1.1.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/protobuf-java-2.5.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/java-xmlbuilder-0.4.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/servlet-api-2.5.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/xz-1.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/apacheds-i18n-2.0.0-M15.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/commons-httpclient-3.1.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/gson-2.2.4.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/commons-io-2.4.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/jaxb-api-2.2.2.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/curator-framework-2.7.1.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/jersey-server-1.9.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/httpclient-4.2.5.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/curator-client-2.7.1.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/log4j-1.2.17.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/slf4j-api-1.7.10.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/zookeeper-3.4.6.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/hadoop-nfs-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/hadoop-common-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/hadoop-common-2.7.0-tests.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/commons-lang-2.6.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/asm-3.2.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/xmlenc-0.52.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/htrace-core-3.1.0-incubating.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/jetty-util-6.1.26.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/jersey-core-1.9.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/jackson-mapper-asl-1.9.13.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/commons-logging-1.1.3.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/leveldbjni-all-1.8.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/commons-cli-1.2.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/commons-daemon-1.0.13.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/commons-codec-1.4.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/jsr305-3.0.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/jetty-6.1.26.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/guava-11.0.2.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/netty-3.6.2.Final.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/jackson-core-asl-1.9.13.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/protobuf-java-2.5.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/servlet-api-2.5.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/xercesImpl-2.9.1.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/commons-io-2.4.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/netty-all-4.0.23.Final.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/jersey-server-1.9.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/log4j-1.2.17.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/xml-apis-1.3.04.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/hadoop-hdfs-nfs-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/hadoop-hdfs-2.7.0-tests.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/hadoop-hdfs-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/commons-lang-2.6.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/asm-3.2.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/commons-collections-3.2.1.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/javax.inject-1.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/jetty-util-6.1.26.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/aopalliance-1.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/jersey-core-1.9.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/jackson-mapper-asl-1.9.13.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/commons-logging-1.1.3.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/leveldbjni-all-1.8.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/jaxb-impl-2.2.3-1.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/commons-compress-1.4.1.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/jersey-json-1.9.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/jettison-1.1.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/jackson-jaxrs-1.9.13.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/commons-cli-1.2.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/jackson-xc-1.9.13.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/stax-api-1.0-2.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/commons-codec-1.4.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/jsr305-3.0.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/jetty-6.1.26.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/guava-11.0.2.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/jersey-guice-1.9.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/guice-3.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/netty-3.6.2.Final.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/jackson-core-asl-1.9.13.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/activation-1.1.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/protobuf-java-2.5.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/servlet-api-2.5.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/xz-1.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/commons-io-2.4.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/jaxb-api-2.2.2.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/zookeeper-3.4.6-tests.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/guice-servlet-3.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/jersey-client-1.9.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/jersey-server-1.9.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/log4j-1.2.17.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/zookeeper-3.4.6.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/hadoop-yarn-server-sharedcachemanager-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/hadoop-yarn-server-applicationhistoryservice-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/hadoop-yarn-applications-distributedshell-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/hadoop-yarn-applications-unmanaged-am-launcher-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/hadoop-yarn-server-resourcemanager-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/hadoop-yarn-registry-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/hadoop-yarn-server-tests-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/hadoop-yarn-server-common-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/hadoop-yarn-common-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/hadoop-yarn-server-web-proxy-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/hadoop-yarn-api-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/hadoop-yarn-server-nodemanager-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/hadoop-yarn-client-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/lib/asm-3.2.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/lib/javax.inject-1.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/lib/aopalliance-1.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/lib/jersey-core-1.9.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/lib/hadoop-annotations-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/lib/jackson-mapper-asl-1.9.13.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/lib/junit-4.11.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/lib/leveldbjni-all-1.8.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/lib/commons-compress-1.4.1.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/lib/hamcrest-core-1.3.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/lib/snappy-java-1.0.4.1.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/lib/jersey-guice-1.9.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/lib/guice-3.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/lib/netty-3.6.2.Final.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/lib/avro-1.7.4.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/lib/paranamer-2.3.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/lib/jackson-core-asl-1.9.13.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/lib/protobuf-java-2.5.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/lib/xz-1.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/lib/commons-io-2.4.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/lib/guice-servlet-3.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/lib/jersey-server-1.9.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/lib/log4j-1.2.17.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/hadoop-mapreduce-client-jobclient-2.7.0-tests.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/hadoop-mapreduce-client-hs-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/hadoop-mapreduce-client-core-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/hadoop-mapreduce-client-jobclient-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/hadoop-mapreduce-client-hs-plugins-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/hadoop-mapreduce-client-common-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/hadoop-mapreduce-client-shuffle-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/hadoop-mapreduce-client-app-2.7.0.jar:/home/hadoop/hadoop-2.7.0/contrib/capacity-scheduler/*.jar:/home/hadoop/hadoop-2.7.0/contrib/capacity-scheduler/*.jar
STARTUP_MSG:   build = Unknown -r Unknown; compiled by ‘root‘ on 2015-05-27T13:56Z
STARTUP_MSG:   java = 1.8.0_60
************************************************************/
17/07/10 02:57:34 INFO namenode.NameNode: registered UNIX signal handlers for [TERM, HUP, INT]
17/07/10 02:57:34 INFO namenode.NameNode: createNameNode [-format]
17/07/10 02:57:35 WARN common.Util: Path /home/hadoop/name1 should be specified as a URI in configuration files. Please update hdfs configuration.
17/07/10 02:57:35 WARN common.Util: Path /home/hadoop/name2 should be specified as a URI in configuration files. Please update hdfs configuration.
17/07/10 02:57:35 WARN common.Util: Path /home/hadoop/name3 should be specified as a URI in configuration files. Please update hdfs configuration.
17/07/10 02:57:35 WARN common.Util: Path /home/hadoop/name1 should be specified as a URI in configuration files. Please update hdfs configuration.
17/07/10 02:57:35 WARN common.Util: Path /home/hadoop/name2 should be specified as a URI in configuration files. Please update hdfs configuration.
17/07/10 02:57:35 WARN common.Util: Path /home/hadoop/name3 should be specified as a URI in configuration files. Please update hdfs configuration.
Formatting using clusterid: CID-77e0896d-bda2-49f1-8127-c5343f1c52c9
17/07/10 02:57:35 INFO namenode.FSNamesystem: No KeyProvider found.
17/07/10 02:57:35 INFO namenode.FSNamesystem: fsLock is fair:true
17/07/10 02:57:35 INFO blockmanagement.DatanodeManager: dfs.block.invalidate.limit=1000
17/07/10 02:57:35 INFO blockmanagement.DatanodeManager: dfs.namenode.datanode.registration.ip-hostname-check=true
17/07/10 02:57:35 INFO blockmanagement.BlockManager: dfs.namenode.startup.delay.block.deletion.sec is set to 000:00:00:00.000
17/07/10 02:57:36 INFO blockmanagement.BlockManager: The block deletion will start around 2017 Jul 10 02:57:36
17/07/10 02:57:36 INFO util.GSet: Computing capacity for map BlocksMap
17/07/10 02:57:36 INFO util.GSet: VM type       = 64-bit
17/07/10 02:57:36 INFO util.GSet: 2.0% max memory 966.7 MB = 19.3 MB
17/07/10 02:57:36 INFO util.GSet: capacity      = 2^21 = 2097152 entries
17/07/10 02:57:36 INFO blockmanagement.BlockManager: dfs.block.access.token.enable=false
17/07/10 02:57:36 INFO blockmanagement.BlockManager: defaultReplication         = 3
17/07/10 02:57:36 INFO blockmanagement.BlockManager: maxReplication             = 512
17/07/10 02:57:36 INFO blockmanagement.BlockManager: minReplication             = 1
17/07/10 02:57:36 INFO blockmanagement.BlockManager: maxReplicationStreams      = 2
17/07/10 02:57:36 INFO blockmanagement.BlockManager: shouldCheckForEnoughRacks  = false
17/07/10 02:57:36 INFO blockmanagement.BlockManager: replicationRecheckInterval = 3000
17/07/10 02:57:36 INFO blockmanagement.BlockManager: encryptDataTransfer        = false
17/07/10 02:57:36 INFO blockmanagement.BlockManager: maxNumBlocksToLog          = 1000
17/07/10 02:57:36 INFO namenode.FSNamesystem: fsOwner             = hadoop (auth:SIMPLE)
17/07/10 02:57:36 INFO namenode.FSNamesystem: supergroup          = supergroup
17/07/10 02:57:36 INFO namenode.FSNamesystem: isPermissionEnabled = true
17/07/10 02:57:36 INFO namenode.FSNamesystem: HA Enabled: false
17/07/10 02:57:36 INFO namenode.FSNamesystem: Append Enabled: true
17/07/10 02:57:36 INFO util.GSet: Computing capacity for map INodeMap
17/07/10 02:57:36 INFO util.GSet: VM type       = 64-bit
17/07/10 02:57:36 INFO util.GSet: 1.0% max memory 966.7 MB = 9.7 MB
17/07/10 02:57:36 INFO util.GSet: capacity      = 2^20 = 1048576 entries
17/07/10 02:57:36 INFO namenode.FSDirectory: ACLs enabled? false
17/07/10 02:57:36 INFO namenode.FSDirectory: XAttrs enabled? true
17/07/10 02:57:36 INFO namenode.FSDirectory: Maximum size of an xattr: 16384
17/07/10 02:57:36 INFO namenode.NameNode: Caching file names occuring more than 10 times
17/07/10 02:57:36 INFO util.GSet: Computing capacity for map cachedBlocks
17/07/10 02:57:36 INFO util.GSet: VM type       = 64-bit
17/07/10 02:57:36 INFO util.GSet: 0.25% max memory 966.7 MB = 2.4 MB
17/07/10 02:57:36 INFO util.GSet: capacity      = 2^18 = 262144 entries
17/07/10 02:57:36 INFO namenode.FSNamesystem: dfs.namenode.safemode.threshold-pct = 0.9990000128746033
17/07/10 02:57:36 INFO namenode.FSNamesystem: dfs.namenode.safemode.min.datanodes = 0
17/07/10 02:57:36 INFO namenode.FSNamesystem: dfs.namenode.safemode.extension     = 30000
17/07/10 02:57:36 INFO metrics.TopMetrics: NNTop conf: dfs.namenode.top.window.num.buckets = 10
17/07/10 02:57:36 INFO metrics.TopMetrics: NNTop conf: dfs.namenode.top.num.users = 10
17/07/10 02:57:36 INFO metrics.TopMetrics: NNTop conf: dfs.namenode.top.windows.minutes = 1,5,25
17/07/10 02:57:36 INFO namenode.FSNamesystem: Retry cache on namenode is enabled
17/07/10 02:57:36 INFO namenode.FSNamesystem: Retry cache will use 0.03 of total heap and retry cache entry expiry time is 600000 millis
17/07/10 02:57:36 INFO util.GSet: Computing capacity for map NameNodeRetryCache
17/07/10 02:57:36 INFO util.GSet: VM type       = 64-bit
17/07/10 02:57:36 INFO util.GSet: 0.029999999329447746% max memory 966.7 MB = 297.0 KB
17/07/10 02:57:36 INFO util.GSet: capacity      = 2^15 = 32768 entries
17/07/10 02:57:36 INFO namenode.FSImage: Allocated new BlockPoolId: BP-467031090-192.168.56.100-1499626656612
17/07/10 02:57:36 INFO common.Storage: Storage directory /home/hadoop/name1 has been successfully formatted.
17/07/10 02:57:36 INFO common.Storage: Storage directory /home/hadoop/name2 has been successfully formatted.
17/07/10 02:57:36 INFO common.Storage: Storage directory /home/hadoop/name3 has been successfully formatted.
17/07/10 02:57:36 INFO namenode.NNStorageRetentionManager: Going to retain 1 images with txid >= 0
17/07/10 02:57:36 INFO util.ExitUtil: Exiting with status 0
17/07/10 02:57:37 INFO namenode.NameNode: SHUTDOWN_MSG: 
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at Master/192.168.56.100
************************************************************/
[[email protected] hadoop-2.7.0]$

11.启动服务

[[email protected] sbin]$ pwd
/home/hadoop/hadoop-2.7.0/sbin
[[email protected] sbin]$ 
[[email protected] sbin]$ ./start-all.sh 
This script is Deprecated. Instead use start-dfs.sh and start-yarn.sh
Starting namenodes on [master]
master: starting namenode, logging to /home/hadoop/hadoop-2.7.0/logs/hadoop-hadoop-namenode-master.out
slave3: starting datanode, logging to /home/hadoop/hadoop-2.7.0/logs/hadoop-hadoop-datanode-slave3.out
slave2: starting datanode, logging to /home/hadoop/hadoop-2.7.0/logs/hadoop-hadoop-datanode-slave2.out
slave1: starting datanode, logging to /home/hadoop/hadoop-2.7.0/logs/hadoop-hadoop-datanode-slave1.out
Starting secondary namenodes [0.0.0.0]
0.0.0.0: starting secondarynamenode, logging to /home/hadoop/hadoop-2.7.0/logs/hadoop-hadoop-secondarynamenode-master.out
starting yarn daemons
starting resourcemanager, logging to /home/hadoop/hadoop-2.7.0/logs/yarn-hadoop-resourcemanager-master.out
slave3: starting nodemanager, logging to /home/hadoop/hadoop-2.7.0/logs/yarn-hadoop-nodemanager-slave3.out
slave2: starting nodemanager, logging to /home/hadoop/hadoop-2.7.0/logs/yarn-hadoop-nodemanager-slave2.out
slave1: starting nodemanager, logging to /home/hadoop/hadoop-2.7.0/logs/yarn-hadoop-nodemanager-slave1.out
[[email protected] sbin]$ netstat  -lntup 
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 192.168.56.100:9000     0.0.0.0:*               LISTEN      4405/java           
tcp        0      0 0.0.0.0:50090           0.0.0.0:*               LISTEN      4606/java           
tcp        0      0 0.0.0.0:50070           0.0.0.0:*               LISTEN      4405/java           
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -                   
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      -                   
tcp6       0      0 :::22                   :::*                    LISTEN      -                   
tcp6       0      0 :::8088                 :::*                    LISTEN      4757/java           
tcp6       0      0 ::1:25                  :::*                    LISTEN      -                   
tcp6       0      0 :::8030                 :::*                    LISTEN      4757/java           
tcp6       0      0 :::8031                 :::*                    LISTEN      4757/java           
tcp6       0      0 :::8032                 :::*                    LISTEN      4757/java           
tcp6       0      0 :::8033                 :::*                    LISTEN      4757/java           
[[email protected] sbin]$

http://192.168.56.100:50070/dfshealth.html#tab-overview

http://192.168.56.103:8042/node/allApplications

http://192.168.56.100:50090/status.html

时间: 2025-01-02 13:53:47

hadoop的部署以及应用的相关文章

Hadoop分布式部署

准备硬件环境 此次用到三台计算机,三台计算机的系统都是Linux,并且以安装好JAVA.IP地址和角色为: namenode:192.168.0.1 datanode:192.168.0.2 datanode:192.168.0.3 三台计算机之间能够正确解析彼此.因此需要修改/etc/hosts文件,主节点上需要将所有节点的IP地址以及相对应的主机名添加到文件中.作datanode的节点则只需将自己以及主节点的IP地址以及相对应的主机名添加到文件中即可. 安装Hadoop 由于Hadoop要求

Hadoop自动化部署脚本

摘自:http://www.wangsenfeng.com/articles/2016/10/27/1477556261953.html 1 概述 最近自己写了一个Hadoop自动化部署脚本,包括Hadoop集群自动化部署脚本和Hadoop增加单节点自动化部署脚本.需要快速部署Hadoop集群的童鞋可以使用该脚本.这些脚本我在用5台虚拟机进行了测试,如果在使用中还有bug,欢迎指出.本文主要介绍Hadoop集群自动化部署脚本,安装的Hadoop版本为2.6.0. 2 依赖 安装Hadoop2.6

Hadoop单点部署与案例开发(微博用户数据分析)

一.环境搭建 1.Hadoop运行环境搭建 1.1 安装虚拟机 (1)下载并安装VMware虚拟机软件. (2)创建虚拟机,实验环境虚拟机配置如下图所示. (3)安装Ubuntu系统,安装结果如下图所示. 1.2  配置JDK环境 下载并安装JDK,安装结束后需对java环境进行配置,配置成功结果如下所示. 2.Hadoop安装和部署 (1)创建Hadoop安装文件夹,并切到到此路径下. (2)从 hadoop.apache.org 下载Hadoop 安装文件,并复制文件到安装Hadoop的文件

通过Hadoop安全部署经验总结,开发出以下十大建议,以确保大型和复杂多样环境下的数据信息安全。

1.先下手为强!在规划部署阶段就确定数据的隐私保护策略,最好是在将数据放入到Hadoop之前就确定好保护策略. 2.确定哪些数据属于企业的敏感数据.根据公司的隐私保护政策,以及相关的行业法规和政府规章来综合确定. 3.及时发现敏感数据是否暴露在外,或者是否导入到Hadoop中. 4.搜集信息并决定是否暴露出安全风险. 5.确定商业分析是否需要访问真实数据,或者确定是否可以使用这些敏感数据.然后,选择合适的加密技术.如果有任何疑问,对其进行加密隐藏处理,同时提供最安全的加密技术和灵活的应对策略,以

CentOS7 下 Hadoop 分布式部署

Hadoop 服务划分 使用三台节点,集群部署规划如下 服务\主机 hadoop1 hadoop2 hadoop3 HDFS NameNode DataNode DataNode SecondaryNameNode DataNode YARN NodeManager ResourceManager NodeManager NodeManager IP地址规划 hadoop1 192.168.123.11 hadoop2 192.168.123.12 hadoop3 192.168.123.13

HADOOP HA部署

本次部署haddoop集群三台hostname:HBASE01 HBASE02 HBASE03 192.168.240.129 HBASE01 192.168.240.130 HBASE02 192.168.240.131 HBASE03 将HBASE01 HBASE02作为namenode节点,HBASE01.HBASE02.HBASE03作为datanode节点 一. namenode ha配置 1.hdfs-site.xml <?xml version="1.0"?>

hadoop安装部署3------安装hive

安装mysql mysql装在了master节点上 1)卸载系统自带的mysql相关安装包,仅卸载 mysql 开头的包 rpm -qa|grep -i mysql -i 作用是不区分大小写 可以看到有两个安装包 MySQL-server-5.6.19-1.linux_glibc2.5.x86_64.rpm MySQL-client-5.6.19-1.linux_glibc2.5.x86_64.rpm 删除这两个服务(去掉后缀) rpm -e MySQL-client-5.6.19-1.linu

设置ssh免密码登录脚本(hadoop自动化部署脚本一)

设置ssh免密码登录脚本(飞谷云大数据自动化部署脚本一) 1.#!/bin/sh2.#important note:this script is expected to run on master node3.PWD=hdp4.USER=hdp5.SSHDIR=/home/dhp/.ssh6.7.#create temp dir to store id_pub file8.mkdir $SSHDIR/sshtmp9.10.HOST=(master slave01 slave02);11.12.f

hadoop+mahout部署及20newsgroups经典算法测试

--------------------------------------------------------------------------第一阶段:hadoop的伪分布式安装 第二阶段:mahout的安装 第三阶段:20newsgroups的bayes算法测试------------------------------------------------------------------------- 注意:安装完vmwaretools必须重启centos才可以生效第一阶段:hado