mongodb on azure - tips, tricks and examples

25
MongoDB on Azure - Tips, Tricks and Examples MongoDB world 2014 David Makogon, Enterprise Architect, Azure Brian Benz, Sr. Technical Evangelist, Microsoft Open Technologies, Inc.

Upload: mongodb

Post on 26-Jan-2015

116 views

Category:

Technology


1 download

DESCRIPTION

 

TRANSCRIPT

Page 1: MongoDB on Azure - Tips, Tricks and Examples

MongoDB on Azure - Tips, Tricks and Examples

MongoDB world 2014

David Makogon, Enterprise Architect, Azure

Brian Benz, Sr. Technical Evangelist, Microsoft Open Technologies, Inc.

Page 2: MongoDB on Azure - Tips, Tricks and Examples

Agenda

• Azure

• MongoDB Options - NoSQL on Azure IaaS, PaaS, SaaS

• MongoDB on Azure

• Q&A

Page 3: MongoDB on Azure - Tips, Tricks and Examples

Azure

Flexible

Page 4: MongoDB on Azure - Tips, Tricks and Examples

Your Datacent

er

Virtualization

O/S

Hardware

Network

Data

Applications

Firewall

Web Sites

Applications

Data

Cloud Service

sApplication

s

Firewall Rules

Data

Virtual Network

Virtual Machin

es

Virtual Network

Data

Applications

Firewall Rules

O/S

Focus on the Application

Microsoft Azure

Page 5: MongoDB on Azure - Tips, Tricks and Examples

Web SitesCloud

ServicesVirtual

Machines

Linux / Windows

VNETs / VPN

Stateful OS

RDP / SSH

External ACL

Hyper-V compatible

Larger Attached Storage

Multiple TCP / UDP ports

Startup Scripts

VNETs / VPN

Stateless OS

RDP

External ACL

Staging / Prod

Larger instances

Multiple TCP / UDP ports

Managed OS

Framework gallery

Git integration

Shared Disks

Instant Deploy

Staging / Prod

Free tier

Web Jobs

Site Backups

Managed OS

Page 6: MongoDB on Azure - Tips, Tricks and Examples

Which deployment model to use?

Linux Required?

Yes

No

Use VMs

Hybrid Infrastructure

Yes

No

VMs or Cloud Services

Additional components? Remote Desktop?

Yes

VMs or Cloud Services

Consider Web Sites

No

Yes

No Yes

No

Page 7: MongoDB on Azure - Tips, Tricks and Examples

Azure Virtual Machines – OS Options

Windows Server

OpenSUSE and SUSE Enterprise

CentOS

Ubuntu

Oracle Linux

Page 8: MongoDB on Azure - Tips, Tricks and Examples

vmdepot.msopentech.com

David Makogon
zoom this one in.
Brian Benz
I use these for reference, I alsways show the site live.
Page 9: MongoDB on Azure - Tips, Tricks and Examples

Docs - azure.microsoft.com/documentation/

Page 10: MongoDB on Azure - Tips, Tricks and Examples

SDKs - azure.microsoft.com/downloads

Page 11: MongoDB on Azure - Tips, Tricks and Examples

CLIs - azure.microsoft.com/downloads

David Makogon
Not sure we need this. We can easily open a command prompt / shell.
Brian Benz
Will show live, but it;s a nice intro, and a backup if net connectivity fails
Page 12: MongoDB on Azure - Tips, Tricks and Examples

OSS DevOps - msopentech.com/projects

Page 13: MongoDB on Azure - Tips, Tricks and Examples

The Landscape – MongoDB on Azure

MongoDB is easily installable on Linux or Windows

VMs up to 112GB + 16TB attached storage

Easy to ACL input traffic or just place in VNet

Hosted MongoDB too -–MongoLab–MongoDB Inc.

David Makogon
David Makogon
I reworked this - let me know what you think
Brian Benz
I really want to take out MongoHQ - they're nice guys but we risk annoying partners we have formal agreements with.
Page 14: MongoDB on Azure - Tips, Tricks and Examples

Support and Alerts

Custom Admin Tools

Backup and Recover

Performance Analysis – Slow Query Analyzer

Monitoring and Support

Page 15: MongoDB on Azure - Tips, Tricks and Examples

MongoDB

David Makogon
I'd skip this slide and demo it live.
Brian Benz
same thing, there for reference/fallback.
Page 16: MongoDB on Azure - Tips, Tricks and Examples

Replica set hosted

on Azurevirtual machines

Replica Set

Primary

Secondary

Secondary

DriverYour Application

Replica Sets: High Availability

David Makogon
Page 17: MongoDB on Azure - Tips, Tricks and Examples

Shards, config servers and mongos (router) hosted on Azure virtual machines

Key range A-D

Primary

Secondary

Secondary

Sharding: Scalability

Key range E-G

Primary

Secondary

Secondary

Key range G-Z

Primary

Secondary

Secondary

Your Application

Mongos (router)

Page 18: MongoDB on Azure - Tips, Tricks and Examples

Example: Provisioning a Replica Set

azure vm create mongocluster –o "vmdepot-40398-1-1.vhd" username password -l "West US" -e 22

azure vm create mongocluster -o "vmdepot-40398-1-1.vhd" username password -l "West US" -e 23 -c

azure vm create mongocluster –o "vmdepot-40398-1-1.vhd" username password -l "West US" -e 24 -c

azure vm endpoint create mongoc9 27017 27017azure vm endpoint create mongoc9-2 27018 27018azure vm endpoint create mongoc9-3 27019 27019

…start mongod, initialize replica set

David Makogon
How about just run this instead of showing the slide?
Brian Benz
Can do, may take too long, leaving it for reference
Page 19: MongoDB on Azure - Tips, Tricks and Examples

azure topic verb options

Command Line Syntax Overviewprompt>

accountaccount locationaccount affinity-groupvmvm diskvm endpointvm imageserviceservice certsiteconfig

downloadimportlistshowdeletestartrestartshutdowncapturecreateattachdetachbrowseset

usernamepassworddns-prefixvm-namelb-porttarget-image-namesource-pathdisk-image-namesize-in-gbthumbprintvalue-v-vv

David Makogon
I don't see how this slide is in-scope for this talk
Brian Benz
Good intro to CLI, script in subsequent slides
Brian Benz
Intro the CLI, show how you configure HA Mongo on Azure, then show the comands to make it happen, then talk about the way to automate that with cmdlets.
Page 20: MongoDB on Azure - Tips, Tricks and Examples

Scripting Capabilities

Automation Support• Azure PowerShell Cmdlets

• Cross Platform Scripting Built on node.js

Capabilities• Provisioning, Removal• Reboot, Start• Import and Export VM settings• Support for Windows and Linux VMs• Domain Join at Provision for Windows• Fully Customize VM with Data Disks and

Endpoint Configuration• Automate Virtual Network Settings

David Makogon
Not sure this is in scope
Brian Benz
I explain how you can save the previus script to be distributed and reused via cmdlets
Page 21: MongoDB on Azure - Tips, Tricks and Examples

Demo

Azure, Virtual Machines, MongoDB, WCF Data Services , PowerBI

MongoDB as a Document Store:

OData service from MongoDB

Page 22: MongoDB on Azure - Tips, Tricks and Examples

Demo

Azure, Virtual Machines, MongoDB, Mobile Services

MongoDB with Mobile Services

Page 23: MongoDB on Azure - Tips, Tricks and Examples

Where to learn more

Tutorial: Building a multi-tier cloud application on Azure using MongoLab, node.js, and Socket.IOhttp://aka.ms/C72pp8

Tutorial: Using MongoDB, Windows Communication Foundation, OData, and PowerBI to build a Business Intelligence solution on Azurehttp://aka.ms/Di7d4r

MongoDB on Azure VM - http://aka.ms/Nnjwgu

Install MongoDB on a virtual machine running Windows Server in Azure:http://aka.ms/Py8c6b

Node.js Web Application with Storage on MongoDB (Virtual Machine):Create an Azure web site that connects to MongoDB running on a virtual machine in Azure:http://aka.ms/Xyzxgd

David Makogon
create bit.ly links or something - these are too long
Brian Benz
will shorten
Page 24: MongoDB on Azure - Tips, Tricks and Examples

Other ResourcesMicrosoft Open Technologies Blog:http://msopentech.com/blog/

VM Depot:http://vmdepot.msopentech.com

Azure development:http://azure.microsoft.com

SDKs and Command Line Tools:http://azure.microsoft.com/en-us/downloads/

Azure Training Kit:http://aka.ms/Mjqnk6

Microsoft Web Platform Installer:http://www.microsoft.com/web/downloads/platform.aspx

Web Matrixhttp://www.microsoft.com/web/webmatrix/

Project Kuduhttps://github.com/projectkudu/kudu

David Makogon
Brian Benz
All my troubles seemed so far away.
Page 25: MongoDB on Azure - Tips, Tricks and Examples

Q&A