Learn how to install and use some command-line tools for DBAs including creating local test deployments, proof of concept load testing, and extracting insights from MongoDB log files.
2. Agenda
- Get familiar with the command-line for your O/S
- Learn about some open source MongoDB tools for DBAs
- Install and play :)
3. Prerequisites
- If you want to install some of the tools on your laptop
you will need Python 2.7, Python 3.6, or Docker.
- https://www.python.org/downloads/
- https://www.docker.com/get-started
- If you don’t have time or access to install, that’s OK.
You’ll still get to see what the tools look like.
- Bonus points if you have access to a MongoDB log file to
test with.
4. m
What’s in your
MongoDB Open
Source
Toolkit?
mlaunch
*disclaimer: these are open
source projects that are not
officially supported by
MongoDB.
mgeneratejs mloginfo
jq mplotqueries
5. jq - slice & dice JSON data
- Download from https://stedolan.github.io/jq/ or try online
at https://jqplay.org
- mongo --eval 'db.serverStatus()'
- mongo --eval 'db.serverStatus().wiredTiger
- mongo --quiet --eval 'db.serverStatus().wiredTiger' | jq
- mongo --quiet --eval 'db.serverStatus().wiredTiger' | jq
'.cache,.cursor'
10. Get some summary info about a log file
- mloginfo mongod.log
- mloginfo --queries mongod.log
- mloginfo --connections mongod.log
- mloginfo --connstats mongod.log
- mloginfo --connections --connstats mongod.log
- Don’t have a log file? Here’s a very boring sample:
https://bit.ly/boringlog
11. Visuali[sz]e a log file
- mplotqueries mongod.log
- Don’t have a log file? Here’s a very boring
sample: https://bit.ly/boringlog