开发者社区> 问答> 正文

flink 1.12 RocksDBStateBackend 报错

简单的wordcount程序,当设置了   env.setStateBackend(new RocksDBStateBackend(checkpointPath, true));  就会报  Caused by: java.lang.IllegalArgumentException: The fraction of memory to  allocate should not be 0. Please make sure that all types of managed memory  consumers contained in the job are configured with a non-negative weight via  taskmanager.memory.managed.consumer-weights.  查看源码是在   StreamConfig的  getManagedMemoryFractionOperatorUseCaseOfSlot 方法内,得到的是0.0  因为getAllManagedMemoryUseCases 返回的是0导致的。  因为config不存在一个key : managedMemFraction.STATE_BACKEND  当我手动添加这个key就可以正常执行了。  执行代码如下:  https://paste.ubuntu.com/p/9WrBz3Xrc6/*来自志愿者整理的flink邮件归档

展开
收起
又出bug了-- 2021-12-02 11:37:26 746 0
1 条回答
写回答
取消 提交回答
  • 1.12设置 env.setStateBackend(new RocksDBStateBackend(checkpointPath,  true))之后会报错  :  Caused by: java.lang.IllegalArgumentException: The fraction of memory to  allocate should not be 0. Please make sure that all types of managed memory  consumers contained in the job are configured with a non-negative weight via  taskmanager.memory.managed.consumer-weights

    但查看源码这个参数是默认值。  最终找到原因是  Streamconfig下getManagedMemoryFractionOperatorUseCaseOfSlot中  config缺少key : managedMemFraction.STATE_BACKEND  当设置  config.setDouble("managedMemFraction.STATE_BACKEND", 0.7)  后,程序正常。  代码如下  https://paste.ubuntu.com/p/9WrBz3Xrc6/*来自志愿者整理的FLINK邮件归档

    2021-12-02 14:21:31
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Flink CDC Meetup PPT - 龚中强 立即下载
Flink CDC Meetup PPT - 王赫 立即下载
Flink CDC Meetup PPT - 覃立辉 立即下载