文档编写目的
2
源码编译
拉取flink1.10.1的代码后,idea中全局查找一下flink.shaded.version,确定应该选择的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
在根pom中加入cloudera仓库
<repositories>
<repository>
<id>cloudera</id>
<url>https://repository.cloudera.com/artifactory/cloudera-repos/</url>
</repository>
</repositories>
报错信息
[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
在编译前端的时候,比较蛋疼,和之前的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
说明在编译机上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