簡體   English   中英

Elasticsearch刪除了Javascript客戶端失敗的索引列表,並顯示“無活動連接”

[英]Elasticsearch delete a list of indices with the Javascript client failing with “No Living connections”

我正在使用6.0版的官方Elasticsearch Javascript客戶端,並嘗試刪除索引列表。

代碼是:

const client = new elasticsearch.Client({
    "hosts": [
        "https://the-es-host-here.us-west-2.es.amazonaws.com"
    ],
    "apiVersion": "6.0",
    "sniffOnStart": true
});

const indices = [
    'enduser-2017-12-04',
    'enduser-2017-12-08',
    'enduser-2017-12-07',
    'enduser-2017-12-01',
    'enduser-2017-12-14',
    'enduser-2017-12-10',
    'enduser-2017-12-27',
    'enduser-2017-12-02',
    'enduser-2017-12-18',
    'enduser-2017-12-22',
    'enduser-2017-12-28',
    'enduser-2017-12-09',
    'enduser-2017-12-03',
    'enduser-2017-12-05',
    'enduser-2017-12-11',
    'enduser-2017-11-29',
    'enduser-2017-12-17',
    'enduser-2017-12-15',
    'enduser-2017-12-19'
];

client.indices.delete({
    index: indices
}, (error) => {
    if(error) {
        console.error(error);
    }
});

但是沒有任何索引被刪除,我看到以下錯誤:

Error: No Living connections

我看不到我在做什么錯。

經過一個小時的擺弄,問題與將"sniffOnStart": true傳遞給new elasticsearch.Client() "sniffOnStart": true new elasticsearch.Client() 我不知道為什么會這樣,但是刪除sniffOnStart一切正常。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM