使用apache Hue在某个HDFS位置/路径/到/ my / hbasetable中创建一个hbase表。但是,除了通过Hue之外,我在尝试以任何方式访问它时遇到了问题。在Hue中,我只是使用hbase数据浏览器导航到该表,但是当我尝试从命令行确认该表存在时会抛出错误:
[me@mapr001 example]$ curl -I -H \
"Accept: text/mxl" \
"http://node001:8080/etl/internal/example/raw-ingest/version-1/file-metastore/schema"
HTTP/1.1 500 java.lang.NumberFormatException: For input string: "raw-ingest"
Content-Type: text/html; charset=iso-8859-1
Cache-Control: must-revalidate,no-cache,no-store
Content-Length: 9374
在尝试访问示例行时(在Hue中添加到表中)会出现类似的错误
[me@mapr001 example]$ curl -vi -X GET -H \
"Accept: text/mxl" \
"http://mapr001:8080/etl/internal/example/raw-ingest/version-1/file-metastore/customId001/cf:mainfamily"
* About to connect() to mapr001 port 8080 (#0)
* Trying 172.18.4.100...
* Connected to mapr001 (172.18.4.100) port 8080 (#0)
> GET /etl/internal/example/raw-ingest/version-1/file-metastore/ede3233777492e4a00442b61c7035820a55f16e669daaa29fc6baecf09b397f8X1525813886Xv1/cf:lineage HTTP/1.1
> User-Agent: curl/7.29.0
> Host: mapr001:8080
> Accept: text/mxl
>
< HTTP/1.1 500 java.lang.NumberFormatException: For input string: "raw-ingest"
HTTP/1.1 500 java.lang.NumberFormatException: For input string: "raw-ingest"
< Content-Type: text/html; charset=iso-8859-1
Content-Type: text/html; charset=iso-8859-1
< Cache-Control: must-revalidate,no-cache,no-store
Cache-Control: must-revalidate,no-cache,no-store
< Content-Length: 9457
Content-Length: 9457
<
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>Error 500 java.lang.NumberFormatException: For input string: "raw-ingest"</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /etl/internal/example/raw-ingest/version-1/file-metastore/ede3233777492e4a00442b61c7035820a55f16e669daaa29fc6baecf09b397f8X1525813886Xv1/cf:lineage. Reason:
<pre> java.lang.NumberFormatException: For input string: "raw-ingest"</pre></p><h3>Caused by:</h3><pre>java.lang.IllegalArgumentException: java.lang.NumberFormatException: For input string: "raw-ingest"
at org.apache.hadoop.hbase.rest.RowSpec.parseTimestamp(RowSpec.java:170)
at org.apache.hadoop.hbase.rest.RowSpec.<init>(RowSpec.java:62)
....
(其中hbase表被调用&#34;文件 - Metastore&#34;并且前面路径的其余部分从HDFS根开始)你可以看到一些异常被引发抱怨路径的某些部分。从来没有使用过hbase,但我怀疑存在比输入字符串更深层次的问题。 hbase是否期望从某个预设的根目录(即hbase-site.xml中的hbase.rootdir
配置)开始?如果有人知道这里发生了什么,以及如何解决它,建议将不胜感激。感谢。
答案 0 :(得分:0)
REST api期望请求的格式为
"http://<restserver>:<port>/<tablename>/schema"
但是因为我将表作为表的路径(使用/
字符),所以它被解释为文字/
而不是名称的一部分(参见{{3在我不知道这是一件事之前从未使用过REST api)。从
"http://node001:8080/etl/internal/example/raw-ingest/version-1/file-metastore/schema/"
将/
s编码为%2f
s
"http://mapr001:8080/%2fetl%2finternal%2fexample%2fraw-ingest%2fversion-1%2ffilemetastore/schema/"
解决了这个问题。