• Flink本地Idea调试源码环境搭建


    1.1 下载源码并编译

    git clone https://github.com/apache/flink.git
    
    cd flink
    
    git checkout -b dev-1.14 remotes/origin/release-1.14
    
    mvn clean install -DskipTests -Dfast
    

    1.2 启动JobManager

    入口类为:

    org.apache.flink.runtime.entrypoint.StandaloneSessionClusterEntrypoint
    

    在Run Configurations配置界面配置以下内容:

    -- vm options
    -Dlog.file=/Users/jordan95225/IdeaProjects/source_code/flink/build-target/log/flink-jobmanager-1.local.log
    -Dlog4j.configuration=file:/Users/jordan95225/IdeaProjects/source_code/flink/build-target/conf/log4j.properties 
    -Dlog4j.configurationFile=file:/Users/jordan95225/IdeaProjects/source_code/flink/build-target/conf/log4j.properties 
    -Dlogback.configurationFile=file:/Users/jordan95225/IdeaProjects/source_code/flink/build-target/conf/logback.xml
    
    -classpath :/Users/jordan95225/IdeaProjects/source_code/flink/build-target/lib/flink-dist_2.11-1.14-SNAPSHOT.jar:/Users/jordan95225/IdeaProjects/source_code/flink/build-target/lib/flink-table_2.11-1.14-SNAPSHOT.jar:/Users/jordan95225/IdeaProjects/source_code/flink/build-target/lib/flink-csv-1.14-SNAPSHOT.jar:/Users/jordan95225/IdeaProjects/source_code/flink/build-target/lib/flink-json-1.14-SNAPSHOT.jar:/Users/jordan95225/IdeaProjects/source_code/flink/build-target/lib/flink-shaded-zookeeper-3.4.14.jar:/Users/jordan95225/IdeaProjects/source_code/flink/build-target/lib/log4j-1.2-api-2.17.1.jar:/Users/jordan95225/IdeaProjects/source_code/flink/build-target/lib/log4j-api-2.17.1.jar:/Users/jordan95225/IdeaProjects/source_code/flink/build-target/lib/log4j-core-2.17.1.jar:/Users/jordan95225/IdeaProjects/source_code/flink/build-target/lib/log4j-slf4j-impl-2.17.1.jar
    
    -- program arguments
    -c /Users/jordan95225/IdeaProjects/source_code/flink/build-target/conf
    

    如下图所示:

    image-20220321221115435

    启动之后可以在http://localhost:8081/查看是否启动成功

    1.3 启动TaskManager

    入口类为:

    org.apache.flink.runtime.taskexecutor.TaskManagerRunner
    

    配置同JobManager:

    -- vm options
    -Dlog.file=/Users/jordan95225/IdeaProjects/source_code/flink/build-target/log/flink-taskexecutor-1.local.log 
    -Dlog4j.configuration=file:/Users/jordan95225/IdeaProjects/source_code/flink/build-target/conf/log4j.properties 
    -Dlog4j.configurationFile=file:/Users/jordan95225/IdeaProjects/source_code/flink/build-target/conf/log4j.properties 
    -Dlogback.configurationFile=file:/Users/jordan95225/IdeaProjects/source_code/flink/build-target/conf/logback.xml
    
    -classpath :/Users/jordan95225/IdeaProjects/source_code/flink/build-target/lib/flink-dist_2.11-1.14-SNAPSHOT.jar:/Users/jordan95225/IdeaProjects/source_code/flink/build-target/lib/flink-table_2.11-1.14-SNAPSHOT.jar:/Users/jordan95225/IdeaProjects/source_code/flink/build-target/lib/flink-csv-1.14-SNAPSHOT.jar:/Users/jordan95225/IdeaProjects/source_code/flink/build-target/lib/flink-json-1.14-SNAPSHOT.jar:/Users/jordan95225/IdeaProjects/source_code/flink/build-target/lib/flink-shaded-zookeeper-3.4.14.jar:/Users/jordan95225/IdeaProjects/source_code/flink/build-target/lib/log4j-1.2-api-2.17.1.jar:/Users/jordan95225/IdeaProjects/source_code/flink/build-target/lib/log4j-api-2.17.1.jar:/Users/jordan95225/IdeaProjects/source_code/flink/build-target/lib/log4j-core-2.17.1.jar:/Users/jordan95225/IdeaProjects/source_code/flink/build-target/lib/log4j-slf4j-impl-2.17.1.jar
    
    -- program arguments
    -c /Users/jordan95225/IdeaProjects/source_code/flink/build-target/conf
    -D taskmanager.memory.framework.off-heap.size=134217728b 
    -D taskmanager.memory.network.max=134217730b 
    -D taskmanager.memory.network.min=134217730b 
    -D taskmanager.memory.framework.heap.size=134217728b 
    -D taskmanager.memory.managed.size=536870920b 
    -D taskmanager.cpu.cores=4
    -D taskmanager.memory.task.heap.size=402653174b 
    -D taskmanager.memory.task.off-heap.size=0b 
    -D taskmanager.memory.jvm-metaspace.size=268435456b 
    -D taskmanager.memory.jvm-overhead.max=201326592b 
    -D taskmanager.memory.jvm-overhead.min=201326592b
    

    如下图所示:

    image-20220321221530120

  • 相关阅读:
    我的书单
    写一个小demo过程中遇到的各种问题 学生管理考勤系统(网页模拟)
    高程三 面向对象程序设计
    JavaScript 函数与对象的 简单区别
    高程三 基本包装类型部分的学习
    巨简单巨丑的计算器(写的我快自闭了)
    checked选择器实现tab切换
    JavaScript进行简单的随即验证码生成(适合和我一样刚入门一本完整的教材书都没看完的弟弟)
    dom编程艺术章12
    vue插件开发与发布
  • 原文地址:https://www.cnblogs.com/jordan95225/p/16037282.html
Copyright © 2020-2023  润新知