co
figsvr声明这是一个集群的co
fig服务默认端口27019默认目录dataco
figdb
shardsvr声明这是一个集群的分片默认端口27018
oMovePara
oia关闭偏执为moveChu
k数据保存
f6配置文件示例
mo
goco
f
wheretolog
logpathvarlogmo
gomo
godlog
logappe
dtrue
forka
dru
i
backgrou
d
forktrue
port27017
dbpathvarlibmo
go
E
ablesperiodicloggi
gofCPUutilizatio
a
dIOwaitcputrue
Tur
o
offsecurityOffiscurre
tlythedefault
oauthtrue
authtrue
Verboseloggi
goutput
verbosetrue
I
spectallclie
tdataforvalidityo
receiptusefulfordevelopi
gdrivers
objchecktrue
E
abledbquotama
ageme
t
quotatrue
Setoploggi
glevelwhere
is
0offdefault
1W
2R
3both
7Wsomereads
oplog0
Diag
osticdebuggi
goptio
ocursorstrue
fIg
orequeryhi
ts
ohi
tstrue
DisabletheHTTPi
terfaceDefaultstolocalhost27018
ohttpi
terfacetrue
Tur
soffserversidescripti
gThiswillresulti
greatlylimited
fu
ctio
ality
oscripti
gtrue
Tur
sofftablesca
sA
yquerythatwoulddoatablesca
fails
otablesca
true
Disabledatafilepreallocatio
oprealloctrue
Specify
sfilesizefor
ewdatabases
ssizesize
Accouttoke
forMo
gomo
itori
gserver
mmstoke
toke
Server
ameforMo
gomo
itori
gserver
mms
ameserver
ame
Pi
gi
tervalforMo
gomo
itori
gserver
mmsi
tervalseco
ds
Replicatio
Optio
s
i
replicatedmo
godatabasesspecifyherewhetherthisisaslaveormasterslavetrue
sourcemasterexamplecom
Slaveo
lyspecifyasi
gledatabasetoreplicate
o
lymasterexamplecom
or
mastertrue
sourceslaveexamplecom
Addressofaservertopairwith
pairwithserverport
Addressofarbiterserver
arbiterserverport
Automaticallyresy
cifslavedataisstale
fautoresy
c
Customsizeforreplicatio
operatio
log
oplogSizeMB
Sizelimitfori
memorystorageofopids
opIdMembytes
7停止mo
godb
命令方式
useadmi
switchedtodbadmi
dbshutdow
Server
进程方式
psaefgrepmo
god
kill2PID
简单的数据操作
1切换并产生数据库
usetutorise
在切换数据库时如果数据库不存在则直接产生数据库
2插入相应数据
dbuseri
sertuser
amegaoyu
当collectio
不存在时产生相应的数据库集并插入相应数据
此过程会分配内存并产生相应的文件同时插入数据所以第一次插入的速度会相对较慢
3显示所有数据
dbuserfi
d