一、下载flink
https://github.com/apache/flink/tree/master/flink-python
二、安装pyflink
yum install maven (安装maven-3.1.1以上版本)
https://ci.apache.org/projects/flink/flink-docs-master/flinkDev/building.html##Build%20Flink
cd flink-python
python setup.py install
三、报错处理
在Build Flink阶段,执行mvn clean install -DskipTests会报如下错误: (报错缺失flink-mapr-fs,需要手动下载安装。)
[ERROR] Failed to execute goal on project flink-mapr-fs: Could not resolve dependencies for project org.apache.flink:flink-mapr-fs:jar:1.6.2: Could not find artifact com.mapr.hadoop:maprfs:jar:5.2.1-mapr in nexus-osc
解决方法:
1.下载maprfsjar包通过手动下载maprfs-5.2.1-mapr.jar包,下载地址地址: https://repository.mapr.com/nexus/content/groups/mapr-public/com/mapr/hadoop/maprfs/5.2.1-mapr/
2.手动安装手动安装缺少的包到本地仓库
mvn install:install-file -DgroupId=com.mapr.hadoop -DartifactId=maprfs -Dversion=5.2.1-mapr -Dpackaging=jar -Dfile=D:/maprfs-5.2.1-mapr.jar
3.继续编译,使用maven继续编译flink(可以排除刚刚已经安装的包)
mvn clean install -DskipTests -Dfast -rf :flink-mapr-fs
4、如果报错:mapr包下面的org.apache.hadoop.fs找不到,把依赖添加进去。
vim flink-master/flink-filesystems/flink-mapr-fs/pom.xml 里面添加依赖
5、继续编译,如果此时还报org.apache.hadoop.fs, 直接把下载的maprfs-5.2.1-mapr.jar包复制到/root/.m2/repository/com/mapr/hadoop/maprfs/5.2.1-mapr/ 目录
6、继续编译,如果报错:flink-s3-fs-hadoop找不到,下载flink-s3-fs-hadoop-1.8.0.jar包,进行编译
mvn install:install-file -Dpackaging=jar -Dfile=D:/flink-s3-fs-hadoop-1.8.0.jar
下载地址 https://www.mvnjar.com/org.apache.flink/flink-s3-fs-hadoop/jar.html
7、从flink-s3-fs-hadoop开始编译
mvn clean install -DskipTests -Dfast -rf :flink-s3-fs-hadoop
8、如果还报错,把 flink-s3-fs-hadoop-1.8.0.jar 包复制进 /root/.m2/repository/org/apache/flink/flink-s3-fs-hadoop/1.8.0/ 目录,继续编译,如果报错,从新执行 mvn clean install -DskipTests -Dfast
参考链接:https://ci.apache.org/projects/flink/flink-docs-master/flinkDev/building.html##Build%20Flink #安装参考链接
参考链接:https://blog.csdn.net/zlz2017/article/details/89278614 # 报错参考链接
参考链接:https://www.jianshu.com/p/28408af981b9 # 报错参考链接
参考链接:https://blog.csdn.net/qq475781638/article/details/90260202 # 报错参考链接