【发布时间】:2022-07-13 01:24:47
【问题描述】:
我对新索引使用随机索引名称:
async import_index(alias_name, mappings, loadFn) {
const index = `${alias_name}_${+new Date()}`
console.log('creating new index: ', index)
await this.esService.indices.create({
index: index,
body: {
"settings": this.index_settings(),
"mappings": mappings
}
}).then(res => {
console.log('index created: ', index)
}).catch(async (err) => {
console.error(alias_name, ": creating new index", JSON.stringify(err.meta, null, 2))
throw err
});
我认为不存在同名的索引,但 ES 向我返回此错误
"error": {
"root_cause": [
{
"type": "resource_already_exists_exception",
"reason": "index [brands_1637707367610/bvY5O_NjTm6mU3nQVx7QiA] already exists",
"index_uuid": "bvY5O_NjTm6mU3nQVx7QiA",
"index": "brands_1637707367610"
}
],
"type": "resource_already_exists_exception",
"reason": "index [brands_1637707367610/bvY5O_NjTm6mU3nQVx7QiA] already exists",
"index_uuid": "bvY5O_NjTm6mU3nQVx7QiA",
"index": "brands_1637707367610"
},
"status": 400
}
使用 bitnami helm chart 在 k8s 中安装 ES,运行 3 个主节点。客户端连接到主服务 url。我的想法:客户端同时向所有节点发送请求,但我无法证明。
请帮忙
【问题讨论】:
-
我面临同样的问题。你是怎么解决的?
-
我增加了容器的内存堆,它开始运行良好。
标签: elasticsearch nestjs