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

标签 node.js elasticsearch

我尝试使用 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/

相关文章:

mysql - Nodejs 12 回调不适用于 mysql 连接?

javascript - 在node.js进程之间读取-共享巨大的哈希值

ruby-on-rails - Tire gem:如何访问Elasticsearch的 'highlight'属性?

elasticsearch - 通过 Grok Debugger 获取 Logstash _grokparsefailure 不会抛出任何错误

apache - elasticsearch和solr之间的根本区别是什么?

elasticsearch - Elasticsearch-将符号视为常规字符串并使文本不区分大小写

elasticsearch - 多个字段中的术语汇总Kibana

node.js - 需要 Morgan & Winston 使用 btyesize 记录 api 响应

node.js - 即使存在匹配值,Jest/Jasmine .toContain() 也会失败

node.js - Golang - 库需要是非阻塞的吗?