【Mongo】mongo配置檔案
大於等於3.2按這種寫法
-
[ root@ ip - 172 - 31 - 33 - 43 conf ] # more shard1 . conf
-
# where to write logging data .
-
systemLog :
-
destination : file
-
logAppend : true
-
path : /data/shard1/log/shard1 . log
-
-
# Where and how to store data .
-
storage :
-
dbPath : /data/shard1/data
-
journal :
-
enabled : true
-
wiredTiger :
-
engineConfig :
-
cacheSizeGB : 5 ##限制記憶體使用大小
-
-
# how the process runs
-
processManagement :
-
fork : true
-
pidFilePath : /data/shard1/log/shard1 . pid
-
-
# network interfaces
-
net :
-
port : 27001
-
bindIp : 172 . 31 . 33 . 43
-
-
#security :
-
# authorization : enabled
-
-
#operationProfiling :
-
replication :
-
replSetName : shard1
-
sharding :
-
clusterRole : shardsvr
security: ###開啟許可權認證
keyFile: /usr/local/mongodb/keyfile
authorization: enabled
-
-
[ root@ ip - 172 - 31 - 33 - 43 conf ] # more config . conf
-
## content
-
systemLog :
-
destination : file
-
logAppend : true
-
path : /data/config/log/config . log
-
-
# Where and how to store data .
-
storage :
-
dbPath : /data/config/data
-
journal :
-
enabled : true
-
# how the process runs
-
processManagement :
-
fork : true
-
pidFilePath : /data/config/log/configsrv . pid
-
-
# network interfaces
-
net :
-
port : 21000
-
bindIp : 172 . 31 . 33 . 43
-
-
#operationProfiling :
-
replication :
-
replSetName : config
-
-
sharding :
-
clusterRole : configsvr
-
-
[ root@ ip - 172 - 31 - 33 - 43 conf ] # more mongos . conf
-
systemLog :
-
destination : file
-
logAppend : true
-
path : /data/mongos/log/mongos . log
-
processManagement :
-
fork : true
-
-
# network interfaces
-
-
net :
-
port : 20000
-
bindIp : 172 . 31 . 33 . 43
-
#監聽的配置伺服器 , 只能有1個或者3個 configs為配置伺服器的副本集名字
-
sharding :
-
configDB : config/172 . 31 . 33 . 43 : 21000 , 172 . 31 . 45 . 127 : 21000 , 172 . 31 . 36 . 162 : 21000
小於3.2一般按這種格式
-
port
=
27017
-
dbpath
=
/
data/mongodb/data
-
logpath
=
/
data/mongodb/logs/mongodb
.
log
-
pidfilepath
=
/
data/mongodb/logs/mongodb
.
pid
-
logappend
=
true
-
auth
=
true
-
fork
=
true
-
wiredTigerCacheSizeGB
=
20
port
=
27017
dbpath
=
/
data/mongodb/data
logpath
=
/
data/mongodb/logs/mongodb
.
log
pidfilepath
=
/
data/mongodb/logs/mongodb
.
pid
logappend
=
true
auth
=
true
fork
=
true
wiredTigerCacheSizeGB = 20
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29096438/viewspace-2154557/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- mongo 叢集配置Go
- 【Mongo】mongo聚合操作Go
- 【mongo】mongo 欄位型別互轉Go型別
- mongo副本集叢集安裝配置Go
- 【Mongo】Mongo讀寫分離的實現Go
- 【Mongo】shell命令列模式執行mongo命令Go命令列模式
- mongo 索引解析Go索引
- mongo基本操作Go
- mongo GridFSBucketGo
- 安裝mongoGo
- 管理索引mongo索引Go
- 實用小指令碼——mysql/mongo 匯出到本地檔案指令碼MySqlGo
- docker操作mongo+docker的常用操作+mongo與.netDockerGo
- 【Mongo】mongo更新欄位為另一欄位的值Go
- 【Mongo】mongo分片加複製集的備份恢復Go
- 【Mongo】Mongodump 與 mongorestore對mongo進行備份恢復GoREST
- mongo-go-driverGo
- mongo的‘模糊匹配’Go
- mongo副本集搭建Go
- mac 啟動mongoMacGo
- go操作mongo CRUDGo
- Mongo效能檢查Go
- Mongo連線分析Go
- mongo centos 安裝GoCentOS
- Prometheus監控mongoPrometheusGo
- mongo資料備份Go
- Mongo的bulkWrite介紹Go
- 安裝Mongo(社群版)Go
- mongo 小知識點Go
- Mongo和Couch對比Go
- mongo基本命令(一)Go
- PostgreSQL 工具及mysql、mongoMySqlGo
- Mongo主從同步原理Go主從同步
- 【Python】pymongo連結mongoPythonGo
- spring整合mongo及呼叫SpringGo
- [Mongo]建立新使用者Go
- Mongo 資料庫 基本操作Go資料庫
- mongo記憶體筆記Go記憶體筆記