Sharding for Mere Mortals
 

Sharding for Mere Mortals

on

  • 2,514 views

 

Statistics

Views

Total Views
2,514
Views on SlideShare
2,438
Embed Views
76

Actions

Likes
0
Downloads
5
Comments
1

4 Embeds 76

http://www.10gen.com 53
http://www.mongodb.com 18
http://drupal1.10gen.cc 4
https://comwww-drupal.10gen.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • Slide 29 includes 'my app' and 'mayapp' when in both cases I think you meant 'myapp'.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Sharding for Mere Mortals Presentation Transcript

  • 1. Sharding for Mere MortalsMongoDB AustinAntonio RosalesFebruary 15, 2013
  • 2. Deploying Your App● I got some ideas.● I have heard there are some great tools to use.● How can I deploy with limited: ○ time and knowledge?
  • 3. Lots to Readhttps://juju.ubuntu.com/
  • 4. Wake Uphttp://synchealthblog.files.wordpress.com/2011/01/i-love-waking-up.gif
  • 5. Eathttp://i.somethingawful.com/u/garbageday/2011/Comedy_Goldmine/drawmyav/peterjmatt_01.jpghttp://images.cpcache.com/merchandise/514_230x230_NoPeel.jpg?region=name:FrontCenter,id:60672883,w:16
  • 6. Workhttp://explicitlyrics.us/images/comment/leftcomputer.png
  • 7. Familyhttp://www.harbus.org/wp-content/uploads/2011/10/Old-fashioned-couple.jpg
  • 8. Familyhttp://www.sunnking.com/assets/images/blog/story-of-electronics.jpg
  • 9. Sleephttp://www.patspapers.com/images/uploads/beautysleep.jpg
  • 10. Normal Day Or . .http://www.sunnking.com/assets/images/blog/story-of-electronics.jpg
  • 11. Gamehttp://www.mariomayhem.com/fun/colour_mario_in/Mario_Coloring_029_1_up.jpg
  • 12. Watchhttps://developers.google.com/youtube/images/YouTube_watermark_black.png
  • 13. Make a Discoveryhttps://developers.google.com/youtube/images/YouTube_watermark_black.png
  • 14. Train for the Olympicshttp://www.visitmudgeeregion.com.au/mrti/wp-content/uploads/2012/09/Weight_Lifting_09.jpg
  • 15. Be a Ninjahttp://us.123rf.com/400wm/400/400/dclipart/dclipart1206/dclipart120600158/13932293-ninja-fighter--vector-illustration-vinyl-ready.jpg
  • 16. Drink Beer(s)http://farm8.staticflickr.com/7054/6934838001_58ac314d5c_z.jpg
  • 17. Sleephttp://www.patspapers.com/images/uploads/beautysleep.jpg
  • 18. Repeathttp://cdn1.iconfinder.com/data/icons/nounproject/512/290.png
  • 19. Still Havent Readhttps://juju.ubuntu.com/
  • 20. Time Not enough unless you have . . .http://1.bp.blogspot.com/-KSGB6DryCsc/UFHnDErwbMI/AAAAAAAAAIg/72cRrHtBnCo/s1600/Infinity+Time.JPG
  • 21. Delorean Time Machinehttp://media.giantbomb.com/uploads/2/26725/870907-delorean_super.jpg
  • 22. Wormholehttp://kauilapele.files.wordpress.com/2011/08/wormhole_by_stefitms_50.jpg
  • 23. Time Turnerhttp://www.pinkraygun.com/wp-content/uploads/2010/08/Time-Turner1.jpg
  • 24. Star Gatehttp://images.cryhavok.org/d/18278-2/Stargate.png
  • 25. Brain Envy My brain Your brainhttp://www.builttosell.com/wp-content/uploads/2011/09/brain.png
  • 26. How Can I configure, deploy, scale?https://juju.ubuntu.com/http://clean.alltheragefaces.com/img/faces/large/sad-sad-l.png
  • 27. ● Distills DevOps knowledge into Charms ○ Repeatable, Scalable, Relatable, Sharablehttps://juju.ubuntu.comhttp://www.ubuntu.com/static/u/img/logos/logo-juju-143x143.png
  • 28. Deploy over 100 Charmshttps://juju.ubuntu.comhttp://maas.ubuntu.comhttp://www.blogcdn.com/www.engadget.com/media/2012/11/laptop-ubuntu-xps13.png
  • 29. 0 to Deployed ● Install Juju ○ sudo apt-get-repository ppa:juju/pkgs ○ sudo apt-get update && sudo apt-get install juju ● Configure environments.yaml for interested cloud ○ juju bootstrap ○ ~/.juju/environments.yaml ● Deploy ○ juju deploy node-app my app ○ juju deploy mongodb ○ juju add-relation mongodb mayapp ○ juju expose myapp
  • 30. Taking It Further ● Scale ○ juju add-unit -n 10 myapp ● Add load balancing ○ juju deploy haproxy ○ juju add-relation myapp haproxy ● Add Monitoring ○ juju deploy nagios ○ juju add-relation myapp nagios
  • 31. GUI
  • 32. Sharding ExampleBootstrap the environmentjuju bootstrapMongo Shelljuju deploy mongodb mongosConfig Servers ( well deploy 3 of them )juju deploy mongodb configsvr --config ~/mongodb-shard.yaml -n3Shards ( Well deploy three replica-sets )juju deploy mongodb shard1 --config ~/mongodb-shard.yaml -n3juju deploy mongodb shard2 --config ~/mongodb-shard.yaml -n3juju deploy mongodb shard3 --config ~/mongodb-shard.yaml -n3Connect the Config Servers to the Mongo shell (mongos)juju add-relation mongos:mongos-cfg configsvr:configsvrConnect each Shard to the Mongo shell (mongos)juju add-relation mongos:mongos shard1:databasejuju add-relation mongos:mongos shard2:databasejuju add-relation mongos:mongos shard3:database
  • 33. Sharding Example● Verify your config servers ○ juju expose configsvr ○ juju status configsvr ○ Open your browser to http://<public-address-of-configsvr:28017● Verify that each shard ○ juju expose <shard1|shard2|shard3> ○ juju status <shard1|shard2|shard3> ○ Open your browser to http://<public-address-of-shard>:28017● Verify that each shard has been successfully register with the cluster: ○ juju expose mongos ○ juju status mongos ○ mongo --host <public-address-of-mongos>:27021 ○ Once connected: ■ sh.status()
  • 34. Sharding Example ● sh.status should return:mongos> sh.status()--- Sharding Status --- sharding version: { "_id" : 1, "version" : 3 } shards: { "_id" : "shard1", "host" : "shard1/ec2-184-169-236-25.us-west-1.compute.amazonaws.com:27017,ec2-54-241-89-206.us-west-1.compute.amazonaws.com:27017,ip-10-170-173-51:27017" } { "_id" : "shard2", "host" : "shard2/ec2-204-236-159-194.us-west-1.compute.amazonaws.com:27017,ip-10-170-22-104:27017" } { "_id" : "shard3", "host" : "shard3/ec2-184-169-219-11.us-west-1.compute.amazonaws.com:27017,ec2-184-169-239-214.us-west-1.compute.amazonaws.com:27017,ip-10-170-215-20:27017" } databases: { "_id" : "admin", "partitioned" : false, "primary" : "config" }mongos>
  • 35. Get Involved ● juju@lists.ubuntu.com ● #juju on IRC Freenode ● juju.ubuntu.com ● Interested in Charming: ○ Embed best practice into charms
  • 36. Thanks!MongoDB Austinantonio.rosales@canonical.com