mongo : command not found

07 February,2020 by Jack Vamvas

Question: I've installed the mongo as part of a replicaset . The server is part of a 3 - node replicaset and I can manage through MongoDB Operations Manager. 

But when i get onto the command line and type "mongo"  , I'm getting the -bash: mongo: command not found.    

How can I fix this issue - as I'd like to be able to have the command line option

Answer: Assuming everything is running as expected - the most likely reason is that the relevant mongo binaries are not in the /usr/bin folder. I've had this problem a few times and this is the way I've resolved it 

Step 1>>>>>>>>

--Execute this command  with a user account that has enough privileges

# ps -ef | grep mongo

--resultset similar to

mongod 3890 1 0 2019 ? 14:26:05 /var/lib/mongodb-mms-automation/mongodb-linux-x86_64-4.0.11-ent/bin/mongod -f /mydir1/mongodb/myrs/automation-mongod.conf

Step2>>>>>>>>

Note:  BEFORE you run this command , ensure you've confirmed with your Linux administrator or MongoDB DBA

# cp /var/lib/mongodb-mms-automation/mongodb-linux-x86_64-4.0.11-ent/bin/* /usr/bin/

 

You should now be able to run the mongo command

 


Author: Jack Vamvas (http://www.dba-ninja.com)


Share:

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment on mongo : command not found


dba-ninja.com