2

I have just set up a new ElasticSearch cluster on ElasticCloud and I am trying to follow the help documentation.

It says you can post a document as follows:

curl https://<id>.<region>.aws.found.io:9243/my_index/my_type -XPOST -d '{"title": "One", "tags": ["ruby"] }'

So I am trying this with my own URL, but I am getting:

{"error":{"root_cause":[{"type":"security_exception","reason":"action [indices:data/write/index] requires authentication","header":{"WWW-Authenticate":"Basic realm=\"security\" charset=\"UTF-8\""}}],"type":"security_exception","reason":"action [indices:data/write/index] requires authentication","header":{"WWW-Authenticate":"Basic realm=\"security\" charset=\"UTF-8\""}},"status":401}

Is there something else I need to do first? The help documentation doesn't mention any extra steps.

1
  • 2
    Figured it out - need to supply basic-auth username and password in the URL, like https://username:password@<id>.<region>.... The documentation doesn't make this clear.
    – Richard
    Commented Jun 15, 2017 at 14:49

1 Answer 1

3

The authentication can be done in basic-auth format:

https://username:password@<id>.<region>.found.io:9243

Users and roles can be managed via Kibana in In Elasticsearch version 5.0 and later.

2
  • This did not work for me. Received error: org.glassfish.jersey.server.internal.process.MappableException: java.io.IOException: <my username>:<my password>@d972<hidden characters>dd7d665aee2.us-east-1.aws.found.io: invalid IPv6 address This is with the Hight Level REST client for Java
    – GNG
    Commented Mar 2, 2020 at 18:07
  • curl -XGET https://<user>:<pass>@<id>.<region>.aws.<...>:<port>/_nodes/stats output- {"statusCode":404,"error":"Not Found","message":"Not Found"} I checked another way also- curl -XGET --user <uname>:<pass> "https://<id>.<region>.gcp.<....>:<port>/_cluster/health?pretty" ** **{"statusCode":404,"error":"Not Found","message":"Not Found"} I am getting error 404 for both the curl requests
    – Divyank
    Commented Dec 20, 2021 at 5:53

Not the answer you're looking for? Browse other questions tagged or ask your own question.