简体   繁体   English

无法通过ssh在ubuntu docker容器中运行mongod(Docker使用“ --net = host”启动)

[英]Unable to run mongod inside ubuntu docker container through ssh (Docker is started using “--net=host”)

I referred to many links to solve this error SEVERE: Failed global initialization: BadValue Invalid or no user locale set. Please ensure LANG and/or LC_* environment variables are set correctly. 我引用了许多链接来解决此错误SEVERE: Failed global initialization: BadValue Invalid or no user locale set. Please ensure LANG and/or LC_* environment variables are set correctly. SEVERE: Failed global initialization: BadValue Invalid or no user locale set. Please ensure LANG and/or LC_* environment variables are set correctly. .

I executed export LC_ALL=C as told in the below link 我按以下链接所述执行了export LC_ALL=C

Failed global initialization: BadValue Invalid or no user locale set. 全局初始化失败:BadValue无效或未设置用户区域设置。 Please ensure LANG and/or LC_* environment variables are set correctly 请确保正确设置LANG和/或LC_ *环境变量

https://askubuntu.com/questions/536875/error-in-installing-mongo-in-virtual-machine https://askubuntu.com/questions/536875/error-in-installing-mongo-in-virtual-machine

I also referred to BadValue Invalid or no user locale set. 我还提到BadValue无效或未设置用户区域设置。 Please ensure LANG and/or LC_* environment variables are set correctly 请确保正确设置LANG和/或LC_ *环境变量

and did the following steps, 并执行以下步骤,

root@product:/# localedef -i en_US -f UTF-8 en_US.UTF-8
root@product:/# export LANGUAGE=en_US.UTF-8
root@product:/# export LANG=en_US.UTF-8
root@product:/# export LC_ALL=en_US.UTF-8
root@product:/# locale-gen en_US.UTF-8
Generating locales...
  en_US.UTF-8... done
Generation complete.
root@product:/# dpkg-reconfigure locales
Generating locales...
  en_US.UTF-8... up-to-date
Generation complete.

After trying all the above steps also i still get the below error when i execute mongo command through ssh 在尝试了上述所有步骤之后,当我通过ssh执行mongo命令时,我仍然收到以下错误

product@product:~/docker$ sshpass -p password ssh root@172.20.71.71 'mongod --dbpath /var/lib/mongodb/ &'
2015-02-24T09:50:27.158+0000 SEVERE: Failed global initialization: BadValue Invalid or no user locale set. Please ensure LANG and/or LC_* environment variables are set correctly.

But when i execute mongod --dbpath /var/lib/mongodb/ & from within the container it works, below is the terminal output 但是当我从容器中执行mongod --dbpath /var/lib/mongodb/ & ,下面是终端输出

root@product:/# mongod --dbpath /var/lib/mongodb/ &
[1] 284
root@product:/# 2015-02-24T09:56:42.108+0000 [initandlisten] MongoDB starting : pid=284 port=27017 dbpath=/var/lib/mongodb/ 64-bit host=product
2015-02-24T09:56:42.108+0000 [initandlisten] db version v2.6.7
2015-02-24T09:56:42.108+0000 [initandlisten] git version: a7d57ad27c382de82e9cb93bf983a80fd9ac9899
2015-02-24T09:56:42.108+0000 [initandlisten] build info: Linux build7.nj1.10gen.cc 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Jan 3 21:39:27 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49
2015-02-24T09:56:42.108+0000 [initandlisten] allocator: tcmalloc
2015-02-24T09:56:42.108+0000 [initandlisten] options: { storage: { dbPath: "/var/lib/mongodb/" } }

If anyone knows why this is happening, I want to run it through ssh. 如果有人知道为什么会这样,我想通过ssh运行它。

Probably your ssh client is trying to set those environmental variables in remote host. 可能您的ssh客户端正在尝试在远程主机中设置这些环境变量。 Edit you /etc/ssh/ssh_config commenting the line SendEnv LANG LC_* 编辑您的/etc/ssh/ssh_config注释行SendEnv LANG LC_*

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 通过ssh启动时Docker容器mongod错误 - Docker container mongod error when starting via ssh 无法使用docker-compose运行具有副本集的mongo容器 - Unable to run mongo container with replica set using docker-compose 无法在 docker 中为 windows 使用 ZE206A54E97690CCE50CC872DD42Z 文件系统运行 mongoDb 容器 - unable to run a mongoDb container in docker for windows using linux file system Windows版Docker-无法从Windows主机连接到Ubuntu容器上的MongoDB - Docker for Windows - Can not connect to the MongoDB on Ubuntu Container from Windows host 无法在AWS Ubuntu上将mongod作为服务运行 - Unable to run mongod as service on AWS Ubuntu docker 容器内的 mongod 进程如何允许来自外部的连接 - How does mongod process inside a docker container allow connections from outside 使用 docker 容器对 mogodb 进行分片:docker-compose MongoDB 错误:尝试在主机上运行命令“isMaster”时出现网络错误 - sharding mogodb using docker container :docker-compose MongoDB Error: network error while attempting to run command 'isMaster' on host 无法在 docker compose 中运行脚本 - Unable to run a script inside docker compose 无法从容器内部连接到在 docker 容器中运行的 mongodb 实例 - Unable to connect to the mongodb instance running in a docker container from inside the container 如何使用Docker Compose在容器中运行命令? - How to run a command in a container using Docker Compose?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM