记录我的hadoop学习历程1--hadoop 单节点环境搭建

本文详细介绍如何在单节点上安装配置Hadoop2.8,包括JDK8的基础环境搭建、SSH公钥认证配置、Hadoop下载及环境变量设置、核心配置文件调整等步骤,并提供启动、状态检查和关闭服务的具体指令。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

hadoop单节点环境搭建(jdk8+hadoop2.8)

1、java基础环境 jdk8

请自行百度、google

2、配置ssh公钥认证

[配置ssh公钥认证](http://blog.youkuaiyun.com/dark_guo/article/details/72307624)

3、hadoop 安装

下载
[hadoop下载链接](https://mirrors.tuna.tsinghua.edu.cn/apache/hadoop/core/)
安装、配置环境变量
1、解压:
    tar -zxvf hadoop-2.8.0.tar.gz
    cp hadoop-2.8.0.tar.gz /usr/local/hadoop
2、配置环境变量 (添加至: .bashrc)
    export HADOOP_HOME=/usr/local/hadoop
    export PATH=$PATH:$HADOOP_HOME/bin
    export PATH=$PATH:$HADOOP_HOME/sbin
配置核心文件

conf/core-site.xml

<property>
  <name>hadoop.tmp.dir</name>
  <value>/Users/guoyakui/app/hadoop/tmp</value>
  <description>A base for other temporary directories.</description>
</property>
<-- 配置namenode -->
<property>
  <name>fs.default.name</name>
  <value>hdfs://192.168.199.139:54310</value>
  <description>The name of the default file system.  A URI whose
  scheme and authority determine the FileSystem implementation.  The
  uri's scheme determines the config property (fs.SCHEME.impl) naming
  the FileSystem implementation class.  The uri's authority is used to
  determine the host, port, etc. for a filesystem.</description>
</property>

conf/mapred-site.xml

<property>
  <name>mapred.job.tracker</name>
  <value>192.168.199.139:54311</value>
  <description>The host and port that the MapReduce job tracker runs
  at.  If "local", then jobs are run in-process as a single map
  and reduce task.
  </description>
</property>

conf/hdfs-site.xml

<property>
  <name>dfs.replication</name>
  <value>1</value>
  <description>Default block replication.
  The actual number of replications can be specified when the file is created.
  The default is used if replication is not specified in create time.
  </description>
</property>
格式化 HDFS 文件系统

/usr/local/hadoop/bin/hadoop namenode -format

启动单节点

/usr/local/hadoop/bin/start-all.sh

查看hadoop的运行状态

/usr/local/hadoop$ jps

输出:
    12003 SecondaryNameNode
    12133 ResourceManager
    12232 NodeManager
    11786 NameNode
    11883 DataNode
    14091 Jps
停止服务

bin/stop-all.sh

输出:
    Stopping namenodes on [guoyakuidembp.lan]
    guoyakuidembp.lan: stopping namenode
    localhost: stopping datanode
    Stopping secondary namenodes [0.0.0.0]
    0.0.0.0: stopping secondarynamenode
    stopping yarn daemons
    stopping resourcemanager
    localhost: stopping nodemanager
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值