How-To
How to Collect MongoDB Information and Logs
this article outlines steps on how to collect the necessary mongodb information and logs this collection is needed by engineering and mongodb support in order to better understand the issue and begin their analysis the following items are the most often needed and usually help troubleshoot 90% of issues mongod logs files from all members dbpath/diagnostic data folder content this contains mongodb internal metrics, which help in diagnosing i/o, cache, journal, and other issues we’ll use a script to capture the aforementioned items along with additional information to assist with the troubleshooting turbine platform installer (tpi) download the collect mongo logs tpi sh script available at the bottom of this page for standalone, the mongodb primary member will always be swimlane sw mongo 0 if this is ha, then let's start by looking up the mongodb primary member you’ll need this information when running the script export ns=\<swimlane namespace> kubectl n $ns exec mongo 0 mongosh u admin p authenticationdatabase admin tls tlsallowinvalidhostnames tlsallowinvalidcertificates admin eval="rs ismaster() primary;" execute the file chmod u+x collect mongo logs tpi sh collect mongo logs tpi sh | tee collect mongo logs tpi results log update the support ticket with the following information upload the resulting /tmp/mongo logs #### tar gz file to our secure portal timeframe information of the incident is this issue recurring? is there any workload driven pattern?