scala - Elasticsearch-hadoop 连接器
问题描述
我想使用 SSL 协议通过 elasticsearch-hadoop 连接到 Elasticsearch [7.5] 集群。通过 curl 提供用户和密码:
curl -XPUT -k -u "user:pass" https://xxxxxxxxxxx.com:9200/prefix-test
curl -XGET -k -u "user:pass" https://xxxxxxxxxxx.com:9200/prefix-test
我能够创建索引并获得响应:
{"prefix-test":{"aliases":{},"mappings":{},"settings":{"index":{"creation_date":"1595854154818","number_of_shards":"1","number_of_replicas":"1","uuid":"k7Djh_fgHGIUTG76868Tuygi","version":{"created":"7050099"},"provided_name":"prefix-test"}}}}
这里“用户”只能读取或写入以“前缀”为前缀的索引。
但是,当我尝试在 Scala 中使用 elasticsearch-hadoop [7.5] 和 Spark [2.3.1] 连接到该集群时,配置如下:
"es.nodes": "xxxxxxxxxx.com"
"es.port": "9200",
"es.net.http.auth.user": "user"
"es.net.http.auth.pass": "password"
"es.net.ssl": "true"
"es.index.auto.create": "yes"
"es.net.ssl.cert.allow.self.signed": "true"
"es.nodes.path.prefix": "/prefix"
然后我尝试插入数据:
.saveToEs("prefix-test")
这给了我:
org.elasticsearch.hadoop.rest.EsHadoopInvalidRequest:org.elasticsearch.hadoop.rest.EsHadoopRemoteException: index_not_found_exception: no such index [prefix]
并且没有参数 "es.nodes.path.prefix": "/prefix" :
org.elasticsearch.hadoop.rest.EsHadoopInvalidRequest:org.elasticsearch.hadoop.rest.EsHadoopRemoteException: security_exception: action [cluster:monitor/main] is unauthorized for user [user]
我在这里缺少什么?如何使用这个前缀参数?
可能相关:https ://discuss.elastic.co/t/spark-job-is-failing-with-authenticating-with-basic-error/25732/2
解决方案
推荐阅读
- html - 数据绑定导致 [object Object]
- javascript - Flask - 组件模板结构?
- jquery - 仅将颜色应用于我单击的框
- javascript - 如何用 lodash 比较两个对象并返回新对象?
- angular - 通过 Cordova 将 --configuration 传递给 Angular
- facebook-messenger - Messenger 预订机器人的自托管仪表板
- python - 注意力实现的预测对齐中的差异化问题
- python - 如果我有两组具有相同数量值的数据,找出不匹配的集合中的值的最佳方法是什么?
- powershell - 找到的事件总数
- python - 用于布尔类型的 Argparser