flink源码编译(windows环境)
前言
最新开始捣鼓flink,fucking the code之前,编译是第一步。
编译环境
win7 java maven
编译步骤
https://ci.apache.org/projects/flink/flink-docs-release-1.6/start/building.html 官方文档搞起,如下:
Building Flink from Source
This page covers how to build Flink 1.6.1 from sources.
Build Flink
In order to build Flink you need the source code. Either download the source of a release or clone the git repository.
In addition you need Maven 3 and a JDK (Java Development Kit). Flink requires at least Java 8 to build.
NOTE: Maven 3.3.x can build Flink, but will not properly shade away certain dependencies. Maven 3.2.5 creates the libraries properly. To build unit tests use Java 8u51 or above to prevent failures in unit tests that use the PowerMock runner.
To clone from git, enter:
git clone https://github.com/apache/flink
The simplest way of building Flink is by running:
mvn clean install -DskipTests
This instructs Maven (mvn
) to first remove all existing builds (clean
) and then create a new Flink binary (install
).
To speed up the build you can skip tests, QA plugins, and JavaDocs:
mvn clean install -DskipTests -Dfast
The default build adds a Flink-specific JAR for Hadoop 2, to allow using Flink with HDFS and YARN.
Dependency Shading
Flink shades away some of the libraries it uses, in order to avoid version clashes with user programs that use different versions of these libraries. Among the shaded libraries are Google Guava, Asm, Apache Curator, Apache HTTP Components, Netty, and others.
The dependency shading mechanism was recently changed in Maven and requires users to build Flink slightly differently, depending on their Maven version:
Maven 3.0.x, 3.1.x, and 3.2.x It is sufficient to call mvn clean install -DskipTests
in the root directory of Flink code base.
Maven 3.3.x The build has to be done in two steps: First in the base directory, then in the distribution project:
mvn clean install -DskipTests
cd flink-dist
mvn clean install
Note: To check your Maven version, run mvn --version
.
Hadoop Versions
Info Most users do not need to do this manually. The download page contains binary packages for common Hadoop versions.
Flink has dependencies to HDFS and YARN which are both dependencies from Apache Hadoop. There exist many different versions of Hadoop (from both the upstream project and the different Hadoop distributions). If you are using a wrong combination of versions, exceptions can occur.
Hadoop is only supported from version 2.4.0 upwards. You can also specify a specific Hadoop version to build against:
mvn clean install -DskipTests -Dhadoop.version=2.6.1
Vendor-specific Versions 指定hadoop发行商
To build Flink against a vendor specific Hadoop version, issue the following command:
mvn clean install -DskipTests -Pvendor-repos -Dhadoop.version=2.6.1-cdh5.0.0
The -Pvendor-repos
activates a Maven build profile that includes the repositories of popular Hadoop vendors such as Cloudera, Hortonworks, or MapR.
官网给出的是指定cdh发行商的版本,这里我给出一个hdp发行商的版本
mvn clean in
s
tall -DskipTests -Pvendor-repos -Dhadoop.versio
n
=
2.7.3.2.6.1.114-2
详细的版本信息可以从http://repo.hortonworks.com/content/repositories/releases/org/apache/hadoop/hadoop-common/查看
Scala Versions
Info Users that purely use the Java APIs and libraries can ignore this section.
Flink has APIs, libraries, and runtime modules written in Scala. Users of the Scala API and libraries may have to match the Scala version of Flink with the Scala version of their projects (because Scala is not strictly backwards compatible).
Flink 1.4 currently builds only with Scala version 2.11.
We are working on supporting Scala 2.12, but certain breaking changes in Scala 2.12 make this a more involved effort. Please check out this JIRA issue for updates.
Encrypted File Systems
If your home directory is encrypted you might encounter a java.io.IOException: File name too long
exception. Some encrypted file systems, like encfs used by Ubuntu, do not allow long filenames, which is the cause of this error.
The workaround is to add:
<args>
<arg>-Xmax-classfile-name</arg>
<arg>128</arg>
</args>
in the compiler configuration of the pom.xml
file of the module causing the error. For example, if the error appears in the flink-yarn
module, the above code should be added under the <configuration>
tag of scala-maven-plugin
. See this issue for more information.
编译结果
flink\flink-dist\target\flink-1.6.0-bin\flink-1.6.0下会有编译结果
flink源码编译(windows环境)的更多相关文章
- HBase-2.2.3源码编译-Windows版
源码环境一览 windows: 7 64Bit Java: 1.8.0_131 Maven:3.3.9 Git:2.24.0.windows.1 HBase:2.2.3 Hadoop:2.8.5 下载 ...
- 终于完成了 源码 编译lnmp环境
经过了大概一个星期的努力,终于按照海生的编译流程将lnmp环境源码安装出来了 nginx 和php 主要参考 http://hessian.cn/p/1273.html mysql 主要参考 http ...
- 查看android源码,windows环境下载源码
查看源码 参考: http://blog.csdn.net/janronehoo/article/details/8560304 步骤: 添加chrome插件 Android SDK Search 进 ...
- python在windows(双版本)及linux(源码编译)环境下安装
python下载 下载地址:https://www.python.org/downloads/ 可以下载需要的版本,这里选择2.7.12和3.6.2 下面第一个是linux版本,第二个是windows ...
- git在windows及linux(源码编译)环境下安装
git在windows下安装 下载地址:https://git-scm.com/ 默认安装即可 验证 git --version git在linux下安装 下载地址:https://mirrors.e ...
- TensorFlow Python2.7环境下的源码编译(一)环境准备
参考: https://blog.csdn.net/yhily2008/article/details/79967118 https://tensorflow.google.cn/install/in ...
- TensorFlow Python3.7环境下的源码编译(一)环境准备
参考: https://blog.csdn.net/yhily2008/article/details/79967118 https://tensorflow.google.cn/install/in ...
- vcmi(魔法门英雄无敌3 - 开源复刻版) 源码编译
vcmi源码编译 windows+cmake+mingw ##1 准备 HoMM3 gog.com CMake 官网 vcmi 源码 下载 QT5 with mingw 官网 Boost 源码1.55 ...
- 麒麟系统开发笔记(三):从Qt源码编译安装之编译安装Qt5.12
前言 上一篇,是使用Qt提供的安装包安装的,有些场景需要使用到从源码编译的Qt,所以本篇如何在银河麒麟系统V4上编译Qt5.12源码. 银河麒麟V4版本 系统版本: Qt源码下载 ...
随机推荐
- 网络编程之非阻塞connect编写
一.connect非阻塞编写 TCP连接的建立涉及到一个三次握手的过程,且socket中connect函数需要一直等到客户接收到对于自己的SYN的ACK为止才返回, 这意味着每 个connect函数总 ...
- 使用Python分析ELF文件优化Flash和Sram空间的案例
1. 背景 Zephyr项目Flash和Ram空间比较紧张,有着非常强烈的优化需求. 优化的前提是量化标的,那么如何量化Flash和Ram的使用量呢? 在量化之后,首先要对量化结果进行分析,然后采取措 ...
- Thread部分总结以及小例子
Thread总结:一直以来用thread比较多,一般会在同步以及ui中用到.以下对于经常用作为简单介绍.一 实现方法: 一种直接new thread,另外一种是实现Runnable接口,在创建thre ...
- tkinter简介(一)
Tkinter(也叫 Tk 接口)是 Tk 图形用户界面工具包标准 的 Python 接口.Tk 是一个轻量级的跨平台图形用户界面 (GUI)开发工具. Tk 和 Tkinter 可以运行在大多数 的 ...
- Eclipse 4.2 安装Java反编译插件
在eclipse下安装反编译插件可以直接查看 .class 文件对应的java源码. 反编译插件有 jdeclipse 和 jadeclipse. (1) jdeclipse http://www.d ...
- composer的安装方法
网上说的方法几乎都不正确,经作者总结,终于知道怎么使用composer的方法.第一,从http://docs.phpcomposer.com/下载安装包:composer.phar 第二,把安装包放在 ...
- OpenGL渲染管线(rendering pipeline)
OpenGL中的渲染管线包括:顶点着色器(vertex shader).细分着色器(里面包含两种:细分控制着色器和细分控制着色器)(tessellation shader).几何着色器.光栅化及片元着 ...
- bzoj 1210 [HNOI2004] 邮递员 插头dp
插头dp板子题?? 搞了我一晚上,还tm全是抄的标程.. 还有高精,哈希混入,还是我比较弱,orz各种dalao 有不明白的可以去看原论文.. #include<cstdio> #incl ...
- [NOIP2016]愤怒的小鸟 D2 T3
Description Kiana最近沉迷于一款神奇的游戏无法自拔. 简单来说,这款游戏是在一个平面上进行的. 有一架弹弓位于(0,0)处,每次Kiana可以用它向第一象限发射一只红色的小鸟,小鸟们的 ...
- 用Fundebug插件记录网络请求异常
在服务端,不管我们使用Node.js.Java.PHP还是Python等等,都会用日志以文本的形式记录请求以及报错信息.这个对于后端做事后分析是很有用的. 另一方面,前端有时候出问题其实是因为后端接口 ...