前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Flink 1.10.1源码编译(CDH5.16.2)

Flink 1.10.1源码编译(CDH5.16.2)

作者头像
Eights
发布2020-07-10 12:01:14
1.8K0
发布2020-07-10 12:01:14
举报
文章被收录于专栏:Eights做数据

1

文档编写目的

  • Flink1.10.1版本编译集成CDH5.16.2

前置条件

  • jdk
  • maven
  • nvm

2

源码编译

拉取flink1.10.1的代码后,idea中全局查找一下flink.shaded.version,确定应该选择的flink-shaded版本

编译flink-shaded

拉取代码

代码语言:javascript
复制
git clone -b release-9.0 https://github.com/apache/flink-shaded.git

在pom中添加cloudera仓库

代码语言:javascript
复制
<repositories>
 <repository>
     <id>cloudera</id>
     <url>https://repository.cloudera.com/artifactory/cloudera-repos/</url>
 </repository>
</repositories>

执行编译命令指定hadoop版本为2.6.0-cdh5.16.2

代码语言:javascript
复制
mvn clean install -DskipTests -Dhadoop.version=2.6.0-cdh5.16.2

编译Flink-1.10.1

在根pom中加入cloudera仓库

代码语言:javascript
复制
<repositories>
 <repository>
     <id>cloudera</id>
     <url>https://repository.cloudera.com/artifactory/cloudera-repos/</url>
 </repository>
</repositories>
找不到flink-avro-confluent-registry包

报错信息

代码语言:javascript
复制
[ERROR] Failed to execute goal on project flink-avro-confluent-registry:
Could not resolve dependencies for project org.apache.flink:flink-avro-confluent-registry:jar:1.8-SNAPSHOT:
Could not find artifact io.confluent:kafka-schema-registry-client:jar:4.1.0 in nexus-aliyun
(http://maven.aliyun.com/nexus/content/groups/public) -> [Help 1]

手动下载包安装到maven本地仓库,下载链接:

http://packages.confluent.io/maven/io/confluent/kafka-schema-registry-client/4.1.0/

代码语言:javascript
复制
wget http://packages.confluent.io/maven/io/confluent/kafka-schema-registry-client/4.1.0/kafka-schema-registry-client-4.1.0.jar

下载之后安装到本地仓库

代码语言:javascript
复制
mvn install:install-file -DgroupId=io.confluent \
-DartifactId=kafka-schema-registry-client -Dversion=4.1.0 \
-Dpackaging=jar -Dfile=/Users/jackbin/maven-jars/kafka-schema-registry-client-4.1.0.jar
编译flink-runtime-web出现npm错误

在编译前端的时候,比较蛋疼,和之前的dolphinscheduler一样,如果遇到node-sass的问题,请参考DolphinScheduler开发环境搭建的文章,手工安装node-sass。

报错信息:

代码语言:javascript
复制
npm ci –cache-max=0 –no-save 错误

修改flink-runtime-web的pom文件

代码语言:javascript
复制
# 将ci --cache-max=0 --no-save
修改为
# install -registry=https://registry.npm.taobao.org --cache-max=0 --no-save
编译flink-runtime-web出现sh ng : command not found

说明在编译机上angular没有进行全局安装,在执行ng命令的时候找不到命令。

解决方案参考:

https://medium.com/@angela.amarapala/ways-to-fix-bash-ng-command-not-found-7f329745795

在编译机器上指定使用flink-runtime-web/web-dashboard下的npm,运行命令

代码语言:javascript
复制
npm install @angular/cli

ng命令测试

执行源码编译命令
代码语言:javascript
复制
mvn clean install -DskipTests -Dfast -Drat.skip=true \
-Dhaoop.version=2.6.0-cdh5.16.2 -Pvendor-repos \
-Dinclude-hadoop -Dscala-2.11 -T2C

源码编译成功

获取编译完成的包

flink-dist/flink-1.10.1-bin/flink-1.10.1

3

编译完成的包

链接:https://pan.baidu.com/s/1MleYKwuOH5xw31hTm56SZQ

提取码:fmbl

本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2020-06-15,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 Eights做数据 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 1
  • 前置条件
    • 编译flink-shaded
      • 编译Flink-1.10.1
        • 找不到flink-avro-confluent-registry包
        • 编译flink-runtime-web出现npm错误
        • 编译flink-runtime-web出现sh ng : command not found
        • 执行源码编译命令
        • 获取编译完成的包
    相关产品与服务
    大数据
    全栈大数据产品,面向海量数据场景,帮助您 “智理无数,心中有数”!
    领券
    问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档