简体   繁体   中英

-bash: mongo: command not found AWS

I have installed Mongodb server in AWS. Mongodb server is up and running. But, I'm unable to connect to mongo shell. Mongo shell is not being recognized. Normally all utilities are present in the same directory as mongod utility. But, I could not find mongo utility in /usr/bin/ directory.

I am unable to figure out the issue. Where am I going wrong?

$ 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

Steps followed to install mongodb in AWS:

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

you have to use

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

and then

$ mongo

Mongo-10gen-server package doesnt include the component which is required to run "mongo" connecting to database running as mongod. Use:

yum install mongodb-org

This will install all the required components.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM