protected] ~] #mongo Admin >show DBS; >db.test.find (); >exit **********************************************MongoDB's parameter description:--dbpath database path (data file)--logpath log file path--master designated as the main machine--slave specified as Slave machine--source Specify the IP address of the host machine--POLOGSIZE specifies that the log file size does not exceed 64M. Because Resync is very large and time-consuming, It is best to avo
/mongodb/mongodb3.2.4/bin/mongod--dbpath=/usr/local/mongodb/mongodb3.2.4/bin/data/test/db-- Logpath=/usr/local/mongodb/mongodb3.2.4/bin/data/test/logs/mongodb.log--forkIf the following error is reported:Error:child process failed, exited with error number 1It is possible that the path inconsistency problem is configured in mongodb.conf;If the following error is reported:Error:child process failed, exited wi
then request the active node for the most recent copy of the document affected by these operations. The node that is performing the resynchronization is considered a recovery and cannot be a candidate for the active node until this process is completed.Operation Command Line initialization operationSetting a replica set is a little more complicated than setting up a master-slave cluster. The first name of the replica set is to make it easy to differentiate it from other replica sets, and also t
to start MongoDB under the bin under the MongoDB installation directory,
./mongod--dbpath=/data/mongodb_data/--logpath=/data/mongodb_log/mongodb.log--logappend
After you wait for the startup to succeed, you can see if the boot was successful, the default port number is 27017, and you can also specify an unused port at startup.Start by looking at the port number to see if MongoDB is started.
mongos mongosniff mongost At
The Mongod under the bin is the service-side process of MongoDB, MONGO is its client, and other commands are used for MongoDB for other purposes such as MongoDB file export.4. Start MongoDB.To set up a good MongoDB storage data files and log files directory, here is established under/data:
[Root@localhost etc]# cd/data/
[Root@localhost data]# ls
Mongodb_data Mongodb_log
Use
install mongo-10gen
3. Check
[root@vm ~]# /etc/init.d/mongodUsage: /etc/init.d/mongod {start|stop|status|restart|reload|force-reload|condrestart}[root@vm ~]# /etc/init.d/mongod statusmongod (pid 1341) is running...[root@vm ~]#
It indicates that the server is already running.
4. server configuration:/etc/mongod. conf
[Root @ VM ~] # Cat/etc/
like a normal mongod.
Configuring the server does not require much space and resources (200MB of actual data is approximately 1KB of configuration space)
[root@pc dbs]# mongod--dbpath=/dbs/config--logpath=/logs/config.log--fork--port 1000
About-to-fork child process, waiting until server was ready for connections.
Forked process:5055
Child process started succes
. If the journal is not turned on, the repair operation must be performed after the exception is restarted after the shutdown.remark:The MongoDB default database folder path is c:/data/db (note: Although it is the default, you need to create it yourself). However, you can also set the default path yourself, such as d:/test/data/db. You must create a storage folder for the database files before you start the MongoDB service, or you cannot start successfully. When using the system default folder p
you from manual sharding management.You need to use parts in the following situations:1. The server disk is not enough.2. A single Mongod cannot meet the performance requirements of Data Writing.3. Put big data into the memory to improve performance.For the partition structure we want to implement:We can see that the original Mongod node is divided into two parts: A and B. Route D reads and configures the
).
-- Autoresync: If the slave node is not synchronized with the master node, the slave node is automatically synchronized again.
-- Oplogsize: The oplog size of the master node (unit: MB ).
Note: The operation records of the master node are called oplog. Oplog is stored in a special database called local. Oplog only records operations that change the database status. For example, query operations are not stored.
3. Command 1. Set the SQL code of the master node (IP: 10.0.0.1)
Hww @ Ubuntu :
Tags: value shu cal replication cluster replica set path common copy version1 MongoDB Several startup methods start the MongoDB service there are two ways, the foreground start or daemon mode start, the former will need to keep the current session cannot be closed, the latter can be used as the system fork Process execution, The path below is the actual address of the MONGODB deployment.1. The simplest way to start, the foreground start, only specify the data directory, and use the default 27107
\Configure Environment Variables
To facilitate MongoDB command operations, we also configure its environment variables. The operation is also very simple. Take Windows 7 as an example, computer-> right-click menu "properties" to open the "System Properties window"-> "Advanced System settings"-> "advanced" tab-> environment variables, add "D: \ mongodb \ bin" at the end of the path value of the system variable, save the variable, and re-open a command prompt window without entering D: the \ mong
Variables
To facilitate MongoDB command operations, we also configure its environment variables. The operation is also very simple. Take Windows 7 as an example, computer-> right-click menu "properties" to open the "System Properties window"-> "Advanced System settings"-> "advanced" tab-> environment variables, add "D: \ mongodb \ bin" at the end of the path value of the system variable, save the variable, and re-open a command prompt window without entering D: the \ mongodb \ bin directory all
Every time you start MongoDB will always receive the following unclean shutdown prompts, summed up the cause of the problem and the solution.
The prompts are as follows:
Copy Code code as follows:
**************
D:\greent~1\powercmd>mongod--auth-dbpath C:\mongo\MongoDB\mongo\data
Wed May 16 16:06:50
Wed 16:06:50 warning:32-bit servers don ' t have journaling enabled by default. Please use t
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 database, and is the most powerful and relational database in the relational database.
mongodb Download Address:http://www.mongodb.org/downloads
1. Installation MongoDB
Download MongoDB from MongoDB, I downloaded the 64-bit version of 3.2.6. Afte
Original works, allow reprint, please be sure to use hyperlinks in the form of the original source of the article, author information and this statement. Otherwise, the legal liability will be investigated. http://elain.blog.51cto.com/3339379/760266
Master-Slave synchronization:MD01 10.0.0.11 MasterMD02 10.0.0.12 SlaveMD03 10.0.0.14 Slave#建立数据库目录
Mkdir-p/elain/apps/mongodb/mkdir-p/elain/data/mongodb/db/mkdir-p/elain/logs/mongodb/
Note:1, do not need to copy the complete data like MySQL in the pa
Label: One, download 1. Official website: http://www.mongodb.org/; the address for the download installer is: http://www.mongodb.org/downloads, select the Windows 32-bit 2.4.0 version. 2. Download the MongoDB for. NET Driver Development Kit, the official c#driver is located under the driver menu at address: https://github.com/mongodb/mongo-csharp-driver/downloads. It is also known that there is a Samus drive: Https://github.com/samus/mongodb-csharp Two, installation 1. Extract the Mongodb-win32-
configuration of the cluster(This test is placed on the same machine for configuration, so the IP address, if it is on a different server to replace the IP can be)
1, directory structure copy two MongoDB to/home/scotte.ye/mongo1 and/home/scotte.ye/mongo2
2, open MongoDB
Main: #cd/home/scotte.ye/mongo1/bin #./mongod--master-port=10111-dbpath=/home/data/10111-nohttpinterface This allows the master server to
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.