Тайм-аут индекса эластичного поиска. Ошибка: время ожидания запроса после 30000 мс

В последнее время я хочу прокрутить старые данные индекса до новых месячных индексов. Сохраненные данные начинаются с 2015/07 года до настоящего времени. и это почти 30000 записей за каждый месяц. Следоватьсвиток а такженасыпной методы, предусмотренные в2.2 APIЯ заканчиваю код следующим образом.

файлmain.coffee

logger = require 'graceful-logger'
elasticsearch = require 'elasticsearch'
setMonthlyIndices = require './es-test-promise'
client = new elasticsearch.Client
  host:
    host: 'localhost'
    port: 9200
    protocol: 'http'
setMonthlyIndices client, 'es_test_messages', 'talk_messages_v2', 'messages', 2015, 6    

файлes-test-promise.coffee

logger = require 'graceful-logger'
elasticsearch = require 'elasticsearch'
config = require 'config'

setIndice = (client, prefix, index, type, year, month) ->
  allDocs = []
  count = 0

  prevYear = year + ''
  # with leading '0' for month less than 10
  prevMonth = ("0" + month).slice(-2)
  nextDate = new Date(year, month)
  nextYear = nextDate.getFullYear().toString()
  nextMonth = ("0" + (nextDate.getMonth()+1)).slice(-2)

  minDate = "#{prevYear}-#{prevMonth}-01"
  maxDate = "#{nextYear}-#{nextMonth}-01"

  indice_name = "#{prefix}_#{prevYear}_#{prevMonth}"

  q =
    filtered:
      filter:
        range:
          createdAt:
            gte: minDate
            lt: maxDate
            format: "yyyy-MM-dd"

  client.search
    index: index
    type: type
    scroll: '1m'
    body:
      query: q
    sort: ['_doc']
    size: 1000
  , callback = (err, response) ->
    console.log "indice_name 1", indice_name
    return logger.err err.stack if err
    return unless response.hits?.total

    allDocs = []

    response.hits.hits.forEach (hit)->
      action =
        index:
          _id: hit._id
      allDocs.push(action)
      allDocs.push(hit._source)

    count = count + allDocs.length

    client.bulk
      index: indice_name
      type: type
      body: allDocs
    , (err, resp) ->
      console.log "indice_name 2", indice_name
      return logger.err err.stack if err

      if response.hits.total *2 !=  count
        client.scroll
          scrollId: response._scroll_id
          scroll: '1m'
        , callback
      else
        logger.info "Finish indicing #{indice_name}"

setMonthlyIndices = (client, prefix, index, type, year, month) ->
  current = new Date()
  currentYear = current.getFullYear()
  currentMonth = current.getMonth() + 1

  processYear = year or currentYear
  processMonth = month or 0

  processDate = new Date(processYear, processMonth)
  currentDate = new Date(currentYear, currentMonth)

  processDate = new Date(2015, 6)
  currentDate = new Date(2015, 9)

  while processDate <= currentDate
    year = processDate.getFullYear()
    month = processDate.getMonth() + 1
    setIndice(client, prefix, index, type, year, month)
    processDate.setMonth(processDate.getMonth() + 1)

module.exports = setMonthlyIndices

Мне интересно, это связано с тем, чтобы открыть слишком много клиентского запроса, потому что в файлеes-test-promise.coffeeВсе эти поисковые запросы выполняются одновременно. Это всего лишь предположение, а затем я также попытался реализовать собещание&nbsp;чтобы убедиться, что запрос может быть выполнен один за другим. Наконец, я не могу понять это и сдаться.

Есть ли у вас какие-либо предложения, я думаю, что это должно быть источником проблем, но я не знаю, где проверить ...