In this tutorial, we will create a MongoDB cluster with three nodes. The first node is the master node, the second node is the Failover node, and the third node is the arbitration node.
In this tutorial, we will create a MongoDB cluster with three nodes. The first node is the master node, the second node is the Failover node, and the third node is the arbitration node.
In this tutorial, we will create a MongoDB cluster with three nodes. The first node is the master node, the second node is the Failover node, and the third node is the arbitration node.
1. Install Mongo and set the configuration file
Install three servers and adjust the configuration file/etc/configure D. conf:
# Select your replication set name
ReplSet = [replication_set_name]
# Select the replication log size
OplogSize = 1024
Disable the bind_ip parameter to avoid binding to only 127.0.0.1 interface
# Bind_ip
2. Restart the three mongod daemon.
> Sudo service producer D restart
3. Create Initialization Configuration on the master node
Log on to the master node and create an Initialization Configuration. Note that do not use the return address (127.0.0.1) when using a private IP Address ):
> Mongo
Primary> cfg = {"_ id": "[replication_set_name]", "members": [{"_ id": 0, "host": "[Primary_Host_IP]: 27017 "}]}
Primary> rs. initiate (cfg );
4. Add a Failover instance to the replica set
Primary> rs. add ("[Failover_Host_IP]: 27017 ")
5. Add an arbitration instance to the replica set
Primary> rs. addArb (": 27017 ")
6. Confirm the status of the replica set.
Primary> rs. status ()
Bottom Line
I hope that the installation of each data cluster is as easy as that of the MongoDB replica set.
Set MongoDB to boot automatically in Linux
CentOS compilation and installation of MongoDB
CentOS compilation and installation of php extensions for MongoDB and mongoDB
CentOS 6 install MongoDB and server configuration using yum
Install MongoDB2.4.3 in Ubuntu 13.04
MongoDB beginners must read (both concepts and practices)
MongoDB authoritative Guide (The Definitive Guide) in English [PDF]
MongoDB details: click here
MongoDB: click here