hadoop - 如何通过 StarGate REST API 向 HBase 中插入数据

标签 hadoop hbase stargate

根据 StarGate 文档,CURL 命令应该如下所示:

% curl -H "Content-Type: text/xml" --data '[...]' http://localhost:8000/test/testrow/test:testcolumn

这就是我正在尝试的:

% curl -X POST -H "Accept: text/xml" --data '[<CellSet><Row key="cm93MQ=="><Cell column="dGl0bGU6YQ==">d29ya2Vk</Cell></Row></CellSet>]' http://localhost:8080/test/row1/title

不断收到 HTTP 415,不支持的媒体类型.. 知道我在那里遗漏了什么吗?

最佳答案

您当前的 curl 选项指定您想要 XML 输出,并且 curl 假设您正在发布 url 编码的表单数据(并在 HTTP header 中指定了错误的 Content-Type)。

修改你的 -H "Accept: text/xml"-H "Content-Type: text/xml" 你应该是好的

关于hadoop - 如何通过 StarGate REST API 向 HBase 中插入数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10920890/

相关文章:

hadoop - 为什么要在 MapReduce 框架中使用两个(或更多)reducer?

hadoop - Hadoop和Cassandra比较2行

HBase 连接卡在 INFO zookeeper.ClientCnxn : Session establishment complete on server. 如何进一步连接?

rest - 如果行键是反向 URL,如何查找 HBase REST API (Stargate)

rest - 如何通过负载均衡在 HBase 集群上使用 REST api

hadoop - Hadoop 中 HDFS 以外的文件系统如何使用数据局部性?

hadoop - 当我运行带有多个对象的创建请求时,Hadoop Hive保持卡住

hbase - Pig + Hbase 原子增量列值

java - 如何覆盖特定类的log4j设置

ruby - 通过 Ruby 查询 HBase Stargate 的十六进制行键