【问题标题】:'Cannot switch to old mode now' Error in Elasticdump“现在无法切换到旧模式”Elasticdump 中的错误
【发布时间】:2016-03-09 05:09:24
【问题描述】:

我尝试使用 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.js elasticsearch


    【解决方案1】:

    您的节点版本已过时。

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

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

    sudo npm install -g n
    sudo n stable
    

    然后您将安装最新版本的节点,并且 elasticdump 将再次工作。

    【讨论】:

    • 你能试试这个吗?
    • 更新节点版本有效,但我是按照节点站点上的说明进行的。
    • 您能否在这种情况下验证答案?当它们被标记为已解决时,它有助于搜索答案:)
    • n latest 对我来说失败了:“错误:无效版本”
    猜你喜欢
    • 1970-01-01
    • 2013-08-20
    • 1970-01-01
    • 1970-01-01
    • 2012-11-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-06-17
    相关资源
    最近更新 更多