$30 off During Our Annual Pro Sale. View Details »

Ops Skills and Tools for Beginners [MongoDB World 2014]

Ops Skills and Tools for Beginners [MongoDB World 2014]

Originally presented at MongoDB World 2014. This is an introduction to Ops with MongoDB aimed at Developers and people who haven't run MongoDB in production before. It covers some basics of servers, hosting, installation, monitoring and backups.

Russell Smith

June 24, 2014
Tweet

More Decks by Russell Smith

Other Decks in Technology

Transcript

  1. rainforest @rainforestqa
    Ops Skills and Tools for
    Beginners

    View Slide

  2. 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

    View Slide

  3. @rainforestqa
    rainforest
    Rainforest QA
    !
    Insanely simple testing
    checkout: www.rainforestqa.com

    View Slide

  4. What is Ops?

    View Slide

  5. @rainforestqa
    rainforest
    Setting up servers / services

    View Slide

  6. @rainforestqa
    rainforest
    Supporting Engineers

    View Slide

  7. @rainforestqa
    rainforest
    Keeping stuff running

    View Slide

  8. @rainforestqa
    rainforest
    Avoiding disasters

    View Slide

  9. @rainforestqa
    rainforest
    Fixing breakage

    View Slide

  10. Lets Learn the basics

    View Slide

  11. Installation

    View Slide

  12. @rainforestqa
    rainforest
    Replicated

    View Slide

  13. @rainforestqa
    rainforest
    Sharded

    View Slide

  14. @rainforestqa
    rainforest
    Best practices
    Ubuntu is simplest
    Install from Mongo’s repo
    Chose the right replica set size: 3 nodes
    Never use 32 bits

    View Slide

  15. @rainforestqa
    rainforest
    Alternatives
    MongoHQ
    MonogLab
    ObjectRocket
    MMS + AWS (via automation)

    View Slide

  16. Monitoring Mongo

    View Slide

  17. @rainforestqa
    rainforest
    Server components

    View Slide

  18. @rainforestqa
    rainforest
    Storage
    magnetic, ssd
    metric: disk io

    View Slide

  19. @rainforestqa
    rainforest
    Memory / RAM
    fastest general store
    metrics; free, swap usage

    View Slide

  20. @rainforestqa
    rainforest
    Network
    allows communication
    use 1gbit or higher (avoid 100mbit)
    metrics; latency, throughput

    View Slide

  21. @rainforestqa
    rainforest
    CPU
    more is better
    mostly used
    metrics; % usage

    View Slide

  22. @rainforestqa
    rainforest
    Monitoring & Diagnostics

    View Slide

  23. @rainforestqa
    rainforest
    Top things to monitor
    Failover events
    Repl Lag
    Connections
    Lock %
    Disk usage

    View Slide

  24. @rainforestqa
    rainforest
    Hosted is Simplest

    View Slide

  25. MMS
    Hosted, free for monitoring
    !
    Also can do
    Backups
    Automation

    View Slide

  26. Scout
    Monitors mongo, servers and many
    others (Plugins!)
    !
    non-free

    View Slide

  27. Server Density
    Monitors mongo, servers and many
    others (Plugins!)
    !
    non-free

    View Slide

  28. @rainforestqa
    rainforest
    Opensource options
    Ganglia
    Munin
    Nagios
    Zabbix

    View Slide

  29. Linux tools to learn
    mongostat / mongotop
    top
    iostat
    vmstat
    netstat

    View Slide

  30. @rainforestqa
    rainforest
    Mongo shell
    rs.conf()
    rs.status()
    db.serverStatus()
    db.stats()
    db.currentOp()

    View Slide

  31. @rainforestqa
    rainforest
    Backups

    View Slide

  32. @rainforestqa
    rainforest
    Backup options
    mongodump
    from the file system
    LVM / EBS
    MMS

    View Slide

  33. @rainforestqa
    rainforest
    TEST YOUR BACKUPS

    View Slide

  34. Common pitfals

    View Slide

  35. Missing indexes!
    Running out of disk space
    Untested backups
    Sharding too late / wrong key
    un-replicated / even set size

    View Slide

  36. @rainforestqa
    rainforest
    Conclusion
    do backups
    monitor
    read the docs

    View Slide

  37. rainforest @rainforestqa
    Questions?
    @rainforestqa
    @rhs

    View Slide