天天看點

cdh5.16 重新編譯flink1.10

文章目錄

    • 一.簡介
    • 二.環境
    • 三.flink-shaded
    • 四.flink
    • 五.測試
    • 六.下載下傳

Flink 1.10.0 正式宣告釋出!作為 Flink 社群迄今為止規模最大的一次版本更新,Flink 1.10 容納了超過 200 位貢獻者對超過 1200 個 issue 的開發實作,包含對 Flink 作業的整體性能及穩定性的顯著優化、對原生 Kubernetes 的初步內建以及對 Python 支援(PyFlink)的重大優化。

Flink 1.10 同時還标志着對 Blink[1] 的整合宣告完成,随着對 Hive 的生産級别內建及對 TPC-DS 的全面覆寫,Flink 在增強流式 SQL 處理能力的同時也具備了成熟的批處理能力。

jdk 1.8

scala 2.11

cdh 5.16.2

flink 1.10.0

maven 3.5

源碼

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

切換依賴的版本分支

git checkout release-9.0

修改 flink-shaded 項目中的 pom.xml,添加 CDH maven 倉庫,否則編譯時找不到 CDH 相關的包。

<profile>
<id>vendor-repos</id>
<activation>
<property>
<name>vendor-repos</name>
</property>
</activation>
<!-- Add vendor maven repositories -->
<repositories>
<!-- Cloudera -->
<repository>
<id>cloudera-releases</id>
<url>https://repository.cloudera.com/artifactory/cloudera-repos</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
</profile>
           

mvn clean install -DskipTests-Drat.skip=true -Pvendor-repos -Dhadoop.version=2.6.0-cdh5.16.2

wget https://codeload.github.com/apache/flink/tar.gz/release-1.10.0

可以修改 flink-runtime-web/pom.xml 檔案,添加 nodeDownloadRoot 和 npmDownload

<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeDownloadRoot>https://registry.npm.taobao.org/dist/</nodeDownloadRoot>
<npmDownloadRoot>https://registry.npmjs.org/npm/-/</npmDownloadRoot>
<nodeVersion>v10.9.0</nodeVersion>
</configuration>
</execution>
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>ci --cache-max=0 --no-save</arguments>
<environmentVariables>
<HUSKY_SKIP_INSTALL>true</HUSKY_SKIP_INSTALL>
</environmentVariables>
</configuration>
</execution>
<execution>
<id>npm run build</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>run build</arguments>
</configuration>
</execution>
</executions>
<configuration>
<workingDirectory>web-dashboard</workingDirectory>
</configuration>
</plugin>
           
Kafka Schema Registry相關maven庫配置
<mirror>
    <id>confluent</id>
    <mirrorOf>confluent</mirrorOf>
    <name>Nexus public mirror</name>
    <url>http://packages.confluent.io/maven/</url>
  </mirror>
           
删除flink中的以下test子產品,防止編譯出錯
<module>flink-tests</module>
<module>flink-end-to-end-tests</module>
<module>flink-yarn-tests</module>
<module>flink-fs-tests</module>
           
編譯

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