Upgrade to Pro — share decks privately, control downloads, hide ads and more …

MongoDB Bangalore Workshop

MongoDB Bangalore Workshop

How to get started with OpenShift and use it to deploy MongoDB application.

Shekhar Gulati

October 25, 2012
Tweet

More Decks by Shekhar Gulati

Other Decks in Programming

Transcript

  1. 1 0 to AWESOME in Minutes with Red Hat's OpenShift

    and MongoDB Shekhar Gulati @shekhargulati OpenShift Evangelist, Red Hat
  2. 2 Agenda • What is PaaS? • Let's become friends

    with OpenShift • What does development look like ? • Getting your hands dirty
  3. 3 1) You know some MongoDB 2) You know some

    Java 3) You prefer to write code and apps over managing servers or you prefer managing servers rather than dealing with annoying developer requests Assumptions
  4. 6 Benefits of PaaS  Lets developer focus on his

    job i.e. to write code.  You develop “Cloud Aware” applications from the beginning.  Improves developer productivity.  Reduces cost and time to market.  Brings agility to product development.  Gives developers the power to prototype their ideas rapidly.
  5. 8 Introducing OpenShift  A free auto-scaling, cloud-based application platform

    from Red Hat.  Multi Language, Multi Frameworks, Multi Cartridges.  No proprietary software.  No Lock-in.  Open source – OpenShift Origin.
  6. 10 What else do I get and what is the

    catch?  OpenShift is free-as-in-beer & free-as-in-freedom  You get three free gears, each with 512MB memory and 1GB of disk space.  Need more resources, just ask!  The catch is we are in developer preview right now
  7. 11 1. Deploying application on OpenShift using command line tools

    2. Create a Wordpress app from the web console (if time permits) Note : The promo code is bangalore Demo
  8. 12 Some terminology for today 1. Application – your web

    code and any data store. Has to be on 1 or more gears 2. Gear – is like a server. It can have only 1 language for the web programming. 3. Cartridge – it adds a language, a data store, or other functionality 4. Git – used for version control and managing code between server and your development machine 5. Ssh – command line tool to connect to your gear
  9. 15 Installing Client Tools Install Ruby 1.8.7 or greater Install

    Git Install rhc OpenShift gem Refer to documentation
  10. 17 Let's take a look at GIT Distributed Version control

    A local repository – on your laptop A remote repository – on some other machine, usually a server
  11. 18 You need to understand at least 3 commands in

    Git 1. Git add . (means add all new files as being tracked in the local repository) 2. Git commit –am “your message” (means commit all my changes to the local repository with this message) 3. Git push (means push from your local repository to the repository on your OpenShift gear)
  12. 20 Adding MongoDB and RockMongo Cartridge rhc app cartridge add

    -a notebook -c mongodb-2.0 rhc app cartridge add -a notebook -c rockmongo-1.1
  13. 21 Play with MongoDB running in the Cloud ssh into

    instance Type mongo on the shell Create a sample db Insert some documents in the collection Run some queries
  14. 22 Pulling the code from GitHub git rm -rf src

    pom.xml git commit -am “removed default files” git remote add notebook -m master git://github.com/shekhargulati/notebook-part1.git git pull -s recursive -X theirs notebook master
  15. 26 1. OpenShift makes life great for you 2. The

    tools are easy to use 3. You should be ready to write services 4. Almost anything you need on a server 5. Did I mention – Free Conclusion