Posts

Showing posts with the label getCmdLineOpts

MongoDB tips: get config information

db._adminCommand( {getCmdLineOpts: 1}) db._adminCommand({getParameter:"*"}) rs0:PRIMARY> db._adminCommand( {getCmdLineOpts: 1}) {         "argv" : [                 "mongod",                 "--config=/data/configdb/mongod.conf",                 "--dbpath=/data/db",                 "--replSet=rs0",                 "--port=27017",                 "--bind_ip=0.0.0.0",                 "--auth",                 "--keyFile=/data/configdb/key.txt"         ],         "parsed" : {                 "config" : "/data/configdb/mongod.conf",       ...

MongoDB tip, check for the location of mongod log from mongo shell

Image
I never encountered this issue until I needed to log into the mongod administered by others and I don't have the host level access. This can be done in both robomongo or via mongo shell Using  robomongo Location of mongod log can be found by using the getCmdLineOpts command: check the entry below --logpath for the location for mongod log.  via mongo shell mongo --host <hostname> --port <port number> MongoDB Etnerprise> db.adminCommand('getCmdLineOpts') /* 1 */ {     "argv" : [          "mongod",          "--port",          "21000",          "--replSet",          "avlrepdev",          "--dbpath",          "/data/mongodb/data",          "--logpath",          "/data/mongodb/log/mongodb....