-
配置java,maven等环境变量
java:
export JAVA_HOME=/usr/local/java export PATH=$JAVA_HOME/bin:$PATH export CLASSPATH=$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tool.jar:$CLASSPATH
maven:
export MVN_HOME=/usr/local/maven export PATH=$MVN_HOME/bin:$PATH
-
下载制作Parcel包和CSD文件的脚本
[root@node01 cloudera]# git clone https://github.com/Git-Charles/flink-parcel.git
-
修改配置文件 flink-parcel.properties
#flink 下载地址 # https://mirrors.tuna.tsinghua.edu.cn/apache/flink/flink-1.9.2/ FLINK_URL=https://mirrors.tuna.tsinghua.edu.cn/apache/flink/flink-1.9.2/flink-1.9.2-bin-scala_2.12.tgz #flink版本号 FLINK_VERSION=1.9.2 #扩展版本号 EXTENS_VERSION=BIN-SCALA_2.12 #操作系统版本,以centos为例 OS_VERSION=7 #CDH 小版本 CDH_MIN_FULL=5.2 CDH_MAX_FULL=6.4 #CDH大版本 CDH_MIN=5 CDH_MAX=6
-
制作 Flink 的Parcel包和CSD文件并校验
[root@node01 cloudera]# cd flink-parcel [root@node01 flink-parcel]# chomd 755 bulid.sh;bash bulid.sh parcel ... + java -jar cm_ext/validator/target/validator.jar -f ./FLINK-1.9.2-BIN-SCALA_2.12_build/FLINK-1.9.2-BIN-SCALA_2.12-el7.parcel Validating: ./FLINK-1.9.2-BIN-SCALA_2.12_build/FLINK-1.9.2-BIN-SCALA_2.12-el7.parcel Validating: FLINK-1.9.2-BIN-SCALA_2.12/meta/parcel.json Validating: FLINK-1.9.2-BIN-SCALA_2.12/meta/permissions.json Validation succeeded. + python cm_ext/make_manifest/make_manifest.py ./FLINK-1.9.2-BIN-SCALA_2.12_build Scanning directory: ./FLINK-1.9.2-BIN-SCALA_2.12_build Found parcel FLINK-1.9.2-BIN-SCALA_2.12-el7.parcel + sha1sum ./FLINK-1.9.2-BIN-SCALA_2.12_build/FLINK-1.9.2-BIN-SCALA_2.12-el7.parcel + awk '{print $1}' [root@node01 flink-parcel]# bash build.sh csd_on_yarn ... Validating: flink_csd_build/descriptor/service.sdl Validation succeeded. + jar -cvf ./FLINK_ON_YARN-1.9.2.jar -C flink_csd_build . added manifest adding: descriptor/(in = 0) (out= 0)(stored 0%) adding: descriptor/.service.sdl.swo(in = 16384) (out= 2429)(deflated 85%) adding: descriptor/service.sdl(in = 6556) (out= 1772)(deflated 72%) adding: images/(in = 0) (out= 0)(stored 0%) adding: images/flink.png(in = 1523) (out= 1372)(deflated 9%) adding: scripts/(in = 0) (out= 0)(stored 0%) adding: scripts/control.sh(in = 3025) (out= 1070)(deflated 64%) [root@node01 flink-parcel]# bash build.sh csd_standalone ... + java -jar cm_ext/validator/target/validator.jar -s flink_csd_build/descriptor/service.sdl -l 'SPARK_ON_YARN SPARK2_ON_YARN' Validating: flink_csd_build/descriptor/service.sdl Validation succeeded. + jar -cvf ./FLINK-1.9.2.jar -C flink_csd_build . added manifest adding: descriptor/(in = 0) (out= 0)(stored 0%) adding: descriptor/.service.sdl.swo(in = 16384) (out= 2429)(deflated 85%) adding: descriptor/service.sdl(in = 5460) (out= 1552)(deflated 71%) adding: descriptor/wget-log(in = 3482) (out= 328)(deflated 90%) adding: images/(in = 0) (out= 0)(stored 0%) adding: images/flink.png(in = 1523) (out= 1372)(deflated 9%) adding: scripts/(in = 0) (out= 0)(stored 0%) adding: scripts/control.sh(in = 2307) (out= 770)(deflated 66%)
-
查看Parcel包和csd文件
[root@node01 flink-parcel]# ll | grep jar -rw-rw-r-- 1 hdb hdb 7737 Apr 17 12:59 FLINK-1.9.2.jar -rw-rw-r-- 1 hdb hdb 7799 Apr 17 12:58 FLINK_ON_YARN-1.9.2.jar [root@node01 flink-parcel]# ll FLINK-1.9.2-BIN-SCALA_2.12_build/ total 240424 -rw-rw-r-- 1 hdb hdb 246182815 Apr 17 12:13 FLINK-1.9.2-BIN-SCALA_2.12-el7.parcel -rw-rw-r-- 1 hdb hdb 41 Apr 17 12:13 FLINK-1.9.2-BIN-SCALA_2.12-el7.parcel.sha -rw-rw-r-- 1 hdb hdb 578 Apr 17 12:13 manifest.json
如遇到打包问题,请参考 https://blog.csdn.net/weixin_43215250/article/details/90406232 中的解决办法。