Posts

Showing posts with the label MongoDB

MongoDB Replication Configuration

                    MongoDB Replication Configuration: while replication in mongodb if it show error like "not master" then run rs.slaveOk() command on secondary node side it will solve issue. ==================================================== Replication- mongoDB 1.Start by creating a data directory for each replica set member: mkdir /data/node1 mkdir /data/node2 mkdir /data/arbiter 2. mongod --replSet myapp --dbpath /data/node1 --port 40000 mongod --replSet myapp --dbpath /data/node2 --port 40001 mongod --replSet myapp --dbpath /data/arbiter --port 40002 3. run mongo hostname:40000 to rum client on primary, and then run the rs.initiate() command: > rs.initiate() { "info2" : "no configuration explicitly specified -- making one", "me" : "arete:40000", "info" : "Config now saved locally. Should come online in about a minute .", "ok" : 1 } 4.You can now add the o...

What is MongoDB

                   MongoDB - Document Oriented NoSQL DataBase: MongoDB is one of several database types to arise in the mid-2000s under the NoSQL banner. Instead of using tables and rows as in relational databases , MongoDB is built on an architecture of collections and documents. Documents comprise sets of key-value pairs and are the basic unit of data in MongoDB. Collections contain sets of documents and function as the equivalent of relational database tables. Like other NoSQL databases, MongoDB supports dynamic schema design, allowing the documents in a collection to have different fields and structures. The database uses a document storage and data interchange format called BSON, which provides a binary representation of JSON -like documents. Automatic sharding enables data in a collection to be distributed across multiple systems for horizontal scalability as data volumes ...