集成目的
- 集成Flink HistoryServer至CDH(在CDH上运行的Flink程序,在程序结束后的任务均会显示在该角色实例的WebUI上)
- 集成Gateway(快捷命令,Flink配置分发)
- 集成Hive相关配置至CDH Flink
- 兼容Flink1.10 Flink1.11版本至CDH
- GitHub打包项目:https://github.com/EvenGui/flink-parcel-master
最终效果如图
源码编译
说明:因为我们需要与CDH集成,故Flink需要编译CDH的版本,以减少部署和使用过程中JAR冲突依赖的问题
编译环境准备
安装JDK1.8
(使用JDK1.8编译,JDK11编译Flink1.11时会停顿,卡住,且无任何提示信息)
安装Git
yum install git -y
安装Maven
wget http://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz
tar xzvf apache-maven-3.6.3-bin.tar.gz -C /usr/local/
mv /usr/local/apache-maven-3.6.3/ /usr/local/maven
vim /etc/profile
export M2_HOME=/usr/local/maven
export PATH=$PATH:$M2_HOME/bin:
source /etc/profile
mvn -v
vim /usr/local/maven/conf/setting.xml
修改以下参数
<localRepository>/opt/build_flink/mavenlib</localRepository>
<mirrors>
<mirror>
<id>alimaven</id>
<mirrorOf>central</mirrorOf>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
</mirror>
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>*,!cloudera</mirrorOf>
</mirror>
<mirror>
<id>central</id>
<name>Maven Repository Switchboard</name>
<url>http://repo1.maven.org/maven2/</url>
<mirrorOf>central</mirrorOf>
</mirror>
<mirror>
<id>repo2</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://repo2.maven.org/maven2/</url>
</mirror>
<mirror>
<id>ibiblio</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://mirrors.ibiblio.org/pub/mirrors/maven2/</url>
</mirror>
<mirror>
<id>jboss-public-repository-group</id>
<mirrorOf>central</mirrorOf>
<name>JBoss Public Repository Group</name>
<url>http://repository.jboss.org/nexus/content/groups/public</url>
</mirror>
<mirror>
<id>google-maven-central</id>
<name>Google Maven Central</name>
<url>https://maven-central.storage.googleapis.com
</url>
<mirrorOf>central</mirrorOf>
</mirror>
<!-- 中央仓库在中国的镜像 -->
<mirror>
<id>maven.net.cn</id>
<name>oneof the central mirrors in china</name>
<url>http://maven.net.cn/content/groups/public/</url>
<mirrorOf>central<