Unable to connect to elastic search
Closed this issue · 7 comments
I have followed the Readme and tried to run docker-compose up, But it is failing on this error.
Connection error caused by: ClientConnectorError(Cannot connect to host index:9200 ssl:default [Connection refused])
[warning ] Node <AiohttpHttpNode(http://index:9200)> has failed for 11 times in a row, putting on 30 second timeout [elastic_transport.node_pool]
app_1 | 2023-01-27T15:40:30.004014Z [error] Cannot connect to ElasticSearch: ConnectionError('Cannot connect to host index:9200 ssl:default [Connection refused]', errors=(ConnectionError('Cannot connect to host index:9200 ssl:default [Connection refused]', errors=(ClientConnectorError(ConnectionKey(host='index', port=9200, is_ssl=False, ssl=None, proxy=None, proxy_auth=None, proxy_headers_hash=3119452235181044255)
My intuition here is that for some reason, ElasticSearch on your system failed to start. Can you check it's logs and see if there's any error message there? docker-compose logs index
@pudo logs are normal, no error
index | {"@timestamp":"2023-01-31T07:54:39.129Z", "log.level": "INFO", "current.health":"GREEN","message":"Cluster health status changed from [YELLOW] to [GREEN] (reason: [shards started [[yente-entities-all-00220230131003038][0]]]).","previous.health":"YELLOW","reason":"shards started [[yente-entities-all-00220230131003038][0]]" , "ecs.version": "1.2.0","service.name":"ES_ECS","event.dataset":"elasticsearch.server","process.thread.name":"elasticsearch[index][masterService#updateTask][T#1]","log.logger":"org.elasticsearch.cluster.routing.allocation.AllocationService","elasticsearch.cluster.uuid":"crK0-RHSQS6dTpzAt6c-oA","elasticsearch.node.id":"yh9h4aQXQv-dr03aWLxW0Q","elasticsearch.node.name":"index","elasticsearch.cluster.name":"opensanctions-index"}
you can see I can curl localhost:9200
[ec2-user@ip-10-42-10-133 yente]$ curl localhost:9200
{
"name" : "index",
"cluster_name" : "opensanctions-index",
"cluster_uuid" : "crK0-RHSQS6dTpzAt6c-oA",
"version" : {
"number" : "8.3.2",
"build_type" : "docker",
"build_hash" : "8b0b1f23fbebecc3c88e4464319dea8989f374fd",
"build_date" : "2022-07-06T15:15:15.901688194Z",
"build_snapshot" : false,
"lucene_version" : "9.2.0",
"minimum_wire_compatibility_version" : "7.17.0",
"minimum_index_compatibility_version" : "7.0.0"
},
"tagline" : "You Know, for Search"
}
Very weird - then it almost certainly looks like a docker issue. Are you just running a normal docker-compose up
to get things going? No docker swarm etc.?
I make it run somehow, It was an elastic search issue, I just increase resources on my VM
@majid-rehman I got the same issue while I tried to run docker compose up
. How did you resolve the issue?
Hello @fritzsima! Can you let me know what resource allocations you have for Elastic? If you're running docker, does it have a writeable volume mounted for the data?