无法通过python happybase - HDP 3上传Hbase中大小超过10MB的pdf文件

问题描述 投票:3回答:1

我们正在使用HDP 3.我们正在尝试在Hbase表中的特定列系列的一列中插入PDF文件。开发环境是python 3.6,hbase连接器是happybase 1.1.0。

我们无法在hbase中上传任何大于10 MB的PDF文件。

在hbase中,我们设置了如下参数:enter image description here

enter image description here

我们收到以下错误:

IOError(message = b'org.apache.hadoop.hbase.client.RetriesExhaustedWithDetailsException:失败1动作:org.apache.hadoop.hbase.DoNotRetryIOException:大小为80941994的单元格超过限制10485760字节\ n \ tat org.apache.hadoop .hbase.regionserver.RSRpcServices.checkCellSizeLimit(RSRpcServices.java:937)\ n \ tat org.apache.hadoop.hbase.regionserver.RSRpcServices.doBatchOp(RSRpcServices.java:1010) \ n \ tat org.apache.hadoop.hbase .regionserver.RSRpcServices.doNonAtomicBatchOp(RSRpcServices.java:959)\ n \ tat org.apache.hadoop.hbase.regionserver.RSRpcServices.doNonAtomicRegionMutation(RSRpcServices.java:922)\ n \ tat org.apache.hadoop.hbase.regionserver .RSRpcServices.multi(RSRpcServices.java:2683)\ n \ tat org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos $ ClientService $ 2.callBlockingMethod(ClientProtos.java:42014)\ n \ tat org.apache。 hadoop.hbase.ipc.RpcServer.call(RpcServer.java:409)\ n \ tat org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:131)\ n \ tat org.apache.hadoop。 hbase.ipc.RpcE xecutor $ Handler.run(RpcExecutor.java:324)\ n \达

python-3.x hbase thrift happybase hdp
1个回答
3
投票

你必须检查hbase source code,看看发生了什么:

private void checkCellSizeLimit(final HRegion r, final Mutation m) throws IOException {
    945    if (r.maxCellSize > 0) {
    946      CellScanner cells = m.cellScanner();
    947      while (cells.advance()) {
    948        int size = PrivateCellUtil.estimatedSerializedSizeOf(cells.current());
    949        if (size > r.maxCellSize) {
    950          String msg = "Cell with size " + size + " exceeds limit of " + r.maxCellSize + " bytes";
    951          if (LOG.isDebugEnabled()) {
    952            LOG.debug(msg);
    953          }
    954          throw new DoNotRetryIOException(msg);
    955        }
    956      }
    957    }
    958  }

基于错误消息,您超过了r.maxCellSize

上面的注释:函数PrivateCellUtil.estimatedSerializedSizeOf已折旧,将在以后的版本中删除。

这是它的描述:

根据RPC层中的keyvalue的序列化格式进行估计。请注意,此处的大小添加了额外的SIZEOF_INT,表示单元格以连续格式序列化的情况下的单元格的实际长度(例如,在RPC中)。

您必须检查值的设置位置。首先检查HRegion.java的“普通”值

this.maxCellSize = conf.getLong(HBASE_MAX_CELL_SIZE_KEY, DEFAULT_MAX_CELL_SIZE);

所以可能有一个HBASE_MAX_CELL_SIZE_KEYDEFAULT_MAX_CELL_SIZE限制somewhere

public static final String HBASE_MAX_CELL_SIZE_KEY = "hbase.server.keyvalue.maxsize";
public static final int DEFAULT_MAX_CELL_SIZE = 10485760;

在这里,您有10485760限制,显示在您的错误消息中。如果您需要,可以尝试将此限制提高到您的限制值。我建议在使用之前对其进行适当的测试(其背后可能有一些原因)。

编辑:添加有关如何更改base.server.keyvalue.maxsize值的信息。检查config.files

在哪里可以阅读:

hbase.client.keyvalue.maxsize(描述)

指定KeyValue实例的组合最大允许大小。这是为存储在存储文件中的单个条目设置上限。由于它们不能被拆分,因此有助于避免因为数据太大而无法进一步拆分区域。将其设置为最大区域大小的一小部分似乎是明智的。将其设置为零或更小会禁用检查。默认

10485760

hbase.server.keyvalue.maxsize(描述)

单个单元格的最大允许大小,包括值和所有关键组件。值0或更小会禁用检查。默认值为10MB。这是一个安全设置,用于保护服务器免受OOM情况的影响。默认

10485760
© www.soinside.com 2019 - 2024. All rights reserved.