elasticsearchrest高级客户端返回403错误

dldeef67  于 2021-06-14  发布在  ElasticSearch
关注(0)|答案(0)|浏览(184)

我在cname后面有一个ElasticSearch服务,当我尝试使用curl命令通过命令行访问它时,我能够用http200ok响应得到正确的响应。
然而,当我尝试使用javaapi的rest高级客户机连接到服务时,我得到一个403错误。
我的ElasticSearch的访问策略配置为*作为aws主体。
错误日志如下:

[DEBUG]  org.elasticsearch.client.RestClient: request [POST http://ES_ENDPOINT/INDEX_NAME/_search?typed_keys=true&ignore_unavailable=false&expand_wildcards=open&allow_no_indices=true&search_type=query_then_fetch&batched_reduce_size=512&ccs_minimize_roundtrips=true] returned [HTTP/1.1 403 Forbidden]

{"message":"The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details."}

这背后可能的原因是什么?这个问题只发生在cname上,而不是实际的ElasticSearch域名。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题