【问题标题】:unable to upload pdf files of size more than 10MB in Hbase via python happybase - HDP 3无法通过 python happybase 在 Hbase 中上传大小超过 10MB 的 pdf 文件 - HDP 3
【发布时间】:2019-07-19 21:20:22
【问题描述】:

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

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

在hbase中我们设置了如下参数:

我们得到以下错误:

IOError(message=b'org.apache.hadoop.hbase.client.RetriesExhaustedWithDetailsException: 1 项操作失败:org.apache.hadoop.hbase.DoNotRetryIOException: Cell 大小为 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.RpcExecutor$Handler.run(RpcExecutor.java:324)\n\tat

【问题讨论】:

    标签: python-3.x hbase thrift happybase hdp


    【解决方案1】:

    您必须查看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
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-03-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-07-06
      • 2015-02-08
      • 1970-01-01
      相关资源
      最近更新 更多