官术网_书友最值得收藏!

Setting up Hadoop v2 on your local machine

This recipe describes how to set up Hadoop v2 on your local machine using the local mode. Local mode is a non-distributed mode that can be used for testing and debugging your Hadoop applications. When running a Hadoop application in local mode, all the required Hadoop components and your applications execute inside a single Java Virtual Machine (JVM) process.

Getting ready

Download and install JDK 1.6 or a higher version, preferably the Oracle JDK 1.7. Oracle JDK can be downloaded from http://www.oracle.com/technetwork/java/javase/downloads/index.html.

How to do it...

Now let's start the Hadoop v2 installation:

  1. Download the most recent Hadoop v2 branch distribution (Hadoop 2.2.0 or later) from http://hadoop.apache.org/releases.html.
  2. Unzip the Hadoop distribution using the following command. You will have to change the x.x. in the filename to the actual release you have downloaded. From this point onward, we will call the unpacked Hadoop directory {HADOOP_HOME}:
    $ tar -zxvf hadoop-2.x.x.tar.gz
    
  3. Now, you can run Hadoop jobs through the {HADOOP_HOME}/bin/hadoop command, and we will elaborate on that further in the next recipe.

How it works...

Hadoop local mode does not start any servers but does all the work within a single JVM. When you submit a job to Hadoop in local mode, Hadoop starts a JVM to execute the job. The output and the behavior of the job is the same as a distributed Hadoop job, except for the fact that the job only uses the current node to run the tasks and the local filesystem is used for the data storage. In the next recipe, we will discover how to run a MapReduce program using the Hadoop local mode.

主站蜘蛛池模板: 保定市| 河东区| 哈密市| 元阳县| 山东| 新龙县| 黑龙江省| 安康市| 贺州市| 诸暨市| 商南县| 中宁县| 缙云县| 安宁市| 会泽县| 富平县| 长治市| 滨海县| 勃利县| 广饶县| 营山县| 台北市| 三河市| 苏尼特左旗| 鄯善县| 二手房| 乌拉特后旗| 松阳县| 阜康市| 喀什市| 修文县| 无棣县| 莆田市| 兴文县| 靖宇县| 理塘县| 清徐县| 县级市| 莱西市| 广河县| 仙游县|