• Flink配置文件


    单机测试时的配置:

    state.backend: filesystem
    # 取消的时候保存检查点
    execution.checkpointing.externalized-checkpoint-retention: RETAIN_ON_CANCELLATION
    # 60s 一次检查点
    execution.checkpointing.interval: 60s
    # 检查点语意
    execution.checkpointing.mode: EXACTLY_ONCE
    
    
    # Directory for checkpoints filesystem, when using any of the default bundled
    # state backends.
    #
    # state.checkpoints.dir: hdfs://namenode-host:port/flink-checkpoints
    state.checkpoints.dir: file:///tmp/flink1.12-checkpoints
    # Default target directory for savepoints, optional.
    #
    # state.savepoints.dir: hdfs://namenode-host:port/flink-savepoints
    state.savepoints.dir: file:///tmp/flink1.12-savepoints
    # Flag to enable/disable incremental checkpoints for backends that
    # support incremental checkpoints (like the RocksDB state backend). 
    #
    # state.backend.incremental: false
    
    # The failover strategy, i.e., how the job computation recovers from task failures.
    # Only restart tasks that may have been affected by the task failure, which typically includes
    # downstream tasks and potentially upstream tasks if their produced data is no longer available for consumption.
    
    jobmanager.execution.failover-strategy: region

    生产配置:

    # state.backend: filesystem
    state.backend: rocksdb
    state.backend.incremental: true
    # 以下目录每个集群节点都必须存在或有权自动创建
    state.backend.rocksdb.localdir: /var/data/flink-rosckdb
    # Directory for checkpoints filesystem, when using any of the default bundled
    # state backends.
    #
    state.checkpoints.dir: hdfs:///user/share/flink1.12/flink-checkpoints
    state.checkpoints.num-retained: 5
    # Default target directory for savepoints, optional.
    #
    state.savepoints.dir: hdfs:///user/share/flink1.12/flink-savepoints
    
    # Flag to enable/disable incremental checkpoints for backends that
    # support incremental checkpoints (like the RocksDB state backend). 
    #
    state.backend.incremental: true
    
    # The failover strategy, i.e., how the job computation recovers from task failures.
    # Only restart tasks that may have been affected by the task failure, which typically includes
    # downstream tasks and potentially upstream tasks if their produced data is no longer available for consumption.
    
    #jobmanager.execution.failover-strategy: region
    restart-strategy: fixed-delay
    restart-strategy.fixed-delay.attempts: 10
    restart-strategy.fixed-delay.delay: 30s
  • 相关阅读:
    pytest05-参数化
    pytest04-conftest配置文件
    pytest03-fixture
    pytest02-setup和teardown
    SimpleDateFormat 是线程不安全的类,一般不要定义为 static 变量,如果定义为 static ,必须加锁,或者使用 DateUtils 工具类
    线程池不使用 Executors 去创建,而是通过 ThreadPoolExecutor 的方式
    线程资源最好通过线程池提供
    获取单例对象需要保证线程安全,其中的方法也要保证线程安全
    高度注意 Map 类集合 K / V 能不能存储 null 值的情况,如下表格
    使用 entrySet 遍历 Map 类集合 KV ,而不是 keySet 方式进行遍历的好处
  • 原文地址:https://www.cnblogs.com/yoyowin/p/14751566.html
Copyright © 2020-2023  润新知