Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Free Mongo on OpenShift


Published on

My talk to the Bay Area Mongo Users Group. It has a basic introduction to PaaS, OpenShift, and using Openshift, RockMongo, and MMS on OpenShift.

Published in: Technology

Free Mongo on OpenShift

  1. 1. Getting Started with Mongo DB & OpenShift Aka Free Mongo applications for you! Steve Citron-Pousty Developer Evangelist, Red Hat March 20, 20121
  2. 2. Agenda • What is OpenShift? • Getting Started • Using Mongo with OpenShift • Next Steps2
  3. 3. My Goal for today  Introduce you to OpenShift  Get you comfortable with using the tools.  I want you to be ready to start writing apps A bit about me: Long time Java, RDBMS, Spatial New to: OpenShift and Mongo3
  4. 4. Assumptions 1) You might know some Mongo 2) You have a favorite programming language 3) You are comfortable with the command line (for now) 4) You might know GIT 5) You are unfamiliar with PaaS PLEASE ASK QUESTIONS!!!!4
  5. 5. What is OpenShift? Red Hat’s free platform as a service for applications in the cloud.5
  6. 6. Kind of like Amazon, right? Nope.6
  7. 7. What’s Infrastructure as a Service?• Network, storage and compute offered as an on- demand service• Basically, servers in the cloud• You’re still on the hook to configure & manage the cloud & stack• Example: Amazon EC2 “How do I use this?”7
  8. 8. What’s Platform as a Service?• It’s an application platform• Basically, an app run-time environment in the cloud• PaaS configures & manages the cloud & stack for you• Example: OpenShift “The cloud is now useful!”8
  9. 9. What’s Software as a Service?• It’s an on-demand application• Nothing to install or configure• Example: Salesforce, Gmail “This is all my customers and users care about!”9
  10. 10. So, why should I use a PaaS? • Realize the benefits of the cloud quickly • Let the PaaS configure, manage & scale the stack • Make deployments to the cloud easy • Focus on your app & users, not the stack10
  11. 11. What’s supported?11
  12. 12. How does it work?• Install the client tools• Create a domain name• Create an application rhc-create-app –a my_app –t my_lang• Congrats! You are now in the cloud!12
  13. 13. Looks great, but how much does it cost?• OpenShift is free-as-in-beer• Five 512 MB RAM / 1 GB Storage instances• Need more resources, just ask!13
  14. 14. But, First…. SSH • To keep things secure we do most things over SSH • You need to have your keys working properly Git • Is used to push changes to apps on OpenShift • Is a distributed revision control and source code management system Builds • Java – we use Maven • For others we just copy from the git repo over14
  15. 15. So, Let’s Get Started! 1. Sign up 2. Install the client tools 3. Create a domain name 4. Create an application15
  16. 16. DEMO – Finally!16
  17. 17. So here are the steps1) Create an account on using the web console2) Create a Domain using the command line • Remember your domain has to be unique to the namespace. • It will be used in all your apps urls3) Then go ahead and create an app4) I am going to use eclipse to add other cartridges and edit the source code • Make sure to store the usernames and passwords for the mongo and rockmongo5) You can now modify the source and then commit and push to remote repository17
  18. 18. 1. Sign Up! • • All it takes is an email address • Promo Code: BAMUG18
  19. 19. Now to install the client tools On the openshift site: OpenShift > Community > Knowledge Base > Installing OpenShift Express client tools… Basically 1. Install ruby and ruby gems 2. Gem install rhc 3. Make sure you have git and ssh19
  20. 20. On the different platforms  Easy Cheesy on Linux machines  Mac you need to install the full Xcode  Windows…well a bit more work20
  21. 21. Don’t have Cygwin installed? Get it here:
  22. 22. Hold up, what’s Cygwin? A Linux-like environment for Windows making it possible to port software running on Linux systems to Windows.22
  23. 23. 2. Install the Client Tools on Windows • What you are going to need: Cygwin • Plus these cygwin components: • openssh • Ruby • Git • You will need all these for SSH and for advanced command line usage. Eclipse plugin does a lot23
  24. 24. 2. Install the Client Tools on Windows Next, download and extract rubygems from:
  25. 25. 2. Install the Client Tools on Windows • In Cygwin run: $ ruby <path_to_extracted_rubygems>/setup.rb install Cygwin is unix so your path looks like c:/<path_to_extracted_rubygems>/setup.rb install • Install the gem $ gem install rhc25
  26. 26. Quick Tip: Client Tool Commands rhc-* : prefix for all commands rhc-create-domain : Create a namespace rhc-create-app : Create an application rhc-ctl-app : Control an app and embed components rhc-snapshot : Backup and restore an application26
  27. 27. 3. Create a Domain Name $ rhc domain create –n <your domain> -l <your login> Password: • When creating apps the URLs will look like this: http://<app name>-<your domain> Example: http://javarules-jgsdomain.rhcloud.com27
  28. 28. Some tech to help with more learning forOpenShift 1. Git – the source control and publishing system to openshift. For SVN users: 2. Eclipse tooling – use the latest Jboss Studio plugin 3. -bliss 4. Our new shiny web console
  29. 29. 4. Create an Application $ rhc app create –a <your app name> -t jbossas-7 Password:29
  30. 30. Mongo Specific awesomeness RockMongo MMS Spatial is enabled Sharding and replication are not running yet but they will be by time we leave Beta30
  31. 31. GitHub • Full featured applications on GitHub • • BeerShift • • A whole bunch31
  32. 32. One more demo A little bit of spatial goodness Mongo has built in 2D spatial indexing capabilities You can build your own FourSquare or similar app. Quick demo of loading some spatial data on an OpenShift Mongo Instance and then doing a query at the command line (or in RockMongo)32
  33. 33. Next Steps • Forum: • Email: • IRC: #openshift on freenode33