当前位置: 代码迷 >> 综合 >> Pulsar bk报错Unable to allocate memory, exiting bookie
  详细解决方案

Pulsar bk报错Unable to allocate memory, exiting bookie

热度:32   发布时间:2023-11-28 01:09:01.0

报错

开发人员反映pulsar不可用
每个pulsar bk节点查看

./bookkeeper shell bookiesanity

发现有2个bk不可用,查看对应日志发现如下

15:36:52.503 [bookie-io-1-134] ERROR org.apache.bookkeeper.proto.BookieServer - Unable to allocate memory, exiting bookie io.netty.util.internal.OutOfDirectMemoryError: failed to allocate 16777216 byte(s) of direct memory (used: 2147483648, max: 2147483648)

解决方式

https://github.com/apache/pulsar/issues/9988
查到了有个MaxDirectMemorySize参数

grep -rin "MaxDirectMemorySize" ./* 

在这里插入图片描述

vim ./conf/bkenv.sh

将所有bk节点的该配置修改2g至16G

重启所有bk节点

./bin/pulsar-daemon start bookie

恢复

  相关解决方案