Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥

MongoDB In the Cloud with Amazon EC2

dcrosta
January 23, 2012

MongoDB In the Cloud with Amazon EC2

From MongoDB LA, January 19, 2012

dcrosta

January 23, 2012
Tweet

More Decks by dcrosta

Other Decks in Technology

Transcript

  1. MongoDB  Components • Actual data • Needs RAM + Disk

    IO • Stores sharding configuration • Stores small amounts of data • Infrequently queried/updated by MongoS • Stateless router • Typically run on App Servers • Can run as Arbiter • No data • Just votes to elect primary
  2. Sharding MongoD MongoD MongoD MongoD MongoD MongoD MongoD MongoD MongoD

    MongoD MongoD MongoD ConfigD ConfigD ConfigD MongoS MongoS MongoS
  3. Amazon  EC2  Instance  Types 32-­‐bit  =  Don’t  Use ConfigD  /

     Arbiter 32-­‐bit  =  Don’t  Use Typical  MongoD Big  MongoD High  CPU  not   necessary
  4. OperaSng  System • Use  ext4,  xfs • Use  RAID –

    RAID10  on  MongoD – RAID1  on  ConfigbDB   • Turn  off  aSme • Raise  file  descriptor  limits cat >> /etc/security/limits.conf << EOF * hard nofile 65536 * soft nofile 65536 EOF
  5. MongoS  on  EC2 32- or 64-Bit EC2 Instance (Typically your

    app server) MongoS Your  App Language Specific Driver
  6. 3-­‐Node  Replica  Set   MongoD (Primary) RAID  10 MongoD (Secondary)

    RAID  10 MongoD (Secondary) RAID  10 Your  App Large Large Large
  7. US  West US  East 3-­‐Node  Replica  Set   Your  App

    MongoD (Primary) RAID  10 Large MongoD (Secondary) RAID  10 Large MongoD (Secondary) Priority  =  0 RAID  10 Large
  8. Backup  /  Restore   • EBS  Snapshots – Also  for

     rapid  replica  provisioning – Slightly  more  complicated  to  orchestrate  Sming   • LVM  Snapshot  (config+shards) • Use  secondaries  for  zero  downSme  backups • h_p://www.mongodb.org/pages/viewpage.acSon? pageId=19562846  
  9. Security  Groups Component Default  Ports MongoD   27017,  28017  (Status

     page) MongoD  Shard  Server 27018 MongoS 27017 ConfigDB 27019 • All nodes listen on all interfaces unless –bind_ip is specified • Specify alternate port with –port • Don’t mix names & IP’s. Names preferred (not ec2s) • Use security groups as access control lists • (e.g. allow 27017 from app servers, but not everybody)
  10. QuesSons?   • Dan  Crosta – [email protected] – @lazlofruvous •

    Try  it  out!   – h_p://www.mongodb.org/downloads – h_p://www.mongodb.org/display/DOCS/Amazon +EC2