Set up the MongoDB replica sets mode. This article is tested in version 2.0.5.
Mongo: http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.0.5.tgz
Decompress the package to the/usr/local/MongoDB/directory.
Assume that there are three servers,
Download
The easiest way to install MongoDB is to use compiled binary files.
Note: We recommend that you use the 64-bit version (although you must use a 64-bit system to run this version ).
Download 32-bit Binaries
Download 64-bit Binaries
Extract
Each MongoDB server supports multiple databases. Each database is relatively independent. For security purposes and convenience of management, the database data is also stored independently.
Mongo metadata
In the MongoDB database, the
This article by larrylgq prepared, reproduced please note the Source: http://blog.csdn.net/larrylgq/article/details/7395261
Author: Lu guiqiang
Email: larry.lv.word@gmail.com
MongoDB adds user authentication: adds users, deletes users,
If you want to talk about MongoDB, you must first talk about nosql. About nosql, two articles on the Internet are recommended: 1. http://www.iteye.com/topic/524977 by Fan Kai. This article details the background of nosql and the analysis of
Recently, When I was operating on MongoDB, I encountered a poor problem. I used "query" as a record and it was "invalid" under some conditions ".
My MongoDB database version is 1.8.3. MongoDB shell version: 2.0.3
Specific data:
{ "_id" :
MongoDB provides diverse index support. The index information is stored in system. indexes, and the index is always created for _ ID by default. Its Index usage is basically the same as that of relational databases such as MySQL. In fact, it can be
I recently learned MongoDB and saw some interesting information about map-Reduce, So I recorded it here as a learning note.
Here we will refer to the official website and another article on the role of Map-Reduce, Which is concise and concise.
1.
BSONObjBuilder Q;Q.append("Name", str);auto_ptr cursor = conn.query("test".NewsContents", Q.obj());
The preceding statement can be used for query. Then, the conditions are appended.
The following lists several common statements:
1.
BSONObj test =
Brief description: MongoDB is a distributed file storage-based database. Written in C ++. It is designed to provide scalable, high-performance data storage solutions for Web applications.
Environment: centos 5.5x64
Installation:CD/root/tools
Wget
Development Environment:
System: Windows
IDE: Eclipse and myeclipse 8
Database: MongoDB
Development dependency Library:
Javaee5, mongo-2.5.3.jar, junit-4.8.2.jar
I. Preparations
1. First, download the driver packages supported by MongoDB for
MongoDB needs to be used in the project. According to the introduction, the connection pool idea of MongoDB can be used to maintain only one instance,
Refer to Region.
Package CN. CNIC. jingshao. mongodbapp. util; import java.net.
I have been very interested in the principles and practices of distributed systems for a long time, and I have been very curious about MongoDB. I have finally had time to experiment with it!
I set up a replica sets + sharding test cluster
MongoDB is a database server: it runs on the frontend or backend and waits for the user's connection. When you start MongoDB, the following results are displayed:
~/$ ./mongod
## some logging output
#
Tue Mar 9 11:15:43 waiting for connections on
Mongodb DBObject supports saving multi-dimensional arrays. When adding elements, use the "$ push" operator and "$ pull" When deleting elements ".
However, the problem arises when updating. mongodb first supports "$" to locate an element in the array,
It is important to select an appropriate shard key for a collection. If this set is very large, it will be very difficult to modify the shard key in the future. If you have any questions, please go to the forum or IRC for help.
Sample documentView
Mongodb can be considered a document-oriented database. We are talking about structured documents, not any text documents. You can think of these documents as objects that only contain data, rather than code, methods, or classes. In addition, the
Mongodb provides an interesting "Multi-key" feature that automatically indexes the array values of objects. Tags are a good example. Suppose you have an article that contains many classification tags:
$ dbshell> db.articles.save( { name: "Warm
In the previous article, I started MongoDB development and talked about how to install MongoDB in windows. In this article, I will introduce how to install MongoDB in Linux.
First, download the MongoDB database, address:
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.