Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Analyse MongoDB's diagnostic.data files

Tags:

mongodb

My MongoDB crashed and I am trying to understand why. On Ubuntu MongoDB produces files in /var/lib/mongodb/diagnostic.data. Those files, e.g. metrics.2016-03-08T17-15-01Z0, are binary files.

What tool should I use to analyse MongoDB diagnostic files? What data do the diagnostic files have?

like image 789
Randomblue Avatar asked Mar 14 '16 11:03

Randomblue


People also ask

How do I view a Mongod log?

MongoDB logs can be found in the MongoDB log files at /var/log/mongodb/mongodb. log. If you can't find the log files from this location, you can check the mongodb. conf.

What is diagnostic data in MongoDB?

The diagnostic. data file contains the result of db. serverStatus() command in binary format. This will be used by the MongoDB engineers to analyze the behavior of the server if any error happens. It is not necessary to take a backup of this file.

What is FTDC data?

Full Time Diagnostic Data Capture (FTDC) was introduced in MongoDB 3.2 (via SERVER-19585), to incrementally collect the results of certain diagnostic commands to assist MongoDB support with troubleshooting issues. On log rotation or startup, a mongod or mongos will collect and log: getCmdLineOpts : db.


1 Answers

You can see the contained data of the metrics... files using the tool bsondump which is included in every MongoDB installation.

Just execute bsondump metrics.2016-03-08T17-15-01Z0 and it will print out the decoded content of the file.

like image 146
JMax Avatar answered Sep 19 '22 06:09

JMax