【发布时间】:2016-12-01 06:40:57
【问题描述】:
我正在尝试通过 R 中名为 elastic 的包查询 AWS ElasticSearch Service (AWS ES)。尝试连接到服务器时出现错误。
这是一个例子:
install.packages("elastic")
library(elastic)
aws_endpoint = "<secret>"
# I am certain the endpoint exists and is correct, as it functions with Kibana
aws_port = 80
# I have tried 9200, 9300, and 443 with no success
connect(es_host = aws_endpoint,
es_port = 80,
errors = "complete")
ping()
Search(index = "foobar", size = 1)$hits$hits
无论是 ping 服务器,还是实际尝试搜索文档,都会检索到此错误:
Error: 404 - no such index
ES stack trace:
type: index_not_found_exception
reason: no such index
resource.type: index_or_alias
resource.id: us-east-1.es.amazonaws.com
index: us-east-1.es.amazonaws.com
我已进入我的 AWS ES 控制面板并确定我正在使用现有的索引。为什么会出现这个错误?
我想我对传输协议有误解。 elastic 与 elasticsearch 的 HTTP API 交互。我以为这很好。
如何在 R 和 AWS ES 之间建立适当的连接?
R version 3.3.0 (2016-05-03); elastic_0.7.8
【问题讨论】:
-
AWS 的托管 Elasticsearch 版本要求对所有请求进行签名(参考 docs.aws.amazon.com/general/latest/gr/sigv4_signing.html)。我没有看到任何关于ropensci/elastic 包支持这个签名方案的明显参考。目前我不知道有任何 CRAN 软件包可以做到这一点。
-
感谢@DavidF.Severski。我会调查一下。
-
实际上,我们的服务器管理员说我们还没有保护 ES url,所以不需要签名。还有其他想法吗? @DavidF.Severski
标签: r amazon-web-services elasticsearch