【Flink】第一节 源码编译

2023-11-06

我认识以及改造flink的第一步从下载编译源码开始

0、环境

idea

java 1.8

scala 2.12

flink 1.16

maven-setting(核心)

nodejs(这个去官网下载安装一下就好,npm -v 显示成功就好)

文末附有核心setting的配置

1、下载源码

由于网络问题,所以我是从gitee上进行代码的拉取

flink: Apache Flink 是高效和分布式的通用数据处理平台

2、idea 导入源码

 记住,导入源码后要检查四个问题:

idea plugin中scala是否设置了(可能会有网络问题,设置一下代理,代理如下,设置前ping一下,失效了再去搜一个对应网址地址,设置完毕后重启一下idea)

13.249.171.117 plugins.jetbrains.com
13.249.171.117 jetbrains.com

scala sdk环境是否设置了;

java sdk是否设置了;

maven 环境是否设置了

3、编译打包 

根目录下运行,运行完毕后可能要等30min左右(起码我是),然后最后会显示build sucess;假如有特殊需求需要跳过某一个,则可以执行 mvn -rf XXXModule

测试代码不能跳过编译,但可跳过执行

mvn install -Drat.skip=true -DskipTests -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dfast -T 4 -Dmaven.compile.fork=true

4、测试运行

运行exapmple中的stream-wordcount,测试编译等是否正常;正常会显示最终的wordcount结果,如下所示

在测试过程中可能会有问题,经常出现的一个问题是akka抛错,可以根据后面的提示进行解决,如下:

mvn clean package -pl flink-rpc/flink-rpc-akka,flink-rpc/flink-rpc-akka-loader -DskipTests

附件

setting文件-setting.xml

注意本地仓库的地址要记得修改为自己的地址,其他照搬即可

<?xml version="1.0" encoding="utf-8"?>
<settings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
  
    <!--本地仓库路径-->
  <localRepository>E:\maven-repository</localRepository>
   
    <!--注意:mirrorOf千万别为*,建议为profile的id-->
    <mirrors>
        <mirror>
            <id>aliyun-nexus</id>
            <name>aliyun-nexus</name>
            <mirrorOf>aliyun</mirrorOf>
            <url>http://maven.aliyun.com/nexus/content/groups/public</url>
        </mirror>
        <mirror>
            <id>huawei-nexus</id>
            <name>huawei-nexus</name>
            <mirrorOf>huawei</mirrorOf>
            <url>https://mirrors.huaweicloud.com/repository/maven/</url>
        </mirror>
        <mirror>
            <id>confluent-nexus</id>
            <name>confluent-nexus</name>
            <mirrorOf>confluent</mirrorOf>
            <url>https://packages.confluent.io/maven/</url>
        </mirror>
    </mirrors>
  
    <profiles>
        <profile>
            <id>aliyun</id>
            <repositories>
                <repository>
                    <id>aliyun-nexus</id>
                    <url>http://maven.aliyun.com/nexus/content/groups/public</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>
            </repositories>
            <pluginRepositories>
                <pluginRepository>
                    <id>aliyun-nexus</id>
                    <url>http://maven.aliyun.com/nexus/content/groups/public</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </pluginRepository>
            </pluginRepositories>
        </profile>
        <profile>
            <id>huawei</id>
            <repositories>
                <repository>
                    <id>huawei-nexus</id>
                    <url>https://mirrors.huaweicloud.com/repository/maven/</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>
            </repositories>
            <pluginRepositories>
                <pluginRepository>
                    <id>huawei-nexus</id>
                    <url>https://mirrors.huaweicloud.com/repository/maven/</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </pluginRepository>
            </pluginRepositories>
        </profile>
        <profile>
            <id>confluent</id>
            <repositories>
                <repository>
                    <id>confluent-nexus</id>
                    <url>https://packages.confluent.io/maven/</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>
            </repositories>
            <pluginRepositories>
                <pluginRepository>
                    <id>confluent-nexus</id>
                    <url>https://packages.confluent.io/maven/</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </pluginRepository>
            </pluginRepositories>
        </profile>
        <profile>
            <id>cdh</id>
            <repositories>
                <repository>
                    <id>cdh-nexus</id>
                    <releases>
                        <enabled>true</enabled>
                        <updatePolicy>never</updatePolicy>
                        <checksumPolicy>fail</checksumPolicy>
                    </releases>
                    <snapshots>
                        <enabled>false</enabled>
                        <updatePolicy>always</updatePolicy>
                        <checksumPolicy>warn</checksumPolicy>
                    </snapshots>
                    <name>Cloudera Repositories</name>
                    <url>https://repository.cloudera.com/artifactory/cloudera-repos</url>
                    <layout>default</layout>
                </repository>
            </repositories>
            <pluginRepositories>
                <pluginRepository>
                    <id>cdh-nexus</id>
                    <url>https://repository.cloudera.com/artifactory/cloudera-repos</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </pluginRepository>
            </pluginRepositories>
        </profile>
        <profile>
            <id>apache</id>
            <repositories>
                <repository>
                    <id>apache-nexus</id>
                    <releases>
                        <enabled>true</enabled>
                        <updatePolicy>never</updatePolicy>
                        <checksumPolicy>fail</checksumPolicy>
                    </releases>
                    <snapshots>
                        <enabled>false</enabled>
                        <updatePolicy>always</updatePolicy>
                        <checksumPolicy>warn</checksumPolicy>
                    </snapshots>
                    <name>apache Repositories</name>
                    <url>https://repository.apache.org/content/repositories/snapshots/</url>
                    <layout>default</layout>
                </repository>
            </repositories>
            <pluginRepositories>
                <pluginRepository>
                    <id>apache-nexus</id>
                    <url>https://repository.apache.org/content/repositories/snapshots/</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </pluginRepository>
            </pluginRepositories>
        </profile>
    </profiles>
  
    <!--设置默认配置文件-->
    <activeProfiles>
        <activeProfile>aliyun</activeProfile>
    </activeProfiles>
