Linux to increase the expansion module, first download the source package from the Http://pecl.php.net/package/mongo, where the download is mongo-1.2.12.tgz, then perform the installation steps
Tar zxvf mongo-1.2.12.tgzCD mongo-1.2.12
Prepare the
Master-slave replication can be used to do database backup, failure recovery, read and write separation.
This experiment uses MONGODB 3.2 version, we first look at Mongod's help
[Root@localhost mongodb]# Mongod--help .....
Omit
master/slave
Installation 1. Linux Installation MongoDB1.1 Creating Data directories and log files:
Mkdir-p/data/node/
Touch/data/mongodb.log
1.2 Installation MongoDB:
Tar zxf mongodb-linux-x86_64-2.4.9.tgz
mv
Objective
After watching the node.js actual combat, which in the data storage part of the Redis, Mongodb, I also wrote the book according to the introduction of a few simple demo, in the demo process first encountered the problem is the type of
Note: The MongoDB used by the author is version 2.4.7.Word Count Example:
To insert data for a word count:
Copy Code code as follows:
Db.data.insert ({sentence: ' Consider the following map-reduce operations on a collection orders
The following is a design example to compare the two: Suppose we are maintaining a cell phone product library, in addition to include the name of the phone, brand and other basic information, but also includes standby time, design parameters such as
The indexes in MongoDB are similar to relational databases, all in order to improve the efficiency of query and sorting, and the principle of implementation is basically consistent. Because the key (field) in the collection can be a normal data type,
MongoDb Replica set solves the problem of fault tolerance and single point of failure, but the storage and withstanding capacity of a single machine is limited, and sharding is generated for mass storage and dynamic expansion. This has the replica
When you use MongoDB, you may encounter problems that cause clients to not connect because the number of mongod connections is full. The maximum number of Mongod connections is specified by Net.maxincomingconnections, with a default value of 1000000,
Reprinted from http://www.cnblogs.com/hoojo/archive/2011/06/01/2066426.html One, preparatory work1. Download MongoDB: Http://www.mongodb.org/downloadsChoose the right version for youRelated documents: Http://www.mongodb.org/display/DOCS/Tutorial2.
First, installation and operation1. Download:Official: Https://www.mongodb.com/download-center?jmp=docs&_ga=1.61677796.930985429.1478502988#community2. InstallationDownload the 32-bit or 64-bit. msi file based on your system, double-click the file
1. Download the installation packagewget http://fastdl.mongodb.org/linux/mongodb-linux-i686-1.8.2.tgzUnzip the package after download is completeTar zxf mongodb-linux-i686-1.8.2.tgz2. Install ready to move MongoDB to the/usr/local/server/mongdb
Version: mongodb3.4; Index :If MongoDB cannot sort using an index, the data is placed in memory for sorting, and when memory usage exceeds 32MB, an error is made.When you create an index, you should ensure that the index is selected to avoid
MongoDB replica Set Maintenance main work:1. View replica set status (cluster status, synchronization delay, single library run status Mongostate)2, delete nodes, stop node shutdownMongoDB replica set cluster synchronization mechanism
The
MongoDB provides backup and restore capabilities, Mongodump.exe and Mongorestore.exe files in the MongoDB download directory, respectively.1. Back up your data using the following command:>mongodump-h dbhost-d Dbname-o dbdirectory-H:MONGDB the
Because the server uses the source provided by Alibaba Cloud, the MongoDB version installed is too low (it seems to be MongoDB 2.0.4). MongoDB 3.0 has been out for a while. The following describes how to upgrade MongoDB from
After use admin. When you add the user db. addUser ("admin", "123456"), because other nodes do not have the admin user and use the-keyFile parameter, permission authentication is required. The first time a user cannot be created.Symptoms: The code
Replica set multi-server master/slave, add and delete nodes, which are common. The following describes how to add or delete a node in detail.1. Use rs. reconfig to add and delete nodes1. Add nodes The code is as follows:Copy code Repmore:
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.