以表格的形式描述下伪分布式

下面,以表格的形式描述下伪分布式安装
系统环境如下:

 

 

序号名称描述1系统环境Centos6.52JAVA环境JDK1.73Haoop版本hadoop2.2.0



安装步骤如下:

序号步骤1解压hadoop,并配置环境变量2使用which hadoop命令,测试是否成功3配置core-site.xml4配置hdfs-site.xml5配置yarn-site.xml(非必须,使用默认也可)6配置mapred-site.xml7配置mapred-env.sh里面的JAVA路径8如上的配置完成后,需要新建几个文件夹,来提供HDFS的格式化底层一个是hadoop的tmp文件夹,另外的是namenode和datanode的文件夹,来分别存储各自的信息9上面一切完成后,即可执行hadoop namenode -format 进行格式化10然后启动伪分布式集群,执行命令sbin/start-all.sh 最后使用JPS查看JAVA进程11配置本机的hosts文件,映射主机名信息



下面来详细说下,各个步骤的具体操作:
在这之前,最好配置好本机的SSH无密码登陆操作,避免hadoop进程之间通信时,需要验证。

下面是各个xml文件的配置


Xml代码 复制代码  收藏代码
  1. <!-- core-site.xml配置 -->  
  2. <configuration>  
  3.     <property>    
  4.         <name>fs.default.name</name>    
  5.         <value>hdfs://192.168.46.28:9000</value>    
  6.     </property>    
  7.   <property>  
  8.     <name>hadoop.tmp.dir</name>  
  9.     <value>/root/hadoop/tmp</value>  
  10.   </property>  
  11.   
  12. </configuration>  
<!-- core-site.xml配置 -->
<configuration>
    <property>  
        <name>fs.default.name</name>  
        <value>hdfs://192.168.46.28:9000</value>  
    </property>  
  <property>
    <name>hadoop.tmp.dir</name>
    <value>/root/hadoop/tmp</value>
  </property>

</configuration>

 

Xml代码 复制代码  收藏代码
  1. <!-- hdfs-site.xml配置 -->  
  2.    
  3. <configuration>  
  4. <property>    
  5.    <name>dfs.replication</name>    
  6.    <value>1</value>    
  7.  </property>    
  8.   
  9.  <property>    
  10.    <name>dfs.namenode.name.dir</name>    
  11.    <value>/root/hadoop/nddir</value>    
  12.  </property>    
  13.   
  14.   
  15.  <property>    
  16.    <name>dfs.datanode.data.dir</name>    
  17.    <value>/root/hadoop/dddir</value>    
  18.  </property>    
  19.   
  20. <property>    
  21.   <name>dfs.permissions</name>    
  22.   <value>false</value>    
  23. </property>  
  24.   
  25. </configuration>  
<!-- hdfs-site.xml配置 -->
 
<configuration>
<property>  
   <name>dfs.replication</name>  
   <value>1</value>  
 </property>  

 <property>  
   <name>dfs.namenode.name.dir</name>  
   <value>/root/hadoop/nddir</value>  
 </property>  


 <property>  
   <name>dfs.datanode.data.dir</name>  
   <value>/root/hadoop/dddir</value>  
 </property>  

<property>  
  <name>dfs.permissions</name>  
  <value>false</value>  
</property>

</configuration>




Xml代码 复制代码  收藏代码
  1. <!--    yarn-site.xml  不用配置,使用默认属性即可 -->  
  2. <configuration>  
  3.   
  4.   
  5. </configuration>  
<!--    yarn-site.xml  不用配置,使用默认属性即可 -->
<configuration>


</configuration>

 

Xml代码 复制代码  收藏代码
  1. <!--  mapred-site.xml的配置 -->  
  2. <configuration>  
  3. <property>    
  4.     <name>mapreduce.cluster.temp.dir</name>    
  5.     <value></value>    
  6.     <description>No description</description>    
  7.     <final>true</final>    
  8.   </property>    
  9.     
  10.   <property>    
  11.     <name>mapreduce.cluster.local.dir</name>    
  12.     <value></value>    
  13.     <description>No description</description>    
  14.     <final>true</final>    
  15.   </property>    
  16. </configuration>  
