Requesting Elasticsearch from Node times out Requesting Elasticsearch from Node times out elasticsearch elasticsearch

Requesting Elasticsearch from Node times out


Try extending the requestTimeout parameter when instantiating the ES Client.

client = new elasticsearch.Client({        host          : 'http://localhost:9200',        requestTimeout: 60000    });

I had a long-running process which took just under 10 minutes. By making the requestTimeout value 60000 (10 mins) the process could complete without timing out.


We also had this issue on QBox because of sniffOnStart.Try with this config:

var es = new elasticsearch.Client({    host: "my-address:9200",    log: "trace",    sniffOnStart: true});

You'll see that the added nodes ip are the private ip.On our side, we decided to disable the sniffing and add manually the array of public node host addresses like this:

var es = new elasticsearch.Client({    hosts: ["my-address1:9200", "my-address2:9200", "my-address3:9200"],    log: "error"});


Regarding timeouts in elastic search, you need to differentiate between two types of timeouts:

You should know that operation-based timeouts overwrite the initializationRequestTimeout.