Upload
mongodb
View
904
Download
3
Embed Size (px)
DESCRIPTION
Your datastore, MongoDB, is likely critical to your project; if you're new to MongoDB or Ops and have to keep things running in production this is the talk for you. We will cover Ops with MongoDB from the ground up; which parts of servers you should monitor and why, and show how to take and test backups. Also, we'll run through different tools you can use for installing, running, and monitoring MongoDB. After this you should be comfortable with the basics of running MongoDB in production, as well as have a head start on what you should do next.
Citation preview
rainforest @rainforestqa
Ops Skills and Tools for Beginners
Russell Smith!
English guy Mongo DB Master Ex Ops consultant
Ruby / PHP developer YC S12 Alum
Using mongo in Prod since 1.6/1.8
@rainforestqarainforest
Rainforest QA
!
Insanely simple testing
checkout: www.rainforestqa.com
What is Ops?
@rainforestqarainforest
Setting up servers / services
@rainforestqarainforest
Supporting Engineers
@rainforestqarainforest
Keeping stuff running
@rainforestqarainforest
Avoiding disasters
@rainforestqarainforest
Fixing breakage
Lets Learn the basics
Installation
@rainforestqarainforest
Replicated
@rainforestqarainforest
Sharded
@rainforestqarainforest
Best practices
Ubuntu is simplest
Install from Mongo’s repo
Chose the right replica set size: 3 nodes
Never use 32 bits
@rainforestqarainforest
Alternatives
MongoHQ
MonogLab
ObjectRocket
MMS + AWS (via automation)
Monitoring Mongo
@rainforestqarainforest
Server components
@rainforestqarainforest
Storage
magnetic, ssd
metric: disk io
@rainforestqarainforest
Memory / RAM
fastest general store
metrics; free, swap usage
@rainforestqarainforest
Network
allows communication
use 1gbit or higher (avoid 100mbit)
metrics; latency, throughput
@rainforestqarainforest
CPU
more is better
mostly used
metrics; % usage
@rainforestqarainforest
Monitoring & Diagnostics
@rainforestqarainforest
Top things to monitorFailover events
Repl Lag
Connections
Lock %
Disk usage
@rainforestqarainforest
Hosted is Simplest
MMSHosted, free for monitoring
!
Also can do Backups
Automation
ScoutMonitors mongo, servers and many
others (Plugins!) !
non-free
Server DensityMonitors mongo, servers and many
others (Plugins!) !
non-free
@rainforestqarainforest
Opensource options
Ganglia
Munin
Nagios
Zabbix
Linux tools to learnmongostat / mongotop
top iostat vmstat netstat
@rainforestqarainforest
Mongo shellrs.conf()
rs.status()
db.serverStatus()
db.stats()
db.currentOp()
@rainforestqarainforest
Backups
@rainforestqarainforest
Backup options
mongodump
from the file system
LVM / EBS
MMS
@rainforestqarainforest
TEST YOUR BACKUPS
Common pitfals
Missing indexes!
Running out of disk space
Untested backups
Sharding too late / wrong key
un-replicated / even set size
@rainforestqarainforest
Conclusion
do backups
monitor
read the docs
rainforest @rainforestqa
Questions?@rainforestqa
@rhs