MongoDB Administrator’s Guide

Manage, fine-tune, secure and deploy your MongoDB solution with ease with the help of practical recipes
Preview in Mapt

MongoDB Administrator’s Guide

Cyrus Dasadia

Manage, fine-tune, secure and deploy your MongoDB solution with ease with the help of practical recipes
Mapt Subscription
FREE
$29.99/m after trial
eBook
$10.00
RRP $31.99
Save 68%
Print + eBook
$39.99
RRP $39.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$10.00
$39.99
$29.99 p/m after trial
RRP $31.99
RRP $39.99
Subscription
eBook
Print + eBook
Start 30 Day Trial

Frequently bought together


MongoDB Administrator’s Guide Book Cover
MongoDB Administrator’s Guide
$ 31.99
$ 10.00
AWS Administration - The Definitive Guide - Second Edition Book Cover
AWS Administration - The Definitive Guide - Second Edition
$ 35.99
$ 10.00
Buy 2 for $20.00
Save $47.98
Add to Cart

Book Details

ISBN 139781787126480
Paperback226 pages

Book Description

MongoDB is a high-performance and feature-rich NoSQL database that forms the backbone of the systems that power many different organizations. Packed with many features that have become essential for many different types of software professional and incredibly easy to use, this cookbook contains more than 100 recipes to address the everyday challenges of working with MongoDB.

Starting with database configuration, you will understand the indexing aspects of MongoDB. The book also includes practical recipes on how you can optimize your database query performance, perform diagnostics, and query debugging. You will also learn how to implement the core administration tasks required for high-availability and scalability, achieved through replica sets and sharding, respectively. You will also implement server security concepts such as authentication, user management, role-based access models, and TLS configuration. You will also learn how to back up and recover your database efficiently and monitor server performance.

By the end of this book, you will have all the information you need—along with tips, tricks, and best practices—to implement a high-performance MongoDB solution.

Table of Contents

Chapter 1: Installation and Configuration
Introduction
Installing and starting MongoDB on Linux
Installing and starting MongoDB on macOS
Binding MongoDB process to a specific network interface and port
Enabling SSL for MongodDB
Choosing the right MongoDB storage engine
Changing storage engine
Separating directories per database
Customizing the MongoDB configuration file
Running MongoDB as a Docker container
Chapter 2: Understanding and Managing Indexes
Introduction
Creating an index
Managing existing indexes
How to use compound indexes
Creating background indexes
Creating TTL-based indexes
Creating a sparse index
Creating a partial index
Creating a unique index
Chapter 3: Performance Tuning
Introduction
Configuring disks for better I/O
Measuring disk I/O performance with mongoperf
Finding slow running queries and operations
Storage considerations when using Amazon EC2
Figuring out the size of a working set
Chapter 4: High Availability with Replication
Introduction
Initializing a new replica set
Adding a node to the replica set
Removing a node from the replica set
Working with an arbiter
Switching between primary and secondary nodes
Changing replica set configuration
Changing priority to replica set nodes
Chapter 5: High Scalability with Sharding
Understanding sharding and its components
Setting up and configuring a sharded cluster
Managing chunks
Moving non-sharded collection data from one shard to another
Removing a shard from the cluster
Understanding tag aware sharding – zones
Chapter 6: Managing MongoDB Backups
Introduction
Taking backup using mongodump tool
Taking backup of a specific mongodb database or collection
Taking backup of a small subset of documents in a collection
Using bsondump tool to view mongodump output in human readable form
Creating a point in time backup of replica sets
Using the mongoexport tool
Creating a backup of a sharded cluster
Chapter 7: Restoring MongoDB from Backups
Introduction
Restoring standalone MongoDB using the mongorestore tool
Restoring specific database or specific collection
Restoring data from one collection or database to another
Creating a new MongoDB replica set node using backups
Restoring a MongoDB sharded cluster from backup
Chapter 8: Monitoring MongoDB
Introduction
Monitoring MongoDB performance with mongostat
Checking replication lag of nodes in a replica set
Monitoring and killing long running operations on MongoDB
Checking disk I/O usage
Collecting MongoDB metrics using Diamond and Graphite
Chapter 9: Authentication and Security in MongoDB
Introduction
Setting up authentication in MongoDB and creating a superuser account
Creating normal users and assigning built-in roles
Creating and assigning custom roles
Restoring access if you are locked out
Using key files to authenticate servers in a replica set
Chapter 10: Deploying MongoDB in Production
Introduction
Configuring MongoDB for a production deployment
Upgrading production MongoDB to a newer version
Setting up and configuring TLS (SSL)
Restricting network access using firewalls

