1. The configuration file mongodb is missing when being installed. Create the mongod. conf file in the etc directory as follows # mongo. conf # logging. logappendtrue # forkandruninbackgroundforktrue # port27017dbpathdatadb # Enablesperiodic
1. when installing mongodb, the configuration file is missing. Create mongod In The/etc directory. the conf configuration file is as follows # mongo. conf # where to lo
engine Mongod--storageengine inMemory--dbpath When selecting the In-memory storage engine, you need to specify two parameters:
Set the Mongod parameter: --storageengine , set the value of the parameter is inMemory;
Set the Mongod parameter: --dbpath , set the
├──mongoexport├──mongofiles├──mong Oimport├──mongooplog├──mongoperf├──mongorestore├──mongos├──mongostat└──mongotop0 directories, filesThe previous version of MongoDB's bin had only 12 binaries, and some binary files were also different from the present one.————————————————————————————————————————————If you need to start MongoDB automatically every time the server is powered on, you need to set some environment variablesAdding a MongoDB boot project to rc.local ensures that MongoDB starts when th
). [[email protected] ~]# MONGO
MongoDB shell version:3.0.3
connecting To:test
Server has startup warnings:
2015-06-15t20:27:49.892+0800 I CONTROL [initandlisten] * * Warning:you is running this process as the root user, which is not recommended.
2015-06-15t20:27:49.892+0800 I CONTROL [Initandlisten]This problem occurs when viewing the file permissions on MongoDB, mainly/opt/data/db//var/run/mongodb//var/log/ The permissions of the Mongodb.log are run as root when the initialization is initi
: use three configuration servers to ensure metadata integrity (two-phase commit ).
Route: Works with LVS to achieve load balancing and improve access performance ).
Below we configure a Replica Sets + Sharding test environment.
We recommend that you use IP Addresses During configuration to avoid errors.
(1) first, create all the database directories.
$ sudo mkdir -p /var/mongodb/10001$ sudo mkdir -p /var/mongodb/10002$ sudo mkdir -p /var/mongodb/10003$ sudo mkdir -p /var/mongodb/10011$ sudo
as shown in the figure belowBecause there are not enough machines, they are now deployed on the same machine, divided by different ports:
"Machine" a
"Machine" two
"Machine" three
MONGOs
20000
20001
20002
Config
30000
30001
30002
Shard
40000,40001 (Dungeon), 40002 (Arbitration)
41000,41001 (Dungeon), 42002 (Arbitration)
42000,42001 (Dungeon), 42002 (Arbitration)
1) Start the configuration
MongoDB Common CommandsFrom KiinlamInstallationMongoDB official website Download installation (Windows installation method)Basic knowledgeCollections-Tables in the corresponding relational databaseDocuments--correspond to rows in a relational databaseStart the database serviceAfter locating in the Bin folder in the installation directory> mongod --dbpath ../data/dbIf you don't have data/db a folder, you nee
# Pidfile:/export/mongodb/etc/mongodb.pid Source/etc/rc.d/init.d/functions # things from mongod.conf get there by Mongod reading it If [$ (id-u)! = "0"]; Thenecho "Permission denied! Use the ROOT to run again! "Exit 1Fi test-d/export/mongodb | | (Mkdir-p/export/mongodb; Chown mongod:mongod/export/mongodb) # note:if You the change any OPTIONS here and you get the "What do pay for:# This script assumes all options is in the config file.Configfile= "/exp
: #ffffff;-webkit-text-size-adjust:auto; -webkit-text-stroke-width:0px; " >/data/db/1.dbpath=/var/lib/mongodbDiaglog: Create a very detailed troubleshooting and diagnostic logging for various errors. Default 0. Set to 1 to generate a diaglog. log file at the beginning of the DBPath directory, his values are as follows:1.Value Setting2.0 off.No logging. #关闭. No records.3.1 Log write operations. #写操作4.2 Log r
Setting 2.0 off. No logging. #关闭. No records. 3.1 Log Write operations. #写操作 4.2 log Read operations. # Read operation 5.3 log both read and write operations. #读写操作 6.7 Log Write and some read op Erations. #写和一些读操作 setting is not equal to 0, the log will flush once every minute: Mon June 11:16:17.504 [Datafilesync] Flushing diag log Mon June 10 11:17:17.442 [Datafilesync] Flushing diag log The resulting logs can be viewed with Mongosniff: If mongosniff[is similar to Tcpdump's specific
/etc/mongod.conf
# mongod.conf
# for documentation of the all options, and:
# http://docs.mongodb.org/manual/reference/ configuration-options/
# Where to write logging data.
Systemlog:
destination:file
logappend:true
path:/data/mongodb/log/mongod.log
# Where and how to Store data.
Storage:
dbpath:/data/mongodb/db
Journal:
enabled:true
# Engine:
# MMAPV1:
# Wiredtiger:
# How the process runs
processmanagement:
fork:true # fork
, and a Chunk is located on one of the Shard servers.
Next, build a Cluster, which consists of four servers, including two Shard, three Config, and one Route
Each Shard is composed of a Replica Set, and each Replica Set is composed of two Mongod nodes and one vote node.
The configuration process is as follows:
1. The four servers start the corresponding Mongod process respectively:
192.168.95.216/Usr/local/
official website http://www.mongodb.org1, download Mongodb-win32-i386-latest.zip decompressionMongoDB 3.1.5 requires win7 to download and install memory patches HTTPS://SUPPORT.MICROSOFT.COM/ZH-CN/HOTFIX/KBHOTFIX?KBNUM=2731284AMP;KBLN=ZH-CN2, extract to the I:\MONGODB directory directory structure as follows I:\mongodb\bin i:\mongodb\data This directory if it does not exist to establish3. Command Console Mongod.exe--version View the version number of the service programTemporarily start the
-color: #ffffff;-webkit-text-size-adjust:auto; -webkit-text-stroke-width:0px; " >/data/db/1.dbpath=/var/lib/mongodbDiaglog: Create a very detailed troubleshooting and diagnostic logging for various errors. Default 0. Set to 1 to generate a diaglog. log file at the beginning of the DBPath directory, his values are as follows:1.Value Setting2.0 off.No logging. #关闭. No records.3.1 Log write operations. #写操作 4.
Tags: var sub process hup serve PPI MongoDB file removing aboutMongoDB 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. It is widely used for its advantages such as high performance, easy to deploy, easy to use and easy to store data. Its installation configuration is fairly simple, like the lightweight MySQL, but features tittle. This article mainly describes the start and
failure of the hostConfig Server:The Mongod instance, which stores the entire clustermetadata, including chunk information.Query Routers:Front-end routing, which the client accesses, and makes the entire cluster look like a single database, the front-end application can be used transparently.Shard InstanceThe Shard structure port is distributed as follows:Shard Server 1:27,020Shard Server 2:27,021Shard Server 3:27,022Shard Server 4:27,023Config serve
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.