Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to connect to local elasticsearch cluster #700

Open
armorKing11 opened this issue Apr 28, 2021 · 1 comment
Open

unable to connect to local elasticsearch cluster #700

armorKing11 opened this issue Apr 28, 2021 · 1 comment

Comments

@armorKing11
Copy link

Hi , i am trying to connect to my local elastic search cluster running in docker containers , but i am getting back the following error

Traceback (most recent call last):
  File "/root/.local/share/virtualenvs/app-4PlAip0Q/lib/python3.7/site-packages/sanic/app.py", line 973, in handle_request
    response = await response
  File "/app/comrade/blueprints/cluster.py", line 36, in get_cluster_info
    await client.ping()
  File "/root/.local/share/virtualenvs/app-4PlAip0Q/lib/python3.7/site-packages/elasticsearch_async/transport.py", line 150, in main_loop
    method, url, params, body, headers=headers, ignore=ignore, timeout=timeout)
  File "/root/.local/share/virtualenvs/app-4PlAip0Q/lib/python3.7/site-packages/elasticsearch_async/connection.py", line 111, in perform_request
    raise ConnectionError('N/A', str(e), e)
elasticsearch.exceptions.ConnectionError: ConnectionError(Cannot connect to host localhost:9200 ssl:default [Connection refused]) caused by: ClientConnectorError(Cannot connect to host localhost:9200 ssl:default [Connection refused]

elastic search cluster consists of 2 nodes , but i am trying to connect to only 1 node ,ie, localhost:9200
elastic node1 version details:

"version" : {
    "number" : "7.10.1",
    "build_flavor" : "default",
    "build_type" : "docker",
    "build_date" : "2020-12-05T01:00:33.671820Z",
    "build_snapshot" : false,
    "lucene_version" : "8.7.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },

In my elasticsearch.yml , i have the following config

cluster.name: "docker-cluster"
network.host: 0.0.0.0
http.cors.enabled : true
http.cors.allow-origin: "*"
http.cors.allow-methods : OPTIONS, HEAD, GET, POST, PUT, DELETE
http.cors.allow-headers : "X-Requested-With,X-Auth-Token,Content-Type, Content-Length, Authorization"
# License
xpack.license.self_generated.type: basic
# Monitoring
xpack.monitoring.collection.enabled: true

and my cluster.json file is

{
  "params": {
	"hosts": ["http://localhost:9200"]
   },
   "name": "docker-cluster"
}

Since i am doing just local testing , i dont have any ssl setup .
So is the issue cos the client( my elasticsearch server node) is attempting to connect with ssl enabled from this line ?
caused by: ClientConnectorError(Cannot connect to host localhost:9200 ssl:default [Connection refused]

@codyseibert
Copy link

I'm also seeing this issue. Is there an alternative configuration I need to use to get this working locally?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants