evolve'14 | enhance | nate nelson | aem with mongodb

15
NOVEMBER 17, 2014 AEM WITH MONGODB PRESENTED BY Nate Nelson Fruit or Technology?

Upload: evolve-aem-community-summit

Post on 13-Jul-2015

312 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: EVOLVE'14 | Enhance | Nate Nelson | AEM with MongoDB

NOVEMBER 17, 2014

AEM WITH MONGODB

P R E S E N T E D B YN a t e N e l s o n

Fruit or Technology?

Page 2: EVOLVE'14 | Enhance | Nate Nelson | AEM with MongoDB

2

• Who am I?

– Nate Nelson, 3|Share ROM Team

[email protected]

• Who are you?

– Role with AEM

– Experience with mongoDB

Page 3: EVOLVE'14 | Enhance | Nate Nelson | AEM with MongoDB

3

Questions?

Fruit or Technology?

How is it related to AEM?

What does it mean to us?

What does it mean to our customers?

How do I use it?

How do I support it?

AEM WITH MONGODBIntroduction

“humongous”

-Required for clustering

-Initial release 2009

-Currently 2.6.x

-Document-oriented

database, part of NoSQL

family

-Cross-Platform

Page 4: EVOLVE'14 | Enhance | Nate Nelson | AEM with MongoDB

4

Pros

Improves clustering

High availability

Well documented

Cons

More technology to support

Young software, new to AEM

Memory usage

AEM WITH MONGODBIntroduction

“YES, I get to learn some

new stuff!!!”

“greeeeeeaaaat, more

technology to support…”

“I thought I got away

from DBAs…”

Page 5: EVOLVE'14 | Enhance | Nate Nelson | AEM with MongoDB

5

When to use it?

Required for author clustering

Should I use it on stand alone authors?

Should I use it on publishers?

When not to use it?

?

AEM WITH MONGODBIntroduction

Page 6: EVOLVE'14 | Enhance | Nate Nelson | AEM with MongoDB

6

Installed separately from AEM

Setup mongodb first

Local or dev purposes

• Easy to get up and running

Production installations

• Planning is essential

• This is where mistakes are made

AEM WITH MONGODBInstallation

http://docs.mongodb.org

/manual/installation/

Page 7: EVOLVE'14 | Enhance | Nate Nelson | AEM with MongoDB

7

How to connect AEM to MongoDB

java -jar AEM_6.0_Quickstart.jar –unpack

edit crx-quickstart/bin/start

CQ_RUNMODE = crx3,crx3mongo

JVM Options

-Doak.mongo.uri=mongodb://localhost:27017

Start AEM

Watch mongod.log and AEM error log

Be Patient

AEM WITH MONGODBInstallation

Page 8: EVOLVE'14 | Enhance | Nate Nelson | AEM with MongoDB

8

What is a replica set?

Deploy in odd numbers

What is an Arbiter?

AEM WITH MONGODBHigh Availability

Page 9: EVOLVE'14 | Enhance | Nate Nelson | AEM with MongoDB

9

Can be geographically distributed

Install the majority of nodes in

primary location

Don’t want AEM connecting to

MongoDB from different data

centers

AEM WITH MONGODBHigh Availability

Page 10: EVOLVE'14 | Enhance | Nate Nelson | AEM with MongoDB

10

Setting up replication

Install mongodb on each member

From one member connect to Mongodb shell

rs.initiate()

rs.add("<hostname><:port>")

rs.addArb("<hostname><:port>")

rs.conf()

rs.status()

Connecting to replica set

-

Doak.mongo.uri=mongodb://mongohost1:27017,mongohost2:27017/?replicaSet=aem

6&connectTimeoutMS=10000

AEM WITH MONGODBHigh Availability

Setup replication first then

install AEM 6

Test auto failover, both

with AEM and MongoDB

Page 11: EVOLVE'14 | Enhance | Nate Nelson | AEM with MongoDB

11

Production support

Back up MongoDB separately

• Only need to back up one node

Monitor it

• mongod process

• Replication status

Watch memory usage

Security concerns?

AEM WITH MONGODBSupporting MongoDB

http://docs.mongodb.org/manual

/core/backups/

http://docs.mongodb.org/manual

/administration/monitoring/

Page 12: EVOLVE'14 | Enhance | Nate Nelson | AEM with MongoDB

12

http://docs.mongodb.org/manual

/reference/command/

Terminology to RDBMS

Table, View = Collection

Row = JSON Document

Index = Index

Join = Embedded Document

AEM WITH MONGODBSupporting MongoDB

Useful commands to know

From MongoDB shell

show dbs

use aem-author

db.stats()

rs.status()

db.currentOp()

db.serverStatus()

show log

Tools

mongodump,mongorestore

mongotop

mongostat

built in web interface

Page 13: EVOLVE'14 | Enhance | Nate Nelson | AEM with MongoDB

13

AEM WITH MONGODBLive Demonstration

config files

AEM start file

mongo shell

mongotop

Mongostat

Show active connections

live failover

Page 14: EVOLVE'14 | Enhance | Nate Nelson | AEM with MongoDB

14

Plan and get to know

MongoDB first

AEM WITH MONGODBFinal Notes

-Required for clustering

-Setup MongoDB first

-Use replication in production

-Install 3 or more nodes in odd numbers

-Test failover process

-Be consistent across environments

-Make sure to setup permissions prior to install, also

pid file directory

-Run under a separate user

Page 15: EVOLVE'14 | Enhance | Nate Nelson | AEM with MongoDB

15

• Thank you

– Nate Nelson, 3|Share ROM Team

[email protected]

• 3|Share ROM blog