Single Node Setup
Purpose
This document describes how to set up and configure a single-node Hadoop installation so that you can quickly perform simple operations using Hadoop MapReduce and the Hadoop Distributed File System (HDFS).
Prerequisites
Supported Platforms
- GNU/Linux is supported as a development and production platform. Hadoop has been demonstrated on GNU/Linux clusters with 2000 nodes.
- Win32 is supported as a development platform. Distributed operation has not been well tested on Win32, so it is not supported as a production platform.
Required Software
Required software for Linux and Windows include:
- JavaTM 1.6.x, preferably from Sun, must be installed.
- ssh must be installed and sshd must be running to use the Hadoop scripts that manage remote Hadoop daemons.
Additional requirements for Windows include:
- Cygwin - Required for shell support in addition to the required software above.
Installing Software
If your cluster doesn't have the requisite software you will need to install it.
For example on Ubuntu Linux:
$ sudo apt-get install ssh
$ sudo apt-get install rsync
On Windows, if you did not install the required software when you installed cygwin, start the cygwin installer and select the packages:
- openssh - the Net category
Download
To get a Hadoop distribution, download a recent stable release from one of the Apache Download Mirrors.
Prepare to Start the Hadoop Cluster
Unpack the downloaded Hadoop distribution. In the distribution, edit the file conf/hadoop-env.sh to define at least JAVA_HOME to be the root of your Java installation.
Try the following command:
$ bin/hadoop
This will display the usage documentation for the hadoop script.
Now you are ready to start your Hadoop cluster in one of the three supported modes:
- Local (Standalone) Mode
- Pseudo-Distributed Mode
- Fully-Distributed Mode
Standalone Operation
By default, Hadoop is configured to run in a non-distributed mode, as a single Java process. This is useful for debugging.
The following example copies the unpacked conf directory to use as input and then finds and displays every match of the given regular expression. Output is written to the given output directory.
$ mkdir input
$ cp conf/*.xml input
$ bin/hadoop jar hadoop-examples-*.jar grep input output 'dfs[a-z.]+'
$ cat output/*
Pseudo-Distributed Operation
Hadoop can also be run on a single-node in a pseudo-distributed mode where each Hadoop daemon runs in a separate Java process.
Configuration
Use the following:
conf/core-site.xml:
<configuration> <property> <name>fs.default.name</name> <value>hdfs://localhost:9000</value> </property> </configuration>
conf/hdfs-site.xml:
<configuration> <property> <name>dfs.replication</name> <value>1</value> </property> </configuration>
conf/mapred-site.xml:
<configuration> <property> <name>mapred.job.tracker</name> <value>localhost:9001</value> </property> </configuration>
Setup passphraseless ssh
Now check that you can ssh to the localhost without a passphrase:
$ ssh localhost
If you cannot ssh to localhost without a passphrase, execute the following commands:
$ ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa
$ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
Execution
Format a new distributed-filesystem:
$ bin/hadoop namenode -format
Start the hadoop daemons:
$ bin/start-all.sh
The hadoop daemon log output is written to the ${HADOOP_LOG_DIR} directory (defaults to ${HADOOP_HOME}/logs).
Browse the web interface for the NameNode and the JobTracker; by default they are available at:
- NameNode - http://localhost:50070/
- JobTracker - http://localhost:50030/
Copy the input files into the distributed filesystem:
$ bin/hadoop fs -put conf input
Run some of the examples provided:
$ bin/hadoop jar hadoop-examples-*.jar grep input output 'dfs[a-z.]+'
Examine the output files:
Copy the output files from the distributed filesystem to the local filesytem and examine them:
$ bin/hadoop fs -get output output
$ cat output/*
or
View the output files on the distributed filesystem:
$ bin/hadoop fs -cat output/*
When you're done, stop the daemons with:
$ bin/stop-all.sh
相关推荐
Hadoop安装教程_单机/伪分布式配置_Hadoop2.7.1/Ubuntu 16.04 本教程主要讲述了在 Ubuntu 16.04 环境下安装 Hadoop 2.7.1 的步骤,包括单机模式、伪分布式模式和分布式模式三种安装方式。以下是本教程的知识点总结...
【安装Hadoop(单机版和集群)步骤】 在IT领域,Hadoop是一个分布式计算框架,主要用于处理和存储海量数据。本教程将详细介绍如何在Ubuntu 12.10操作系统上安装Hadoop的单机版和集群版。首先,确保你已经在VMware...
下面将详细介绍Hadoop单机版的安装步骤及相关知识点。 1. **系统要求** 在开始安装前,确保你的操作系统是Linux或Windows,并且有足够的硬盘空间,至少8GB。推荐使用64位系统,因为Hadoop不支持32位。对于Linux,...
### Hadoop单机安装与集群安装相关知识点 #### 一、文档概述 本文档主要针对Hadoop的安装和配置过程进行了详细的说明,旨在简化Hadoop的部署流程。它覆盖了Hadoop单机安装以及集群安装的过程,并且适用于CentOS 5/...
实验主题:武汉理工大学云计算应用 - Hadoop单机模式与伪分布式 **实验目的与意义:** 本次实验旨在让学生理解并掌握Hadoop的两种基础运行模式:单机模式和伪分布式模式。Hadoop是云计算领域的重要组件,主要用于大...
【标题】:Ubuntu环境下Hadoop单机模式安装详解 【描述】:本文档详细介绍了如何在Ubuntu操作系统上从零开始安装Hadoop,包括Linux安装、创建Hadoop用户组和用户、JDK安装、修改机器名、SSH服务安装以及实现SSH无...
RedHat Linux 9.0 下 Hadoop 单机配置归类 ...本文档详细介绍了 Red Hat Linux 9.0 下 Hadoop 单机配置的步骤和要求,从 Hadoop 安装前提到 Hadoop 配置的详细步骤,帮助读者快速掌握 Hadoop 的安装和配置。
【Hadoop单机模式配置与安装详解】 在深入探讨Hadoop单机模式的配置与安装之前,首先要明白Hadoop是一个开源的分布式计算框架,由Java编写,因此在安装Hadoop之前,必须确保系统中已安装Java Development Kit (JDK)...
### Hadoop单机配置详解 在大数据处理领域,Apache Hadoop是一个开源软件框架,用于分布式存储和处理大型数据集。本文将详细介绍如何在单机环境下配置Hadoop,使其能够运行基本的大数据处理任务。 #### 一、配置...
#### 一、Hadoop单机系统版本安装配置 **1.1 配置前的准备工作** - **添加hadoop用户并设置密码:** - 在Linux环境下,首先需要创建一个专用的`hadoop`用户,并为其设置一个安全的密码,以便后续进行Hadoop的安装...
##### (六) Hadoop单机配置(非分布式) - **步骤**: 1. 运行示例程序,如grep示例。 2. 观察程序执行结果,验证Hadoop单机模式下的基本功能。 ##### (七) Hadoop伪分布式配置 - **步骤**: 1. 修改配置文件`...
接下来,我们将介绍如何在Hadoop单机版上安装HBase,一个基于列族的分布式数据库。 1. **下载HBase**:获取HBase的相应版本,与你的Hadoop版本兼容。 2. **配置HBase**:类似Hadoop,设置HBASE_HOME和HADOOP_CONF_...
"单机Hadoop配置安装教程" 单机Hadoop配置安装是Hadoop beginners的不二之选,本篇文章将详细指导您如何在Windows平台上安装和配置Hadoop-2.5.2。通过亲自实验和实践,本教程将带您掌握单机Hadoop配置安装的所有...
需要注意的是,Hadoop支持三种运行模式:单机单节点模式、单机多节点的伪分布模式和多机多节点分布模式。 二、Hadoop和Eclipse的结合 Hadoop可以与Eclipse集成,以便于项目的开发和调试。首先,需要下载Eclipse,...
本文档旨在详细介绍如何在单节点环境下安装、配置并运行Hadoop集群的过程。通过本教程的学习,读者将能够掌握在Ubuntu Linux系统上搭建单机Hadoop集群的基本步骤,包括环境准备、软件安装与配置、启动及测试等环节。...
本教程将指导你通过VirtualBox虚拟机软件,在Ubuntu操作系统上进行Hadoop单机部署,逐步深入理解大数据框架的基础架构和组件原理。 首先,我们需要下载虚拟机软件VirtualBox。访问官方网站,根据你的操作系统选择...
### Hadoop安装过程详解 #### 一、概述 Hadoop是一种能够处理大量数据的大规模分布式存储与计算框架,常用于构建大数据分析平台。本文档基于一位用户的实践经历,详细介绍了如何在虚拟机环境下安装和配置Hadoop的...