How to Collect MongoDB Information and Logs
this article outlines the 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 will 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 is available at the bottom of this page for standalone, the mongodb primary member will always be mongo 0 if this is ha, then let's start by looking up the mongodb primary member you will need this information when running the script because the script will ask you to provide the primary mongodb replica export ns=\<swimlane namespace> kubectl n $ns exec mongo 0 mongosh u admin p \<password text> 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?