问题导读
1.Flink编译中需要哪些条件?
2.编译中遇到了哪些问题?
3.编译Flink-1.10.1在什么pom中加入cloudera仓库?
前置条件
jdk
maven
nvm
源码编译
拉取flink1.10.1的代码后,idea中全局查找一下flink.shaded.version,确定应该选择的flink-shaded版本
编译flink-shaded
拉取代码
[mw_shl_code=bash,true]git clone -b release-9.0 https://github.com/apache/flink-shaded.git
[/mw_shl_code]
在pom中添加cloudera仓库
[mw_shl_code=bash,true]<repositories>
<repository>
<id>cloudera</id>
<url>https://repository.cloudera.com/ ... -repos/</url>
</repository>
</repositories>[/mw_shl_code]
执行编译命令指定hadoop版本为2.6.0-cdh5.16.2
编译Flink-1.10.1
在根pom中加入cloudera仓库
[mw_shl_code=xml,true]<repositories>
<repository>
<id>cloudera</id>
<url>https://repository.cloudera.com/ ... -repos/</url>
</repository>
</repositories>[/mw_shl_code]
找不到flink-avro-confluent-registry包
报错信息
[mw_shl_code=bash,true][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][/mw_shl_code]
手动下载包安装到maven本地仓库,下载链接:
http://packages.confluent.io/mav ... istry-client/4.1.0/
[mw_shl_code=text,true]wget http://packages.confluent.io/mav ... ry-client-4.1.0.jar
[/mw_shl_code]
下载之后安装到本地仓库
[mw_shl_code=bash,true]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[/mw_shl_code]
编译flink-runtime-web出现npm错误
在编译前端的时候,比较蛋疼,和之前的dolphinscheduler一样,如果遇到node-sass的问题,请参考DolphinScheduler开发环境搭建的文章,手工安装node-sass。
报错信息:
[mw_shl_code=bash,true]npm ci –cache-max=0 –no-save 错误
[/mw_shl_code]
修改flink-runtime-web的pom文件
[mw_shl_code=bash,true]# 将ci --cache-max=0 --no-save
修改为
# install -registry=https://registry.npm.taobao.org --cache-max=0 --no-save[/mw_shl_code]
编译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,运行命令
[mw_shl_code=bash,true]npm install @angular/cli
[/mw_shl_code]
ng命令测试
执行源码编译命令
[mw_shl_code=bash,true]mvn clean install -DskipTests -Dfast -Drat.skip=true \
-Dhaoop.version=2.6.0-cdh5.16.2 -Pvendor-repos \
-Dinclude-hadoop -Dscala-2.11 -T2C[/mw_shl_code]
源码编译成功
获取编译完成的包
flink-dist/flink-1.10.1-bin/flink-1.10.1
编译完成的包
链接: https://pan.baidu.com/s/1q03C08udQJfKJKpjYyQ2sQ 提取码: fcmp
原文链接
https://mp.weixin.qq.com/s/iZtVZN03qlE3Rn4Nj8O4ZA
|
|