# Elasticsearch-hadoop Connector

**URL:** https://discuss.elastic.co/t/elasticsearch-hadoop-connector/243090
**Category:** Elasticsearch
**Tags:** es-hadoop
**Created:** [July 29, 2020, 3:44pm UTC](https://discuss.elastic.co/t/elasticsearch-hadoop-connector/243090 "2020-07-29T15:44:03Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![bastienharmand](https://avatars.discourse-cdn.com/v4/letter/b/46a35a/32.png) [@bastienharmand](https://discuss.elastic.co/u/bastienharmand)
#### Post date: [July 29, 2020, 3:44pm UTC](https://discuss.elastic.co/t/elasticsearch-hadoop-connector/243090/1 "2020-07-29T15:44:04Z")

</div>

Hello,  
I want to connect to an Elasticsearch [7.5] cluster with elasticsearch-hadoop using the SSL protocol. By providing the user and password with curl :  
`curl -XPUT -k -u "user:pass" https://xxxxxxxxxxx:9200/prefix-test`  
`curl -XGET -k -u "user:pass" https://xxxxxxxxxxx.com:9200/prefix-test`  
I am able to create an index and get a response :  
`{"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"}}}}`  
Here "user" can only read or write to indexes prefixed by "prefix".

But when I try to connect to this cluster using elasticsearch-hadoop [7.5] with Spark [2.3.1] in Scala, with the following configuration :  
`"es.nodes": "xxxxxxxxxxx"`  
`"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"`

Then I try to insert data with :  
`.saveToEs("prefix-test")`

This give me :  
`org.elasticsearch.hadoop.rest.EsHadoopInvalidRequest:org.elasticsearch.hadoop.rest.EsHadoopRemoteException: index_not_found_exception: no such index [prefix]`

And without the parameter `"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]`

What i am missing here ? How to use this prefix parameter ?

Could be relevant : [Spark job is failing with authenticating with BASIC error](https://discuss.elastic.co/t/spark-job-is-failing-with-authenticating-with-basic-error/25732/2)

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [August 26, 2020, 3:44pm UTC](https://discuss.elastic.co/t/elasticsearch-hadoop-connector/243090/2 "2020-08-26T15:44:11Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
