日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪(fǎng)問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 运维知识 > windows >内容正文

windows

hadoop入门-在windows上编译x64位hadoop

發(fā)布時(shí)間:2025/3/21 windows 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 hadoop入门-在windows上编译x64位hadoop 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

環(huán)境

Windows 7 x64位,visual studio 2010 professional

hadoop 源碼版本2.2.0

步驟(來(lái)源于書(shū)《Pro Apache Hadoop, Second Edition》略作修改。

  • Ensure that JDK 1.6 is or higher is installed. We assume that it is installed in the c:/MyApps/jdkl6/ folder, which should have a bin subfolder.
  • Download the hadoop-2.2.x-src.tar.gz files (2.2.0 at the time of this writing) from the download section of the Apache web site for Hadoop. The download link is as follows: http://www.apache.org/dist/hadoop/core/hadoop-2.2.0/hadoop-2.2.0-src.tar.gz.

  • Explode the tar file into a directory. For the purpose of this section, we assume that the directory is called c:/myapps/hadoop/.

  • If using Visual Studio, use Visual Studio 2010 Professional (not 2012). Do not use Visual Studio Express because it does not support compiling for 64-bit, which presents problems if running on a 64-bit system. Alternatively, download the Microsoft Windows SDK v7.1. At the time of writing, the link is the following:

    http://www.microsoft.com/en-us/download/confirmation.aspx?id=8279.

  • Place the SDK in the folder with full privileges. For this section, we assume that the folder is c:/myapps/winsdk71/.

  • Download and install the Linux-like environment for Windows named Cygwin. We assume that Cygwin home folder is c:/myapps/cygwin/. Ensure that the following UNIX command-line tools are installed: sh, mkdir, rm, cp, tar, and gzip. The download location for Cygwin is http://cygwin.com/install.html.

  • Download and install Maven 3.1.1 or a compatible version. Installation consists of simply exploding the tar bundle into a Windows folder. We assume that the home folder for Maven download is c:/MyApps/apache-maven-3.1.1/. Verify that this folder has the bin subfolder.

  • Download and install Protocol Buffers 2.5.0. At the time of writing, the link is http://protobuf.googlecode.com/files/protoc-2.5.0-win32.zip.

  • Simply unzip the zip file into a folder (assumed to be c:/MyApps/protobuf/). Verify that the installation is correct by ensuring that the folder contains the protoc.exe file.

  • Install ZLIB from http://zlib.net/zlib128-dll.zip and explode the zip file in the c:/zlib-1.2.8 folder. At runtime, this folder must be accessible from the PATH variable.

  • Add the environment variables shown in Table A-1.



  • Table A-1: Environment Variables for Windows

    Environment Variable

    Value

    JAVA_HOME

    c:/MyApps/jdk16/

    M2_HOME

    c:/MyApps/apache-maven-3.1.1/

    Platform

    x64 (or Win32 when building on the 32-bit system)

    CYGWIN_HOME

    c:/myapps/cygwin/

    PROTOBUF_HOME

    c:/myapps/protobuf/

    ZLIB_HOME

    c:/zlib-1.2.8


    12 .Add the following to the Windows PATH variable:

    • %JAVA_HOME%/bin/

    • %CYGWIN_HOME%/bin/

    • %M2_HOME%/bin/

    • %PROTOBUF_HOME%

    • %ZLIB_HOME

    開(kāi)始編譯,執(zhí)行下面的步驟:

    hadoop 2.2.0在編譯的時(shí)候有一個(gè)bug,參考https://issues.apache.org/jira/browse/HADOOP-10110描述,然后下載https://issues.apache.org/jira/secure/attachment/12614482/HADOOP-10110.patch這個(gè)patch,按照這個(gè)patch修改hadoop-common-project/hadoop-auth/pom.xml文件,然后再進(jìn)行編譯,否則會(huì)出錯(cuò)。

  • Go to the Windows Start All Programs Microsoft Windows SDK v7.1 and start the Windows SDK 7.1 command prompt in Run As Administrator mode.
    • Change the folder to c:/MyApps/hadoop. Recall that this is the folder in which the Hadoop source was placed.

  • Execute the following command mvn package with the -Pdist,native-win -DskipTests -Dtar options. The exact command is this:

    mvn package -Pdist,native-win -DskipTests –Dtar
  • If there are no errors, the hadoop-2.2.0.tar.gz file is created in the c:/myapps/hadoop/ hadoop-dist/hadoop-2.2.0/ folder.

  • 編譯完后,如果沒(méi)有任何錯(cuò)誤,在hadoop-2.2.0-src\hadoop-dist\target目錄下面會(huì)生成hadoop-2.2.0.tar.gz文件。

    第一步大功告成!


    

    總結(jié)

    以上是生活随笔為你收集整理的hadoop入门-在windows上编译x64位hadoop的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

    如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。