gpt4 book ai didi

node.js - Elasticdump 中的“现在无法切换到旧模式”错误

转载 作者:搜寻专家 更新时间:2023-10-31 22:19:17 24 4
gpt4 key购买 nike

我尝试使用 elasticdump(在 Node.js 上)在 Elasticsearch 中备份和恢复索引到 json:

[备份]
elasticdump --input=http://cred:entials@myserver.com:9200/.kibana --output=kibana.json --type=data(作品)

[恢复]
elasticdump --output=http://cred:entials@myserver.com:9200/.kibana --input=kibana.json --type=data(给出错误)

错误是:

_stream_readable.js:749
throw new Error('Cannot switch to old mode now.');
^
Error: Cannot switch to old mode now.
at emitDataEvents (_stream_readable.js:749:11)
at ReadStream.Readable.pause (_stream_readable.js:740:3)
at file.completeBatch (/usr/lib/node_modules/elasticdump/lib/transports/file.js:75:19)
at Stream.<anonymous> (/usr/lib/node_modules/elasticdump/lib/transports/file.js:65:10)
at Stream.emit (events.js:117:20)
at drain (/usr/lib/node_modules/elasticdump/node_modules/through/index.js:34:23)

有谁知道发生了什么以及如何解决它?

最佳答案

您的 Node 版本已过时。

尝试运行 node --version,如果你得到低于 1.0.0 的任何东西,那么你需要升级你的本地 node 版本。

为了在本地管理多个 Node 版本,您可以使用 n module .只需运行以下步骤

sudo npm install -g n
sudo n stable

然后您将安装最新版本的 Node ,elasticdump 将再次运行。

关于node.js - Elasticdump 中的“现在无法切换到旧模式”错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35883366/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com