Today we have to install the MongoDB bar, this is a database, in order to lazy, this article on the use of Yum installation, after all, yum convenient, rely on the package will be installed, unless it is a separate entire DB server to compile the
First step, install MongoDB to each server
Prepare more than 3 MongoDB servers and do the following on each platform
1, download MongoDB, extract and move to/usr/local/mongodb directory(if wget is not installed, please yum install wget or apt-get
First enable the MongoDB HttpinterfaceModify Mongodb.confComment this row
The code is as follows
Copy Code
#nohttpinterface = True
Httpinterface Port is MongoDB Port +1000If the default port for MongoDB is 27018
MongoDB Windows Installation Services
MongoDB, as a database based on distributed file storage, has been in hot pursuit for nearly two years. Flexible access to data and efficient processing make it widely used in Internet applications.
Recently I
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
Create a directory as follows
Extract the MongoDB compressed package into the MongoDB directory
Mongodata Create the Data directory to store the information; Create the log directory to store the directory
CMD input command:
Why do you want to slice1. Reduce the number of single machine requests, reduce the single load, improve the total load2. Reduce the storage space of single machine, improve the total memory space.
Common MongoDB sharding Server architecture
MongoDB is a database based on distributed file storage. Written by the C + + language. Designed to provide scalable, high-performance data storage solutions for WEB applications.
MongoDB is a product between relational database and non relational
Java operation of the MySQL database code we already know, delete and change, Java to MongoDB database is similar operation, first database connection, and then operation.
First we enter into the admin database, and then set up their own database
MongoDB is a database based on distributed file storage. Written by the C + + language. Designed to provide scalable, high-performance data storage solutions for Web applications.MongoDB is a product between relational database and non relational
Using the MongoDB database, you need to add user rights to each database, check the following code:
Copy Code code as follows:
Use Test2
Db.adduser ({User: "Test")
PWD: "Admin",
roles: ["ReadWrite", "Dbadmin"]
} )
Version One:
Field
Example Value
Explanation
Host
te.rzw.com:27018
The port that the running instance listens to
Version
1.8.3
Version used by the current instance
Process
Download path: Http://downloads.mongodb.org/win32/mongodb-win32-i386-1.7.0.zip
Put a DB folder I was put to D disk, path: Ddb
Extract Mongodb-win32-i386-1.7.0.zip rename it to MongoDB put it in D disk
Open cmd input: d:mongodbbinmongod.exe–dbpath=
MongoDB does not require a password after the default installation. At this point you show DBS will see that there is only one local database, the so-called admin does not exist. MongoDB has no root, only the user who can manage the user
MongoDB Data BackupIn MongoDB we use the Mongodump command to back up MongoDB data. The command can export all data to the specified directory.The Mongodump command allows you to specify the server to which the exported data can be dumped by
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
1. First to the official website (http://www.mongodb.org/downloads) Download the appropriate installation package, the current version is 2.6Installation package has zip and MSI format, it is recommended to download the ZIP format, the MSI is
"Note: MongoDB automatically sets the _id field as the primary key"--------------------------------------------------------------------------------------------------------------- -----------------------------------------------------------------------
Today, in a demo environment, our products experienced the entire engine room power outage, there is a MongoDB binary file corruption, the following is a breakdown of the analysis of the recording process:1. In the customer support colleagues found
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service