What You Will Learn

  • Install and deploy MongoDB in production
  • Manage and implement optimal indexes
  • Optimize monitoring in MongoDB
  • Fine-tune the performance of your queries
  • Debug and diagnose your database's performance
  • Optimize database backups and recovery and ensure high availability
  • Make your MongoDB instance scalable
  • Implement security and user authentication features in MongoDB
  • Master optimal cloud deployment strategies

Authors

Table of Contents

Chapter 1: Installation and Configuration
Introduction
Installing and starting MongoDB on Linux
Installing and starting MongoDB on macOS
Binding MongoDB process to a specific network interface and port
Enabling SSL for MongodDB
Choosing the right MongoDB storage engine
Changing storage engine
Separating directories per database
Customizing the MongoDB configuration file
Running MongoDB as a Docker container
Chapter 2: Understanding and Managing Indexes
Introduction
Creating an index
Managing existing indexes
How to use compound indexes
Creating background indexes
Creating TTL-based indexes
Creating a sparse index
Creating a partial index
Creating a unique index
Chapter 3: Performance Tuning
Introduction
Configuring disks for better I/O
Measuring disk I/O performance with mongoperf
Finding slow running queries and operations
Storage considerations when using Amazon EC2
Figuring out the size of a working set
Chapter 4: High Availability with Replication
Introduction
Initializing a new replica set
Adding a node to the replica set
Removing a node from the replica set
Working with an arbiter
Switching between primary and secondary nodes
Changing replica set configuration
Changing priority to replica set nodes
Chapter 5: High Scalability with Sharding
Understanding sharding and its components
Setting up and configuring a sharded cluster
Managing chunks
Moving non-sharded collection data from one shard to another
Removing a shard from the cluster
Understanding tag aware sharding – zones
Chapter 6: Managing MongoDB Backups
Introduction
Taking backup using mongodump tool
Taking backup of a specific mongodb database or collection
Taking backup of a small subset of documents in a collection
Using bsondump tool to view mongodump output in human readable form
Creating a point in time backup of replica sets
Using the mongoexport tool
Creating a backup of a sharded cluster
Chapter 7: Restoring MongoDB from Backups
Introduction
Restoring standalone MongoDB using the mongorestore tool
Restoring specific database or specific collection
Restoring data from one collection or database to another
Creating a new MongoDB replica set node using backups
Restoring a MongoDB sharded cluster from backup
Chapter 8: Monitoring MongoDB
Introduction
Monitoring MongoDB performance with mongostat
Checking replication lag of nodes in a replica set
Monitoring and killing long running operations on MongoDB
Checking disk I/O usage
Collecting MongoDB metrics using Diamond and Graphite
Chapter 9: Authentication and Security in MongoDB
Introduction
Setting up authentication in MongoDB and creating a superuser account
Creating normal users and assigning built-in roles
Creating and assigning custom roles
Restoring access if you are locked out
Using key files to authenticate servers in a replica set
Chapter 10: Deploying MongoDB in Production
Introduction
Configuring MongoDB for a production deployment
Upgrading production MongoDB to a newer version
Setting up and configuring TLS (SSL)
Restricting network access using firewalls

Book Details

ISBN 139781787126480
Paperback226 pages
Read More

Read More Reviews

Recommended for You

Web Development with MongoDB and Node - Third Edition Book Cover
Web Development with MongoDB and Node - Third Edition
$ 31.99
$ 10.00
Practical Reinforcement Learning Book Cover
Practical Reinforcement Learning
$ 35.99
$ 10.00
Understanding Software Book Cover
Understanding Software
$ 23.99
$ 10.00
Mastering Assembly Programming Book Cover
Mastering Assembly Programming
$ 35.99
$ 10.00
Architecting Modern Java EE Applications Book Cover
Architecting Modern Java EE Applications
$ 39.99
$ 10.00
Data Science Algorithms in a Week Book Cover
Data Science Algorithms in a Week
$ 31.99
$ 10.00