MongoDB Ops Manager allows administrators to manage all of their MongoDB infrastructure in one place. Go beyond the "quick start" guide and become an Ops Manager Power User. Learn to automate Ops Manager tasks through the API, how to effectively setup users, groups, and roles for a secure Ops Manager installation, and more. Some previous Ops Manager experience expected.
4. LDAP and User Roles
Why Use LDAP Integration?
● Users/groups already centrally managed
o Active Directory
o OpenLDAP
● Complex password policies
● Prevent new users from signing up
5. LDAP and User Roles
Mapping Ops Manager to LDAP
● Login Attribute
○ uid
○ username
○ email address
● Group(s) attribute
6. LDAP and User Roles
Sample LDAP Configuration
mms.ldap.url=ldap://127.0.0.1:389
mms.ldap.bindDn=CN=_search_
mms.ldap.bindPassword=password
mms.ldap.user.baseDn=OU=Users,O=MongoDB
mms.ldap.user.searchAttribute=emailAddress
mms.ldap.user.group=groups
7. LDAP and User Roles
Sample Global Roles Configuration
mms.ldap.global.role.owner (required)
mms.ldap.global.role.automationAdmin
mms.ldap.global.role.backupAdmin
mms.ldap.global.role.monitoringAdmin
mms.ldap.global.role.userAdmin
mms.ldap.global.role.readOnly
8. LDAP and User Roles
Adding Users and Groups
New users can
not register
9. LDAP and User Roles
Adding Users and Groups
Users in baseDN,
but not belonging
to any groups
cannot sign in
10. LDAP and User Roles
Adding Users and Groups
Global User
Admins can
create new
groups
12. Alerts
Global and System Alerts
ALERTS
SYSTEM ALERTS
Backing Database
Backup Daemons
GLOBAL ALERTS
GROUP ALERTS
Agents Users
Hosts Backups
Clusters
23. Multi-Datacenter Backup
What does Multi-Datacenter mean?
● Geographically distributed corporate owned DCs
● Corporate owned DCs combined with cloud hosted (AWS,
Rackspace, etc.)
● Single DC with several virtual networks
24. Multi-Datacenter Backup
Setup 1: One Instance
All Ops Manager components in a single DC
Pros
● Fewest Ops Manager Components
● Easier to get started
● Easier to maintain
Cons
● Bandwidth costs between DCs
● Restores need to go over network
● All groups on a single set of hardware
26. Multi-Datacenter Backup
Setup 2: Multiple Instances
Pros
● Each instance still simple to setup
● Less bandwidth use
● Restores local
Cons
● Multiple systems to manage
● Duplicated configuration
● More upgrades
28. Multi-Datacenter Backup
Setup 3: One Instance w/ Group Pinning
● The best of both world
● Single Ops Manager instance
● Backup “stack” in each DC
● Pin each Ops Manager group to a “stack”
33. Public API
Overview
● RESTful interface to Ops Manager features
● Must be enabled for each group
● Users have API keys
● HTTP Digest Authentication
● JSON throughout (pretty printing optional)
● Access to certain endpoints is restricted to an IP whitelist
36. Public API
Step 3. Code!
// Script to pull a backup of the last snapshot using the Ops Manager Public API
groupId = 'cbdf73827d0c0a9d9c4d6623'
// Get a list of clusters
clusters = api_get('${groupId}/clusters')
// Find the cluster entity for the replica set named myReplSet
myReplSet = clusters.find_first( c -> c.replicaSetName == 'myReplSet' )
// Get all snapshots for the cluster
snapshots = api_get('${groupId}/clusters/${myReplSet.id}/snapshots')
// The last one is the most recent
lastSnapshot = snapshots[snapshots.length - 1]
37. Public API
Step 3. Code!
// Create a restore job for the last snapshot
// NOTE: a replica set only creates one restore job
restoreJobs = api_post(
'${groupId}/clusters/${myReplSet.id}/restoreJobs',
{ 'snapshotId': lastSnapshot.id } )
restoreJob = restoreJobs[0]
// Poll every 30 seconds until the restore job status is FINISHED
do {
sleep(30)
restoreJob = api_get(
'${groupId}/clusters/${myReplSet.id}/restoreJobs/${restoreJob.id}'
} while (restoreJob.statusName != 'FINISHED')
38. Public API
Step 3. Code!
// Restore ready, so download the .tar.gz file
http_get(restoreJob.delivery.url, 'myReplSet.tar.gz')
// Get the hash and verify the integrity of the downloaded file
restoreJob = api_get(
'${groupId}/clusters/${myReplSet.id}/restoreJobs/${restoreJob.id}')
serverHash = restoreJob.hashes[0].hash
myHash = sha1_hash('myReplSet.tar.gz')
assert(serverHash == myHash)
// Restore succeeded!
// Now uncompress it, shutdown mongod, copy data files, and restart