CodeMonkey
CodeMonkey

Reputation: 12424

Elasticsearch Gateway timeout 504

I updated some indices mapping to simply add a keyword field to a text property and reloaded Kibana's index patterns. I was told I should run this command at the end:

POST 11ad.pi.prod.test-case-18/_update_by_query?conflicts=proceed

after doing it I get an error:

{
"statusCode": 504,
"error": "Gateway Time-out",
"message": "Client request timeout"
}

does it mean the timeout is too short? how can it be changed?

Upvotes: 13

Views: 27630

Answers (3)

Luoluo Flly
Luoluo Flly

Reputation: 51

change the kibana.yml. add the line:

elasticsearch.requestTimeout: 90000  # default 30s

Upvotes: 2

Bilal Demir
Bilal Demir

Reputation: 686

You can use the code below to update the TransportClient's connection time out value:

Settings.builder().put("transport.tcp.connect_timeout", "240s")

The Complete TransportClient code:

Settings settings = Settings.builder()
        .put(ElasticSearchReservedWords.CLUSTER_NAME.getText(), LogHandlerConstants.CLUSTER_NAME)
        .put(ElasticSearchReservedWords.LISTENER_TRANSPORT_SNIFF.getText(), true)
        .put("transport.tcp.connect_timeout", "240s")
        .build();

Client transportClient = new PreBuiltTransportClient(settings)
        .addTransportAddresses(
                new TransportAddress("127.0.0.1"), "9300"));

Each Elasticsearch version has different config key. You can read this document to learn about other settings you can change:

https://www.elastic.co/guide/en/elasticsearch/reference/6.4/modules-transport.html

Upvotes: 0

Val
Val

Reputation: 217254

It's normal if your index has a substantial size. You don't need to see any timeout, the task is still ongoing in the background.

You can check the status of the update by query task by running GET _tasks?actions=*byquery&detailed.

Upvotes: 19

Related Questions