I tried backing up and restoring an index to json in Elasticsearch using elasticdump (on Node.js):
我尝试使用elasticdump(在Node.js上)备份并恢复Elasticsearch中的json索引:
[Backup]elasticdump --input=http://cred:entials@myserver.com:9200/.kibana --output=kibana.json --type=data
(Works)
[备份] elasticdump --input = http:// cred:entials@myserver.com:9200 / .kibana --output = kibana.json --type = data(Works)
[Restore]elasticdump --output=http://cred:entials@myserver.com:9200/.kibana --input=kibana.json --type=data
(Gives an error)
[恢复] elasticdump --output = http:// cred:entials@myserver.com:9200 / .kibana --input = kibana.json --type = data(给出错误)
The error is:
错误是:
_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)
Does anyone know what is going and how to fix it?
有谁知道发生了什么以及如何解决它?
1 个解决方案
#1
10
Your node version is outdated.
您的节点版本已过时。
Try running node --version
and if you get anything below 1.0.0 then you need to upgrade your local version of node.
尝试运行节点--version,如果你得到1.0.0以下的任何东西,那么你需要升级本地版本的节点。
In order to manage several node versions locally you can use the n
module. Simply run the below steps
为了在本地管理多个节点版本,您可以使用n模块。只需运行以下步骤即可
sudo npm install -g n
sudo n stable
And then you'll have the latest version of node installed and elasticdump will work again.
然后你将安装最新版本的节点,elasticdump将再次运行。
#1
10
Your node version is outdated.
您的节点版本已过时。
Try running node --version
and if you get anything below 1.0.0 then you need to upgrade your local version of node.
尝试运行节点--version,如果你得到1.0.0以下的任何东西,那么你需要升级本地版本的节点。
In order to manage several node versions locally you can use the n
module. Simply run the below steps
为了在本地管理多个节点版本,您可以使用n模块。只需运行以下步骤即可
sudo npm install -g n
sudo n stable
And then you'll have the latest version of node installed and elasticdump will work again.
然后你将安装最新版本的节点,elasticdump将再次运行。