# Unable connect to Elasticsearch from another machine

**URL:** <https://discuss.elastic.co/t/unable-connect-to-elasticsearch-from-another-machine/352204>\
**Category:** Elasticsearch\
**Created:** [January 31, 2024, 3:25pm UTC](https://discuss.elastic.co/t/unable-connect-to-elasticsearch-from-another-machine/352204 "2024-01-31T15:25:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MinaYousry](https://avatars.discourse-cdn.com/v4/letter/m/278dde/32.png) [@MinaYousry](https://discuss.elastic.co/u/MinaYousry)\
**Post date:** [January 31, 2024, 3:25pm UTC](https://discuss.elastic.co/t/unable-connect-to-elasticsearch-from-another-machine/352204/1 "2024-01-31T15:25:40Z")

</div>

I installed Elasticsearch on one machine and my application, developed with Spring Boot, on another machine. When I try to connect, I face a connection refused error. However, when I run the command :  
`curl http://server_ip:9200`  
on the application machine, I receive the following response:

```auto
{
  "name" : "localhost.localdomain",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "_cTpYoMhTUqR9hmt-q93oA",
  "version" : {
    "number" : "8.9.1",
    "build_flavor" : "default",
    "build_type" : "tar",
    "build_hash" : "a813d015ef1826148d9d389bd1c0d781c6e349f0",
    "build_date" : "2023-08-10T05:02:32.517455352Z",
    "build_snapshot" : false,
    "lucene_version" : "9.7.0",
    "minimum_wire_compatibility_version" : "7.17.0",
    "minimum_index_compatibility_version" : "7.0.0"
  },
  "tagline" : "You Know, for Search"
}

```

Additionally, here are my `application.properties` :

```auto
spring.data.elasticsearch.cluster-name=elasticsearch
spring.data.elasticsearch.cluster-nodes=http://server_ip:9200
spring.data.elasticsearch.repositories.enabled=true

```

And my `elasticsearch.yml` :

```auto
# Enable security features
xpack.security.enabled: false

xpack.security.enrollment.enabled: false

# Enable encryption for HTTP API client connections, such as Kibana, Logstash, and Agents
xpack.security.http.ssl:
  enabled: true
  keystore.path: certs/http.p12

# Enable encryption and mutual authentication between cluster nodes
xpack.security.transport.ssl:
  enabled: true
  verification_mode: certificate
  keystore.path: certs/transport.p12
  truststore.path: certs/transport.p12
# Create a new cluster with the current node only
# Additional nodes can still join the cluster later
cluster.initial_master_nodes: ["localhost.localdomain"]

# Allow HTTP API connections from anywhere
# Connections are encrypted and require user authentication
http.host: 0.0.0.0

```

What should I do to solve this problem?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 6, 2024, 9:30am UTC](https://discuss.elastic.co/t/unable-connect-to-elasticsearch-from-another-machine/352204/2 "2024-02-06T09:30:02Z")

</div>

```auto
http://server_ip:9200

```

This should be:

```auto
https://server_ip:9200

```

no?

Could you share the Elasticsearch logs please?

---

<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:** [March 5, 2024, 9:30am UTC](https://discuss.elastic.co/t/unable-connect-to-elasticsearch-from-another-machine/352204/3 "2024-03-05T09:30:02Z")

</div>

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