# Couldn't connect to elasticsearch cluster hosted in the cloud

**URL:** <https://discuss.elastic.co/t/couldnt-connect-to-elasticsearch-cluster-hosted-in-the-cloud/148955>\
**Category:** Elasticsearch\
**Created:** [September 18, 2018, 10:04am UTC](https://discuss.elastic.co/t/couldnt-connect-to-elasticsearch-cluster-hosted-in-the-cloud/148955 "2018-09-18T10:04:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![IBenabd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ibenabd/32/35609_2.png) [@IBenabd](https://discuss.elastic.co/u/IBenabd)\
**Post date:** [September 18, 2018, 10:04am UTC](https://discuss.elastic.co/t/couldnt-connect-to-elasticsearch-cluster-hosted-in-the-cloud/148955/1 "2018-09-18T10:04:28Z")

</div>

In order to connect to elasticsearch hosted in the elastic cloud rather than using the local one, I added to **httpbeat.full.yml** those two lines of code but no connection had been established : \> cloud.id: "Ikbel\_abd:MyCloudId"

> ```
> cloud.auth: "elastic:MyPwd"
> output.elasticsearch:
> hosts: ["ElasticsearchIdInCloud:9243"]
> 
> ```

The error description while executing httpbeat is =\>

> ```
> 2018/09/18 09:53:12.530051 output.go:109: DBG output worker: publish 2 events
> 2018/09/18 09:53:12.530051 client.go:642: DBG ES Ping(url=https://980d91d648b24fb6b53668e2eb3e7342.eu-central-1.aws.cloud.es.io:9243, timeout=1m30s)
> 2018/09/18 09:53:12.544065 metrics.go:39: INFO Non-zero metrics in the last 30s: libbeat.es.publish.read_bytes=2376 libbeat.es.publish.write_bytes=865 libbeat.outputs.messages_dropped=1 libbeat.publisher.messages_in_worker_queues=2 libbeat.publisher.published_events=2
> 2018/09/18 09:53:12.601129 client.go:647: DBG Ping request failed with: 401 Unauthorized
> 2018/09/18 09:53:12.601129 single.go:140: ERR Connecting error publishing events (retrying): 401 Unauthorized
> 2018/09/18 09:53:12.602131 single.go:156: DBG send fail
> 2018/09/18 09:53:16.249242 service.go:33: DBG Received sigterm/sigint, stopping
> 2018/09/18 09:53:16.249242 service.go:39: DBG Received svc stop/shutdown request
> 
> ```

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 18, 2018, 10:07am UTC](https://discuss.elastic.co/t/couldnt-connect-to-elasticsearch-cluster-hosted-in-the-cloud/148955/2 "2018-09-18T10:07:09Z")

</div>

> [@IBenabd](#):
>
> 401 Unauthorized

That would suggest your login details are wrong. I would check them using a basic curl request.

---

<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:** [October 2, 2018, 10:07am UTC](https://discuss.elastic.co/t/couldnt-connect-to-elasticsearch-cluster-hosted-in-the-cloud/148955/3 "2018-10-02T10:07:28Z")

</div>

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