您的位置:首页 > 运维架构

hadoop源码编译

2016-02-23 17:49 441 查看
1.下载源码

2.安装必要软件,并将下述软件的bin添加到path环境变量里

a).apache-maven-3.3.9

b).protobuf-2.5.0

c).winsdk7.1

d).getGnuWin32或cygwin(必装软件net下openssl、openssh)

e).cmake(非必须)

f).jdk1.6+

3.设置环境变量

JAVA_HOME,

M2_HOME,

Platform=x64(64位的设为x64,32位为x32)

4.注解掉${hadoop-src}\hadoop-common-project\hadoop-common中pom.xml的下面部分:

<!--    <plugin>

<groupId>org.codehaus.mojo</groupId>

<artifactId>exec-maven-plugin</artifactId>

<executions>

<execution>

<id>compile-ms-winutils</id>

<phase>compile</phase>

<goals>

<goal>exec</goal>

</goals>

<configuration>

<executable>msbuild</executable>

<arguments>

<argument>${basedir}/src/main/winutils/winutils.sln</argument>

<argument>/nologo</argument>

<argument>/p:Configuration=Release</argument>

<argument>/p:OutDir=${project.build.directory}/bin/</argument>

</arguments>

</configuration>

</execution>

<execution>

<id>compile-ms-native-dll</id>

<phase>compile</phase>

<goals>

<goal>exec</goal>

</goals>

<configuration>

<executable>msbuild</executable>

<arguments>

<argument>${basedir}/src/main/native/native.sln</argument>

<argument>/nologo</argument>

<argument>/p:Configuration=Release</argument>

<argument>/p:OutDir=${project.build.directory}/bin/</argument>

<argument>/p:CustomSnappyPrefix=${snappy.prefix}</argument>

<argument>/p:CustomSnappyLib=${snappy.lib}</argument>

<argument>/p:CustomSnappyInclude=${snappy.include}</argument>

<argument>/p:RequireSnappy=${require.snappy}</argument>

</arguments>

</configuration>

</execution>

</executions>

</plugin>-->


如果不注释的话,安装过程中会报错:

ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2:exec (compile-ms-winutils) on project hadoop-common: Command execution failed.


5.打开winsdk7.1的命令窗口Windows SDK 7.1 Command Prompt,进入hadoop源码目录,执行以下命令进行install:

mvn install -DskipTests


6.编译eclipse工程

mvn eclipse:eclipse -DdownloadSources=true -DdownloadJavadocs=true
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  hadoop 源码