Flink 1.10.1源码编译(CDH5.16.2)

1

文档编写目的

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

前置条件

  • jdk

  • maven 

  • nvm 

2

源码编译

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

编译flink-shaded

拉取代码

git clone -b release-9.0 https://github.com/apache/flink-shaded.git

在pom中添加cloudera仓库

<repositories>
 <repository>
     <id>cloudera</id>
     <url>https://repository.cloudera.com/artifactory/cloudera-repos/</url>
 </repository>
</repositories>

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

mvn clean install -DskipTests -Dhadoop.version=2.6.0-cdh5.16.2

编译Flink-1.10.1

在根pom中加入cloudera仓库

<repositories>
 <repository>
     <id>cloudera</id>
     <url>https://repository.cloudera.com/artifactory/cloudera-repos/</url>
 </repository>
</repositories>
找不到flink-avro-confluent-registry包

报错信息

[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/

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

下载之后安装到本地仓库

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。

报错信息:

npm ci –cache-max=0 –no-save 错误

修改flink-runtime-web的pom文件

# 将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,运行命令

npm install @angular/cli

ng命令测试

执行源码编译命令
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

点个“在看”表示朕

已阅

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值