Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
MongoDB High Availability

You're reading from   MongoDB High Availability Design and implement a highly available server using the latest features of MongoDB.

Arrow left icon
Product type Paperback
Published in Jul 2014
Publisher
ISBN-13 9781783986729
Length 164 pages
Edition 1st Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Afshin Mehrabani Afshin Mehrabani
Author Profile Icon Afshin Mehrabani
Afshin Mehrabani
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. Understanding the MongoDB Architecture and Processes FREE CHAPTER 2. Understanding MongoDB's Failures and Limitations 3. Clustering in MongoDB 4. Utilizing a Replica Set 5. Replica Set in Action 6. Understanding the Concept of Sharding 7. Sharding in Action 8. Analyzing and Improving Database Performance 9. Migrating Instances and Reducing Downtime 10. Monitoring and Troubleshooting the Database Index

Deploying a replica set


Having completed the initialization steps, we can now start to define our first replica set. First of all, you need to run the mongod process on all machines through the following steps:

  1. Make sure that you have the configuration file in your machine, and then run the following command:

    mongod --config /etc/mongodb.conf
    

    Note

    In Unix operating systems, if you don't have sufficient permissions to run the command, you can use the sudo prefix. So the complete command will be sudo mongod --config /etc/mongodb.conf.

  2. After issuing the command, you should see the result depicted in the following screenshot:

  3. Because we set the fork property to true, mongod will run as a daemon in the background. So, in order to see the logs and outputs of mongod, you should use the defined logpath file. You can see the logfile content as shown in the following screenshot:

  4. For the next steps, you should use mongo interactive shell to run and configure the replica set.

  5. Run the mongo command from your...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime