I am using mongo on Linux, using a script to start and shutdown mongod server which internally uses following for start - mongodb/mongodb-linux-x86_64-rhel70-4.4.2/bin/mongod -f <config_file> --fork.
Any linux user which executes the script will be able to launch mongod.
My question is -
When a user A executes it first time, the mongod internal files that gets generated with the particular user A’s permission, when another user B tries to shut it down ( using mongodb/mongodb-linux-x86_64-rhel70-4.4.2/bin/mongod/bin/mongod -f <config_file> --shutdown ), it doesn’t allow it.
( or if same user A who started it, shut it down, then another user B won’t be able to start it again ).
How can we allow the multiple users to have control over admin operations ?
I recommend installing using RPMs instead of manually unzipping and running from a path: Install MongoDB Community Edition on Red Hat or CentOS. The RPM install sets up a service definition so you can start/stop/restart the MongoDB service using a configuration file and consistent user/group process permissions.
We are not unzipping it manually, the mongo install path ( i.e. mongodb/mongodb-linux-x86_64-rhel70-4.4.2/ ) is something, provided by the customer.
Our use case is the following,
Customer installs the Mongo in their system, provides mongo install path to us when calling some commands which internally launches mongod using --fork, ( so dbpath and mongo install path resides in customer space ). [ it creates all files with 600 permissions ]
I havent’t tried service definition one yet but do you think there is any way we can allow multiple users to fork, shutdown mongod in current implementation ?