</settings>

参考:

1、flink编译过程中遇到的问题以及加速 https://blog.csdn.net/spark_dev/article/details/124008534 

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

【Flink】第一节 源码编译 的相关文章

  • numpy.arrange函数知识大全

    numpy arrange函数知识大全 numpy arrange函数作用 numpy arrange函数作用 numpy arrange函数的作用是生成带起点和终点的特定步长的排列 根据函数的参数的个数分为以下几种情况 1 只有一个参数
  • 使用Android studio 查看其它app的布局的结构

    日常开发过程中 难免会遇到一些比较好看的布局 这时候我们就想学习一下别人的布局结构 以便参考 如果是前端开发的话 直接用Chrome可以查看别人布局的结构 如果是android的就比较麻烦一些 不过也是可以的 只需要简单的两步 下面来演示一
  • 逻辑判断

    一 论证推理 1 1 基本原理 论证的基本原理 话题一致 例如 甲论证 中国足球不行 这个论点时 乙说 你行你上 这就是典型的话题不一致 因为 我足球行不行 和 国足行不行 是没有关系的 1 2 解题步骤 所有的论据都是为论点服务的 1 明
  • vs+qt添加qtOpengl时,要小写

    奇怪了 一开始添加模块时 写成了Opengl 是qmake错误 改成opengl就可以了

随机推荐

  • 一个简单的测试案例

    题目 有一个处理单价为5角钱的饮料的自动售货机软件测试用例的设计 其规格说明如下 若投入5角钱或1元钱的硬币 押下 橙汁 或 啤酒 的按钮 则相应的饮料就送出来 若售货机没有零钱找 则一个显示 零钱找完 的红灯亮 这时在投入1元硬币并押下按
  • Python · 无限画板(零)· 简介

    项目 GitHub 地址 免费线上示例产品 该示例产品的源代码 封面图对应的项目的源代码 需求 方案 在上一篇文章 用 Python 打造 AIGC 的 操作系统 里 我提到过这个 Python 无限画板的项目 carefree drawb
  • Pytorch CAM特征可视化

    背景 类别激活映射 Class Activation Mapping CAM 用于对深度学习特征可视化 通过特征响应定位图像的关键部位 为深度学习可解释性提供了一种方法 ACM以热力图的方式展示了图像局部响应的强弱信息 对应于更强的位置具有
  • 无线打印机服务器安全吗,注意安全 彻底拒绝打印机被非法共享

    为了提高打印机的利用率 不少单位往往会通过局域网对打印机进行共享使用 不过这样一来 局域网内的非法用户也有可能趁机使用共享打印机 从而造成打印成本的 节节攀升 为了阻止非法用户对打印机随意进行共享 本文特意总结了以下几则 拒绝 妙招 相信这
  • 2021 Android面经及求职总结

    投递情况 主要投递了国内和国外的互联网公司 同时也投递了一些币圈企业 最终斩获battmd offer和一币圈的百万年薪offer 关于如何准备面试 可以关注我的面试准备系列文章如何准备一场技术面试 offer斩获情况 大大小小共12家公司
  • K8S学习之Statefulset

    Statefulset概念 应用场景包括 1 稳定的持久化存储 即Pod重新调度后还是能访问到相同的持久化数据 基于PVC来实现 2 稳定的网络标志 即Pod重新调度后其PodName和HostName不变 基于Headless Servi
  • MySQL 异步复制源自动故障转移

    1 异步复制源架构 1 1基于主从复制的异步复制源 从MySQL 8 0 22开始支持异步连接故障转移机制 我们可以在一套主从复制架构的基础上 创建一个异步复制连接的Replica副本 当主从复制Source发生意外宕机 业务提升Repli
  • Nethereum:.NET应用和以太坊智能合约的桥梁

    Nethereum基本上是目前唯一可用的 NET平台下的web3 js移植包 在这个教程中 我们将首先编写并部署一个简单的智能合约 然后创建一个简单的 NET应用 并使用Nethereum来访问以太坊上的智能合约 Nethereum是通过以
  • vim编辑文件出错: Another program may be editing the same file.An edit session for this file crashed.

    以下是错误详细代码 E325 ATTENTION Found a swap file by the name schema xml swp owned by root dated Thu May 28 21 19 42 2020 file
  • mvcc匹配规则

    1 当前快照读读出的事务id
  • Oracle<-->MySQL

    to char 123 456 FM9 990 09 format 123 456 2 default en US 9 999 999 to char 123 cast 123 as unsigned int unsigned signed
  • 软件测试工具比较

    软件测试工具比较 作者 乔元 来源 无忧软件测试网 http www csai cn 2005年11月18日 随着软件测试的地位逐步提高 测试的重要性逐步显现 测试工具的应用已经成为了普遍的趋势 目前用于测试的工具已经比较多了 这些测试工具
  • 在Ubuntu16.04上安装QQ

    在Ubuntu16 04上安装QQ 霾大 1 个月前 最近装了双系统win10 ubuntu16 04 想在ubuntu上装个QQ 然后发现 在网上找了不少教程 都是装的wine qq 装了才发现显示版本过低 登不上去啊 后来发现用cros
  • MySQL数据库(二)SQL语言和数据类型

    成功不易 加倍努力 1 SQL语言 1 1 关系型数据库的常见组件 1 2 SQL语言的兴起与语法标准 2 管理数据库 2 1 创建数据库 2 2 修改数据库 2 3 删除数据库 2 4 查看数据库列表 3 数据类型 3 1 整数型 3 2
  • linux定时调用存储过程,linux下crontab定时执行shell脚本调用oracle 存储过程

    问题 脚本内调用存储过程 脚本直接执行没问题 使用crontab 执行脚本存储过程未执行 原因 缺少oracle环境变量 解决 在shell脚本里添加oracle的环境变量 bin sh PATH PATH HOME bin 环境变量 ex
  • 获取层级(结构树)

    public ResponseDTO
  • 使用typescript去简单的写一个时间显示的canvas小球

    在学习完了ts后 一直想找一个项目练手 可网上开源的项目 写的ts项目 还是有点复杂 不太适合刚刚学完ts想练手的同学 于是就打算自己写一个 ts小项目 大概需求就是 1 可以根据当前时间 用canvas绘制一个时间 2 可以每隔一秒 收集
  • ld 链接程序出错定位

    工具链相关问题 一般可 verbose 下 看看具体什么地方出问题 设置 LDFLAGS Wl verbose 例如 链接一堆 o文件 只有以下错误信息 ld final link failed Bad value 就可以加入 Wl ver
  • python3 中的import 和from import 使用区别(包和模块)

    python3 中的import 和from import 使用区别 包和模块 1 知识点 1 什么是包 什么是模块 2 import from import 如何使用 3 import 和 from import 使用区别 2 实现 以如
  • 【Flink】第一节 源码编译

    我认识以及改造flink的第一步从下载编译源码开始 0 环境 idea java 1 8 scala 2 12 flink 1 16 maven setting 核心 nodejs 这个去官网下载安装一下就好 npm v 显示成功就好 文末