<!--  mapred-site.xml的配置 -->
<configuration>
<property>  
    <name>mapreduce.cluster.temp.dir</name>  
    <value></value>  
    <description>No description</description>  
    <final>true</final>  
  </property>  
  
  <property>  
    <name>mapreduce.cluster.local.dir</name>  
    <value></value>  
    <description>No description</description>  
    <final>true</final>  
  </property>  
</configuration>



mapred-env.sh里面的配置

Java代码 复制代码  收藏代码
  1. # Licensed to the Apache Software Foundation (ASF) under one or more  
  2. # contributor license agreements.  See the NOTICE file distributed with  
  3. this work for additional information regarding copyright ownership.  
  4. # The ASF licenses this file to You under the Apache License, Version 2.0  
  5. # (the "License"); you may not use this file except in compliance with  
  6. # the License.  You may obtain a copy of the License at  
  7. #  
  8. #     http://www.apache.org/licenses/LICENSE-2.0  
  9. #  
  10. # Unless required by applicable law or agreed to in writing, software  
  11. # distributed under the License is distributed on an "AS IS" BASIS,  
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  
  13. # See the License for the specific language governing permissions and  
  14. # limitations under the License.  
  15.   
  16. export JAVA_HOME=/usr/local/jdk  
  17.   
  18. export HADOOP_JOB_HISTORYSERVER_HEAPSIZE=1000  
  19.   
  20. export HADOOP_MAPRED_ROOT_LOGGER=INFO,RFA  
  21.   
  22. #export HADOOP_JOB_HISTORYSERVER_OPTS=  
  23. #export HADOOP_MAPRED_LOG_DIR="" # Where log files are stored.  $HADOOP_MAPRED_HOME/logs by default.  
  24. #export HADOOP_JHS_LOGGER=INFO,RFA # Hadoop JobSummary logger.  
  25. #export HADOOP_MAPRED_PID_DIR= # The pid files are stored. /tmp by default.  
  26. #export HADOOP_MAPRED_IDENT_STRING= #A string representing this instance of hadoop. $USER by default  
  27. #export HADOOP_MAPRED_NICENESS= #The scheduling priority for daemons. Defaults to 0.  
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.

export JAVA_HOME=/usr/local/jdk

export HADOOP_JOB_HISTORYSERVER_HEAPSIZE=1000

export HADOOP_MAPRED_ROOT_LOGGER=INFO,RFA

#export HADOOP_JOB_HISTORYSERVER_OPTS=
#export HADOOP_MAPRED_LOG_DIR="" # Where log files are stored.  $HADOOP_MAPRED_HOME/logs by default.
#export HADOOP_JHS_LOGGER=INFO,RFA # Hadoop JobSummary logger.
#export HADOOP_MAPRED_PID_DIR= # The pid files are stored. /tmp by default.
#export HADOOP_MAPRED_IDENT_STRING= #A string representing this instance of hadoop. $USER by default
#export HADOOP_MAPRED_NICENESS= #The scheduling priority for daemons. Defaults to 0.



然后,建对应的几个文件夹即可,路径都在hadoop2.2的根目录下即可,
然后执行格式化命令bin/hadoop namenode -format即可;

最后使用jps命令,查看进程,如果有以下几个进程名称,就代表部署伪分布式成功

Java代码 复制代码  收藏代码
  1. 4887 NodeManager  
  2. 4796 ResourceManager  
  3. 4661 SecondaryNameNode  
  4. 4524 DataNode  
  5. 4418 NameNode  
  6. 6122 Jps  
4887 NodeManager
4796 ResourceManager
4661 SecondaryNameNode
4524 DataNode
4418 NameNode
6122 Jps



然后,访问界面端口,注意与之前的配置文件里一致,namenode的端口号仍为50070,原来1.x的50030端口,已经没有了,可以访问8088的yarn的端口,来查看,具体的截图如下:







OK,此时,我们已经成功的完成伪分布式的部署,下一步我们要做的,就是跑一个经典的MR程序Hellow World,来测试我们的集群了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值