• Complain

Warnock Dan. - MongoDB: Learn MongoDB in a simple way!

Here you can read online Warnock Dan. - MongoDB: Learn MongoDB in a simple way! full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

No cover
  • Book:
    MongoDB: Learn MongoDB in a simple way!
  • Author:
  • Genre:
  • Rating:
    3 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 60
    • 1
    • 2
    • 3
    • 4
    • 5

MongoDB: Learn MongoDB in a simple way!: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "MongoDB: Learn MongoDB in a simple way!" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Amazon Digital Services LLC, 2016. 62 p. ASIN: B01DKOUZO8This book is an exploration of MongoDB. It begins with a brief overview of MongoDB so as to give the reader an insight into what MongoDB is. The next part is a guide to the user on how to work with replica sets in MongoDB. You will be guided on how to deploy a replica set in MongoDB. Uses of a replica set are explored in detail, and you will learn how to add and then remove them from a replica set. A member of a replica set can also be replaced with another member. This book helps you to know how to do this. The priority of the members of a replica set influences the member who emerges as the leader after an election. You will also know how to change the size of the oplog. The common database commands in MongoDB, and especially the ones which can be executed on the mongo shell, are explored. Data recovery in MongoDB is also discussed. You will be guided on how you can analyze the performance of your database operations, as well as how to rotate your log files.
The following chapters are discussed in this book:
An overview of MongoDB
Deploying a Replica Set
Adding members to a Replica Set
Removal of a Member from a Replica Set
Replacing a Replica Set Member
Setting the Priority for a Member
Changing the Oplog Size
Common Database Commands
Data Recovery
Analyzing the Performance of Database Operations
Rotating Log Files
Backup and Restore

Warnock Dan.: author's other books


Who wrote MongoDB: Learn MongoDB in a simple way!? Find out the surname, the name of the author of the book and a list of all author's works by series.

MongoDB: Learn MongoDB in a simple way! — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "MongoDB: Learn MongoDB in a simple way!" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make

MongoDB

Learn MongoDB in a simple way!

By Dan Warnock

Copyright2016 Dan Warnock

All Rights Reserved

Copyright 2016 by Dan Warnock.

All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the author, except in the case of brief quotations embodied in critical reviews and certain other noncommercial uses permitted by copyright law.

Table of Contents

Disclaimer

While all attempts have been made to verify the information provided in this book, the author does assume any responsibility for errors, omissions, or contrary interpretations of the subject matter contained within. The information provided in this book is for educational and entertainment purposes only. The reader is responsible for his or her own actions and the author does not accept any responsibilities for any liabilities or damages, real or perceived, resulting from the use of this information.

The trademarks that are used are without any consent, and the publication of the trademark is without permission or backing by the trademark owner. All trademarks and brands within this book are for clarifying purposes only and are the owned by the owners themselves, not affiliated with this document.

Introduction

MongoDB is a very powerful NoSQL database in terms of performance and the operations that it can support. It is good for both database developers and programmers. Programmers can link their MongoDB database with the various programming languages. This book helps you to learn MongoDB.

Chapter 1- An overview of MongoDB

The MongoDB database was written in C++. It is among the leading NoSQL databases today. One can achieve a lot in terms of a database with MongoDB. The database offers automatic scaling, high performance, and high availability to database developers.

Chapter 2- Deploying a Replica Set

We need to discuss the process by which one can create a three-member replica set from three MongoDB existing instances which are executed with access control already disabled.

When you have three member replica sets, you will ensure that there is enough redundancy for enabling us to survive failures such as network partitions. They will also provide us with enough capacity to cater to the distributed read operations. The number of members in the replica sets should always be an odd number. This ensures that the elections are done smoothly.

You just have to start the MongoDB instances that are to become members of the replica set, perform a configuration of the replica set, and then have the instances of the MongoDB added to it.

For production deployments, the instances of MongoDB have to be stored in different machines so as to ensure that there is much separation between the members. For those using virtual machines for production deployments, each instance of the MongoDB has to be placed in different host servers serviced by redundant network paths and redundant power circuits.

The procedure

The following steps are necessary for deployment of a replica set when the access control has been disabled:

  1. Use the appropriate options to start each member of your replica set

A mongod should be started for each member and the name of the replica set specified through the option for replSet. For applications connecting to more than one replica set, a distinct name should be specified for each set.

Let us use the option replSet to specify the name of our replica set:

mongod --replSet "rs0"

The specification for this can also be done in the configuration file. For the mongod to be started together with the configuration file, we can use the config option so as to specify this:

mongod --config $HOME/.mongodb/config

In production deployments, an init script can be configured for management of this process.

  1. Connection of the mongo shell to the replica set member

Assuming that you have your mongod running on localhost and on the port 27017, which is the default one, you can use the following:

Mongo

  1. Initiation of the replica set

One should use the function rs.initiate() on their replica set member. This is shown below:

rs.initiate()

MongoDB will initiate a set having the current member, and it will use the default configuration for the replica set.

  1. Verifying the initial configuration of the replica set

The displaying of the replica set configuration object can be done by use of the method rs.conf() . The configuration object for the replica set is as follows:

{

"_id" : "rs0",

"version" : 1,

"members" : [

{

"_id" : 1,

"host" : "mongodb0.example.net:27017"

}

]

}

  1. The remaining members should then be added to the replica set.

This can be done by use of the method rs.add() . Consider the following example, which shows how two members can be added:

rs.add("mongodb0.example.net")

rs.add("mongodb1.example.net")

After completion, you will have a fully functional replica set. It will then elect the primary.

  1. The status of the replica set can then be checked.

The following method can be used to perform this operation:

rs.status()

Chapter 3- Adding members to a Replica Set

An additional member can be added to a replica set which is already in existence. Note that each replica set should have a maximum of seven voting members. For one to add a new member to a replica set which has seven members, you have to add the new member as a non-voting member or remove a vote from one of the existing members.

In the case of production deployments, an init script can be configured for the purpose of management of the member processes.

A member who has been removed from the replica set can be re-added. If the removal of the member had been done recently, the member can be recovered and catch up easily.

For those having a snapshot or a backup of an existing member, the data files can be moved to a new system and then quickly used for initiation of a new member. The files have to be:

  1. A copy of data files which are valid for a member belonging to the same replica set.
  1. The most recent operation in the primarys oplog. The new member has to become the current one once the operations from the primarys oplog have been applied.

Requirements

You should have the following:

  1. A replica set which is active.
  1. A new MongoDB system with the ability to support your data set, and be accessible by your active replica set throughout your network.

The Procedure

  1. Preparation of the Directory

Before we can add the new member to the replica set, we have to prepare the data directory for the new members. You can use any one of the following strategies:

  • Make sure that the data directory for new members has no data. Data will be copied from an existing member by the new member. For a new member in a recovering state, it has to exit and then become a secondary before all the data can be copied by MongoDB as part of the replication process. Note that some time will be required for this process to take place, but the administrator will not be required to intervene in any way.
  • The data directory has to be copied manually from the existing member. The new member will become a secondary member, and it will catch up to the current state of our replica set. When we copy the data, the amount of time required for the new member to become the current one will be shortened.
Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «MongoDB: Learn MongoDB in a simple way!»

Look at similar books to MongoDB: Learn MongoDB in a simple way!. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «MongoDB: Learn MongoDB in a simple way!»

Discussion, reviews of the book MongoDB: Learn MongoDB in a simple way! and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.