rueckstiess / mtools

A collection of scripts to set up MongoDB test environments and parse and visualize MongoDB log files.
Apache License 2.0
1.89k stars 403 forks source link

Output the log path when mongod/mongos launch fails #877

Closed p-mongo closed 2 years ago

p-mongo commented 2 years ago

When mlaunch fails to spawn mongod or mongos, it tries to output a log excerpt. This exceprt can be useless in some situations, e.g.:

launching: config server on port 16046                                                                                 
b'{"t":{"$date":"2022-06-23T00:01:17.482Z"},"s":"I",  "c":"CONTROL",  "id":5760901, "ctx":"-","msg":"Applied --setParam
eter options","attr":{"serverParameters":{"enableTestCommands":{"default":false,"value":true}}}}\nabout to fork child p
rocess, waiting until server is ready for connections.\nforked process: 6585\nERROR: child process failed, exited with 
48\nTo see additional information in this output, start without the "--fork" option.\n'                                

can't start process, return code 48. tried to launch: "/usr/local/m/versions/6.0/mongod" --replSet shard01 --dbpath "/m
nt/zram/mongodb/6.0-scm/shard01/rs1/db" --logpath "/mnt/zram/mongodb/6.0-scm/shard01/rs1/mongod.log" --port 16042 --for
k  --setParameter "enableTestCommands=1" --filePermissions "0666" --shardsvr --wiredTigerCacheSizeGB 1        

To assist in troubleshooting, print the path to the logfile also.

stennie commented 2 years ago

Thanks @p-mongo !