Flink1.12版本编译 on Mac
最近编译了一下flink 1.12,总结一下遇到的坑~
编译源码
流程参照Apache Flink 1.12 Documentation: Building Flink from Source.
-
确保安装有JDK以及Maven
-
安装Java8
brew cask install adoptopenjdk/openjdk/adoptopenjdk8
-
安装Maven
brew install maven
-
-
按照官网教程操作
To clone from git, enter:
git clone https://github.com/apache/flink
The simplest way of building Flink is by running:
mvn clean install -DskipTests
This instructs Maven (
mvn
) to first remove all existing builds (clean
) and then create a new Flink binary (install
).To speed up the build you can skip tests, QA plugins, and JavaDocs:
mvn clean install -DskipTests -Dfast
一些可能的坑
安装完成之后,按照Apache Flink 1.12 Documentation: Local Installation进行WordCount测试时,如果flink UI默认使用的8081端口被其他进程如防火墙占用,测试程序一般会报错。这个时候需要设置下端口:
打开flink-conf.yaml
文件,修改rest.port
的值如设为8082。
重启flink cluster即可正常运行WordCount