13

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?

CodeMonkey
  • 11,196
  • 30
  • 112
  • 203

3 Answers3

20

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.

Val
  • 207,596
  • 13
  • 358
  • 360
  • offical document update for es 7.3, it says using "GET _tasks?detailed=true&actions=*/delete/byquery " to check _delete_by_query tasks, check https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete-by-query.html – efinal Aug 17 '19 at 05:57
2

change the kibana.yml. add the line:

elasticsearch.requestTimeout: 90000  # default 30s
0

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

Bilal Demir
  • 587
  • 6
  • 17