我们可以通过 REST api 创建一个 HBase 命名空间吗?
Can we create an HBase namespace through REST api?
我们可以通过REST api
创建一个HBase
table(即http://{hbase-rest-server-ip:port}/{table-name}/schema
),但是我还没有找到一个REST api
我们可以通过可以创建一个HBase namespace
。有这样的api
吗?
据我所知,你还不能。
碰巧,最后一天在 HBase
jira 中针对它提出了一个错误!
POST http://{hbase-rest-server-ip:port}/namespaces/{new namespace name}
(不需要正文)
这应该 return HTTP/1.1 201 Created 而不是很多。如果它 returns 401 尝试使用 PUT 代替!
没有名称空间(和冒号)的表进入 'default' 名称空间
要在特定命名空间中创建或访问 table,请使用冒号,例如。 {命名空间名称}:{table名称}
列出所有命名空间 GET
{hbase-rest-server-ip:port}/namespaces/
在命名空间 GET
中列出 tables
http://{hbase-rest-server-ip:port}/namespaces/tester/tables
注意:默认端口似乎是 8070
示例:在 10.10.10.1 端口 8070
上对 hbase 服务器使用 curl
创建新命名空间 "new_name_space":
curl -vi -X POST "http://10.10.10.1:8070/namespaces/new_name_space"
在命名空间 "new_table" 中使用列族 "family1" 和 "family2" 命名空间 "new_name_space" 创建新的 table:
curl -vi -X POST \
-H "Content-Type: application/json" \
-d '{"name":"new_name_space:new_table","ColumnSchema":[{"name":"family1"},{"name":"family2"}]}"' \
"http://10.10.10.1:8070/new_name_space:new_table/schema"
更多信息:
https://www.cloudera.com/documentation/enterprise/latest/topics/admin_hbase_rest_api.html
我们可以通过REST api
创建一个HBase
table(即http://{hbase-rest-server-ip:port}/{table-name}/schema
),但是我还没有找到一个REST api
我们可以通过可以创建一个HBase namespace
。有这样的api
吗?
据我所知,你还不能。
碰巧,最后一天在 HBase
jira 中针对它提出了一个错误!
POST http://{hbase-rest-server-ip:port}/namespaces/{new namespace name}
(不需要正文)
这应该 return HTTP/1.1 201 Created 而不是很多。如果它 returns 401 尝试使用 PUT 代替!
没有名称空间(和冒号)的表进入 'default' 名称空间
要在特定命名空间中创建或访问 table,请使用冒号,例如。 {命名空间名称}:{table名称}
列出所有命名空间 GET{hbase-rest-server-ip:port}/namespaces/
在命名空间 GET
中列出 tables
http://{hbase-rest-server-ip:port}/namespaces/tester/tables
注意:默认端口似乎是 8070
示例:在 10.10.10.1 端口 8070
上对 hbase 服务器使用 curl
创建新命名空间 "new_name_space":
curl -vi -X POST "http://10.10.10.1:8070/namespaces/new_name_space"
在命名空间 "new_table" 中使用列族 "family1" 和 "family2" 命名空间 "new_name_space" 创建新的 table:
curl -vi -X POST \
-H "Content-Type: application/json" \
-d '{"name":"new_name_space:new_table","ColumnSchema":[{"name":"family1"},{"name":"family2"}]}"' \
"http://10.10.10.1:8070/new_name_space:new_table/schema"
更多信息:
https://www.cloudera.com/documentation/enterprise/latest/topics/admin_hbase_rest_api.html