1

Our admins have given us the following command to launch the MongoDB service from our (non-sudo) accounts:

mongo resteam-mongo-cluster-001:27017 -u mongo-admin -p --authenticationDatabase admin

Could someone please break this down for me, as I'm a somewhat Linux newbie, but more importantly because the admins are always super busy here and if I have to tweak this later on for our team's purposes, I don't want to be calling them up.

The

2
  • This isn't the "command to launch a service", this is the command to connect to a database. In this line "Mongo" is a script or a program, "resteam-mongo-cluster-001" is a host and 27017 is the port number mongodb is listening on. Mongo client is told to use username "mongo-admin" and be prompted for a client password (the -p switch). On the mentioned host, your admins have created a database called admin, in which user mongo-admin was created. Substring "--authenticationDatabase admin" tells client to look for credentials of user mongo-admin in database admin. You don't tweak this command.
    – Kitet
    Sep 6, 2017 at 9:59
  • @Kitet Why didn't you post your comment as an answer? Seems to address the question without needing any further clarification ;-)
    – Stennie
    Sep 6, 2017 at 12:12

1 Answer 1

2

This isn't the "command to launch a service", this is the command to connect to a database. In this line, Mongo is a script or a program, resteam-mongo-cluster-001 is a host, and after a colon, 27017 is the port number mongodb is listening on the above host. Mongo client is told to use username mongo-admin and be prompted for a client password (the -p switch). On the mentioned host, your admins have created a database called admin, in which user mongo-admin was created. Substring --authenticationDatabase admin tells client to look for credentials of user mongo-admin in database admin.

Because this is a connect string to an existing service, You don't tweak this command, your admin will adjust it when he changes any parameters of the service.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .