MongoDB mongorestore失败:语言环境:: facet :: __ S_create_c_locale名称无效 [英] MongoDB mongorestore failure: locale::facet::_S_create_c_locale name not valid

查看:213
本文介绍了MongoDB mongorestore失败:语言环境:: facet :: __ S_create_c_locale名称无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在计算机A(ubuntu 12.04服务器)上使用mongodump创建了转储.我将其移至计算机B(ubuntu 12.04服务器)并输入:

I created a dump with mongodump on computer A (ubuntu 12.04 server). I moved it to computer B (ubuntu 12.04 server) and typed:

mongorestore -db db_name --drop db_dump_path

mongorestore -db db_name --drop db_dump_path

失败,并报告:

已连接至:127.0.0.1
抛出'std :: runtime_error'实例后调用终止终止
what():区域设置::构面:: _ S_create_c_locale名称无效
中止

connected to: 127.0.0.1
terminate called after throwing an instance of 'std::runtime_error'
what(): locale::facet::_S_create_c_locale name not valid
Aborted

我之前已经成功完成了此操作,而且从未发生过这种奇怪的行为.我该怎么做才能解决此问题?

I've successfully accomplished this operation before and this strange behavior has never occurred. What do I need to do to fix this?

推荐答案

实际上,它与MongoDB并不严格相关.由于某种原因,计算机B上的语言未正确定义.我设法通过输入以下内容修复了该问题:

Actually it isn't strictly related to MongoDB. Somehow the language on computer B was not defined correctly. I managed to fix it by typing:

sudo locale-gen en_US en_US.UTF-8
sudo locale-gen it_IT it_IT.UTF-8
sudo locale-gen xx_xx xx_XX.UTF-8 ...
sudo dpkg-重新配置语言环境

sudo locale-gen en_US en_US.UTF-8
sudo locale-gen it_IT it_IT.UTF-8
sudo locale-gen xx_xx xx_XX.UTF-8 ...
sudo dpkg-reconfigure locales

这些命令将生成并配置所需的语言环境. 经过这些步骤之后,mongorestore恢复了正常工作.

These commands will generate and configure the needed locales. After those steps mongorestore got back working as usual.

这篇关于MongoDB mongorestore失败:语言环境:: facet :: __ S_create_c_locale名称无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