블로그 이미지
LifeisSimple

calendar

1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

Notice

2011. 3. 9. 18:11 Brain Trainning/NoSQL

출처 : www.mongodb.org

File Based Configuration

In addition to accepting Command Line Parameters, MongoDB can also be configured using a configuration file. A configuration file to use can be specified using the -f or --config command line options. On some packaged installs of MongoDB (for example Ubuntu & Debian) the default file can be found in /etc/mongodb.conf which is automatically used when starting and stopping MongoDB from the service.

The following example configuration file demonstrates the syntax to use:

# This is an example config file for MongoDB.
dbpath = /var/lib/mongodb
bind_ip = 127.0.0.1
noauth = true # use 'true' for options that don't take an argument
verbose = true # to disable, comment out.
Unfortunately flag parameters like "quiet" will register as true no matter what value you put after them. So don't write this: "quiet=false", just comment it out, or remove the line.

Parameters

Basic database configuration

ParameterMeaningExample
dbpath Location of the database files dbpath=/var/lib/mongodb
port Port the mongod will listen on port=27017
bind_ip
Specific IP address that mongod will listen on
bind_ip=127.0.0.1
logpath Full filename path to where log messages will be written logpath=/var/log/mongodb/mongodb.log
logappend Whether the log file will be appended (TRUE) or over-written (FALSE) logappend=true

Logging

ParameterMeaningExample
cpu Enable periodic logging (TRUE) of CPU utilization and I/O wait cpu = true
verbose Verbose logging output verbose=true

Security

ParameterMeaningExample
noauth Turn authorization on/off. Off is currently the default noauth = true
auth Turn authorization on/off. Off is currently the default auth=false

Administration & Monitoring

ParameterMeaningExample
nohttpinterface Disable the HTTP interface. The default port is 1000 more than the dbport nohttpinterface = true
noscripting Turns off server-side scripting. This will result in greatly limited functionality noscripting = true
notablescan Turns off table scans. Any query that would do a table scan fails. notablescan = true
noprealloc Disable data file preallocation. noprealloc = true
nssize Specify .ns file size for new databases in MB nssize = 16
mms-token Account token for Mongo monitoring server. mms-token=mytoken
mms-name Server name for Mongo monitoring server. mms-name=monitor.example.com
mms-interval Ping interval for Mongo monitoring server in seconds. mms-interval=15 
quota Enable quota management quota = true
quotaFiles Determines the number of files per Database (default is 8) quotaFiles=16

Replication

ParameterMeaningExample
master In replicated mongo databases, specify here whether this is a slave or master master = true
slave In replicated mongo databases, specify here whether this is a slave or master slave = true
source Specify the source = master.example.com
only Slave only: specify a single database to replicate only = master.example.com
pairwith Address of a server to pair with. pairwith = master.example.com:27017
arbiter Address of arbiter server arbiter = aribiter.example.com:27018
autoresync Automatically resync if slave data is stale autoresync
opIdMem Size limit for in-memory storage of op ids in Bytes opIdMem=1000
fastsync Indicate that this instance is starting from a dbpath 
snapshot of the repl peer
 
Replica Sets
ParameterMeaningExample
replSet Use replica sets with the specified logical set name.  Typically the optional seed host list need not be specified. replSet=<setname>[/<seedlist>]
oplogSize Custom size for replication operation log in MB. oplogSize=100

Sharding

ParameterMeaningExample
shardsvr Indicates that this mongod will participate in sharding *Optional and just changes the default port shardsvr=true

'Brain Trainning > NoSQL' 카테고리의 다른 글

[MongoDB] Replication Set Connection 방법  (0) 2011.03.31
[MongoDB] 트위터 Collections...  (0) 2011.03.31
[MongoDB] Java Code Sample  (0) 2011.02.28
[MongoDB] MSSQL 2 MongoDB  (0) 2011.02.25
[MongoDB] Comparing MongoDB java frameworks  (0) 2011.02.23
posted by LifeisSimple