gpt4 book ai didi

bash - -bash : mongo: command not found AWS

转载 作者:可可西里 更新时间:2023-11-01 09:19:23 38 4
gpt4 key购买 nike

我已经在 AWS 中安装了 Mongodb 服务器。 Mongodb 服务器已启动并正在运行。但是,我无法连接到 mongo shell。 Mongo shell 未被识别。通常所有实用程序都存在于与 mongod 实用程序相同的目录中。但是,我在/usr/bin/目录中找不到 mongo 实用程序。

我无法弄清楚这个问题。我哪里错了?

$ ps -ef | grep mongo
mongod 21149 1 0 09:35 ? 00:00:01 /usr/bin/mongod -f /etc/mongod.conf
ec2-user 21226 21086 0 09:48 pts/0 00:00:00 grep mongo
$
$ mongo
-bash: mongo: command not found
$

MONGOD LOG
2014-05-18T09:35:18.239+0000 ***** SERVER RESTARTED *****
2014-05-18T09:35:18.262+0000 initandlisten MongoDB starting : pid=21149 port=27017 dbpath=/data/db 64-bit host=ip-172-31-1-234
2014-05-18T09:35:18.262+0000 initandlisten db version v2.6.1
2014-05-18T09:35:18.262+0000 initandlisten git version: 4b95b086d2374bdcfcdf2249272fb552c9c726e8
2014-05-18T09:35:18.262+0000 initandlisten build info: Linux build14.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
2014-05-18T09:35:18.262+0000 initandlisten allocator: tcmalloc
2014-05-18T09:35:18.262+0000 initandlisten options: { config: "/etc/mongod.conf", net: { bindIp: "127.0.0.1", port: 27017 }, processManagement: { fork: true, pidFilePath: "/var/run/mongodb/mongod.pid" }, storage: { dbPath: "/data/db", journal: { enabled: false } }, systemLog: { destination: "file", logAppend: true, path: "/var/log/mongodb/mongod.log" } }
2014-05-18T09:35:18.332+0000 initandlisten waiting for connections on port 27017
2014-05-18T09:36:18.335+0000 clientcursormon mem (MB) res:45 virt:330
2014-05-18T09:36:18.335+0000 clientcursormon mapped:80
2014-05-18T09:36:18.335+0000 clientcursormon connections:0

在 AWS 中安装 mongodb 的步骤:

echo "[MongoDB]
name=MongoDB Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64
gpgcheck=0
enabled=1" | sudo tee -a /etc/yum.repos.d/mongodb.repo
sudo yum install -y mongo-10gen-server

最佳答案

你必须使用

$ sudo yum install -y mongo-10gen-server mongodb-org-shell

然后

$ mongo

关于bash - -bash : mongo: command not found AWS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23724397/

38 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com