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源码下载 ...
随机推荐
- @component @bean区别
from: http://stackoverflow.com/questions/10604298/spring-component-versus-bean http://stackoverflow. ...
- Go笔记之一:工程项目结构的注意事项
Go笔记之一:工程项目结构的注意事项 对 Go 项目目录的理解 (Windows平台为例) 刚安装完的 Go 需要设定环境变量,最关键的环境变量有三个,GOROOT.GOPATH和GOBIN.GORO ...
- Linux时间子系统专题汇总
关于Linux时间子系统有两个系列文章讲的非常好,分别是WowoTech和DroidPhone. 还有两本书分别是介绍: Linux用户空间时间子系统<Linux/UNIX系统编程手册>的 ...
- 安装nginx和php
安装nginx 1.安装依赖包 yum -y install gcc-c++ pcre pcre-devel zlib zlib-devel openssl openssl-devel perl pe ...
- Libevent教程001: 简介与配置
本文内容大致翻译自 libevent-book, 但不是照本翻译. 成文时, libevent最新的稳定版为 2.1.8 stable. 即本文如无特殊说明, 所有描述均以 2.1.8 stable ...
- 常见性能优化策略的总结 good
阅读目录 代码 数据库 缓存 异步 NoSQL JVM调优 多线程与分布式 度量系统(监控.报警.服务依赖管理) 案例一:商家与控制区关系的刷新job 案例二:POI缓存设计与实现 案例三:业务运营后 ...
- springmvc配置详解 教程
https://www.cnblogs.com/sunniest/p/4555801.html
- LeetCode Javascript实现 344. Reverse String 292. Nim Game 371. Sum of Two Integers
344. Reverse String /** * @param {string} s * @return {string} */ var reverseString = function(s) { ...
- HTML5 CSS3 诱人的实例 :canvas 模拟实现电子彩票刮刮乐
转载请标明出处:http://blog.csdn.net/lmj623565791/article/details/34089553 今天给大家带来一个刮刮乐的小例子~基于HTML5 canvas的, ...
- 玩转spring mvc(四)---在spring MVC中整合JPA
关于在Spring MVC中整合JPA是在我的上一篇关于spring mvc基本配置基础上进行的,所以大家先参考一下我的上一篇文章:http://blog.csdn.net/u012116457/ar ...