CDH 6.3.2 Parcel 包安装 Apache Flink 1.10.2
文档材料
介质路径
调整 Maven 配置文件
cp /data/maven/apache-maven-3.6.3/conf/settings.xml /data/maven/apache-maven-3.6.3/conf/settings.xml.orig
< ! -- flink 源码编译-->
< 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> central< /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< /mirrorOf>
< /mirror>
编译 Flink
1. 创建服务目录
mkdir -p /data/flink
2. 下载介质
wget https://archive.apache.org/dist/flink/flink-shaded-10.0/flink-shaded-10.0-src.tgz -P /data/flink
wget https://archive.apache.org/dist/flink/flink-1.10.2/flink-1.10.2-bin-scala_2.12.tgz -P /data/flink
3. 编译 Flink Shaded
tar -xzf /data/flink/flink-shaded-10.0-src.tgz -C /data/flink
cp /data/flink/flink-shaded-10.0/pom.xml /data/flink/flink-shaded-10.0/pom.xml.orig
< profile>
< id> java11 < /id>
< activation>
< jdk> 1 1 < /jdk>
< /activation>
< 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>
< ! -- Hortonworks -->
< repository>
< id> HDPReleases< /id>
< name> HDP Releases< /name>
< url> https://repo.hortonworks.com/content/repositories/releases/< /url>
< snapshots> < enabled> false< /enabled> < /snapshots>
< releases> < enabled> true< /enabled> < /releases>
< /repository>
< repository>
< id> HortonworksJettyHadoop< /id>
< name> HDP Jetty< /name>
< url> https://repo.hortonworks.com/content/repositories/jetty-hadoop< /url>
< snapshots> < enabled> false< /enabled> < /snapshots>
< releases> < enabled> true< /enabled> < /releases>
< /repository>
< ! -- MapR -->
< repository>
< id> mapr-releases< /id>
< url> https://repository.mapr.com/maven/< /url>
< snapshots> < enabled> false< /enabled> < /snapshots>
< releases> < enabled> true< /enabled> < /releases>
< /repository>
< /repositories>
< /profile>
cd /data/flink/flink-shaded-10.0/ && mvn clean install -DskipTests -Pvendor-repos -Dhadoop.version = 3.0 .0-cdh6.3.2 -Dscala-2.12 -Drat.skip = true -T10C
制作 Pacel 包
git clone https://github.com/pkeropen/flink-parcel.git
cp /data/flink/flink-1.10.2-bin-scala_2.12.tgz /data/flink/flink-parcel/
cp /data/flink/flink-parcel/flink-parcel.properties /data/flink/flink-parcel/flink-parcel.properties.orig
cat > /data/flink/flink-parcel/flink-parcel.properties << EOF
# FLINK 下载地址
FLINK_URL=https://mirrors.tuna.tsinghua.edu.cn/apache/flink/flink-1.10.2/flink-1.10.2-bin-scala_2.12.tgz
# Flink 版本号
FLINK_VERSION=1.10.2
# 扩展版本号
EXTENS_VERSION=BIN-SCALA_2.12
# 操作系统版本,以centos为例
OS_VERSION=7
# CDH 小版本
CDH_MIN_FULL=5.2
CDH_MAX_FULL=6.3.3
# CDH大版本
CDH_MIN=5
CDH_MAX=6
EOF
chmod +x build.sh
sh build.sh parcel
sh build.sh csd_on_yarn
sh build.sh csd_standalone
ll /data/flink/flink-parcel
-rwxr-xr-x 1 root root 5863 Nov 27 14 :50 build.sh
drwxr-xr-x 6 root root 142 Nov 27 15 :03 cm_ext
drwxr-xr-x 4 root root 29 Nov 27 15 :31 FLINK-1.10.2-BIN-SCALA_2.12
drwxr-xr-x 2 root root 123 Nov 27 15 :31 FLINK-1.10.2-BIN-SCALA_2.12_build
-rw-r--r-- 1 root root 280626150 Nov 27 14 :52 flink-1.10.2-bin-scala_2.12.tgz
-rw-r--r-- 1 root root 7737 Nov 27 15 :40 FLINK-1.10.2.jar
drwxr-xr-x 5 root root 53 Nov 27 15 :40 flink_csd_build
drwxr-xr-x 5 root root 53 Nov 27 14 :50 flink-csd-on-yarn-src
drwxr-xr-x 5 root root 53 Nov 27 14 :50 flink-csd-standalone-src
-rw-r--r-- 1 root root 8260 Nov 27 15 :40 FLINK_ON_YARN-1.10.2.jar
-rw-r--r-- 1 root root 350 Nov 27 14 :55 flink-parcel.properties
-rw-r--r-- 1 root root 346 Nov 27 14 :53 flink-parcel.properties.orig
drwxr-xr-x 3 root root 85 Nov 27 14 :50 flink-parcel-src
-rw-r--r-- 1 root root 11357 Nov 27 14 :50 LICENSE
-rw-r--r-- 1 root root 4334 Nov 27 14 :50 README.md
配置 Flink Parcel
1. 节点配置
scp FLINK-1.10.2.jar FLINK_ON_YARN-1.10.2.jar root@cloudera-scm-server:/opt/cloudera/csd
ln -s /data/flink/flink-parcel/FLINK-1.10.2-BIN-SCALA_2.12_build /var/www/html/flink1.10.2
ll /var/www/html/flink1.10.2/
-rw-r--r-- 1 root root 280629521 Nov 27 15 :47 FLINK-1.10.2-BIN-SCALA_2.12-el7.parcel
-rw-r--r-- 1 root root 41 Nov 27 15 :47 FLINK-1.10.2-BIN-SCALA_2.12-el7.parcel.sha
-rw-r--r-- 1 root root 583 Nov 27 15 :47 manifest.json
cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.orig
AddType application/x-gzip .gz .tgz .parcel
systemctl restart httpd
curl http://${httpd_server_ip} /flink1.10.
2. CM Web UI,选择 Parcel 配置,添加 http://${httpd_server_ip}/flink1.10.2
3. Parcel 中将会识别 Flink Parcel 包
4. 下载 => 分配 => 激活 Parcel 包
部署 Flink 服务
1. 重启 cloudera-scm-server 服务
systemctl restart cloudera-scm-server
2. 将 Flink Shaded 存入指定路径
cp /data/flink/flink-shaded-10.0/flink-shaded-hadoop-2-parent/flink-shaded-hadoop-2-uber/target/flink-shaded-hadoop-2-uber-3.0.0-cdh6.3.2-10.0.jar /opt/cloudera/parcels/FLINK/lib/flink/lib/
3. 按流程完成 Flink 部署(若未配置 kerberos,需将两项 kerberos 配置清空)
验证 Flink 服务
1. 查看 YARN 应用程序,存在驻留任务 “Flink session cluster”
2. 通过此任务信息,跳转至 Flink Dashbord