mongod 던전 집합 배치

16201 단어 mongodb
 

mongd -f /etc/mongodb.conf
# 
10.142.166.95
mongod --replSet foo --port 27017 --dbpath /data/mongodb1 --logpath /data/mongodb1/mongodb.log &
10.142.164.235
mongod --replSet foo --port 27018 --dbpath /data/mongodb2 --logpath /data/mongodb2/mongodb.log &
10.142.164.238
mongod --replSet foo --port 27019 --dbpath /data/mongodb3 --logpath /data/mongodb3/mongodb.log &

 
10.142.166.95
mongod --replSet foo --port 27017 --dbpath /data/mongodb1 --logpath /data/mongodb1/mongodb.log --auth &
10.142.164.235
mongod --replSet foo --port 27018 --dbpath /data/mongodb2 --logpath /data/mongodb2/mongodb.log --auth  &
10.142.164.238
mongod --replSet foo --port 27019 --dbpath /data/mongodb3 --logpath /data/mongodb3/mongodb.log --auth  &
db.createUser({user:"james",pwd:"james",roles:[{role:"readWrite",db:"local"}]})
db.auth('james', 'james')



일지를 보다

 tail -f /data/mongodb1/mongodb.log 
tail -f /data/mongodb2/mongodb.log
 tail -f /data/mongodb3/mongodb.log

원격 링크

 mongo 
mongo -u dba -p dba  10.142.166.95:27017/admin
mongo -u james -p james  10.142.164.235:27018/local

mongo 10.142.164.235:27018
mongo 10.142.164.238:27019
mongo 10.142.166.95:27017
mongo -u admin -p admin 10.142.166.95:27017

  182  2016-10-24_13:41:04  mongod --replSet foo --port 27019 --dbpath /data/mongodb3 --logpath /data/mongodb3/mongodb.log
  184  2016-10-24_13:50:12  ps -ef | grep mongo
  186  2016-10-24_13:48:47  tail /data/mongodb3/mongodb.log

프로파일

 
 1
systemLog:
   destination: file
   path: "/data/mongodb1/mongodb.log"
   logAppend: true
processManagement:
   fork: true
   pidFilePath: /run/mongo.pid
net:
   port: 27017
   bindIp: 0.0.0.0
#   maxIncomingConnections: 3000
#   http:
#      enabled: true
#     RESTInterfaceEnabled: true
#security:
 #  keyFile:/data/mongodb1/keyfile
#key:   9ff6ee24a568dff6b7e1cf7b4aef1aad1c20b82c39d7a6f5f3
  # authorization: enabled
storage:
   journal:
      enabled: true
   dbPath:/data/mongodb1
   directoryPerDB: true
   syncPeriodSecs: 2
   engine: wiredTiger
   wiredTiger:
      engineConfig:
         cacheSizeGB: 10
replication:
   oplogSizeMB: 51200
   replSetName: foo
########### 
/etc/mongodb.conf
dbpath=/data/james/db
logpath=/data/james/logs/mongo.log
pidfilepath=/run/mongo.pid
directoryperdb=true
logappend=true
#bind_ip=10.183.222.215
port=27017
oplogSize=51200
fork=true
#noprealloc=true
storageEngine=wiredTiger
wiredTigerCacheSizeGB=40


#왕정정은dba를 따라배워라



10.149.14.236:937510.149.14.232:937510.149.14.234:9375 


 1 
systemLog:
   destination: file
   path: "/data/slot0/bigdata_bigdataops1_mongo/logs/mongo.log"
   logAppend: true
processManagement:
   fork: true
   pidFilePath: /data/slot0/bigdata_bigdataops1_mongo/tmp/mongo.pid
net:
   port: 9375
   bindIp: 10.149.14.236
#   maxIncomingConnections: 3000
#   http:
#      enabled: true
#     RESTInterfaceEnabled: true
security:
   keyFile: /data/slot0/bigdata_bigdataops1_mongo/etc/keyfile
   authorization: enabled
storage:
   journal:
      enabled: true
   dbPath: /data/slot0/bigdata_bigdataops1_mongo/data
   directoryPerDB: true
   syncPeriodSecs: 2
   engine: wiredTiger
   wiredTiger:
      engineConfig:
         cacheSizeGB: 10
replication:
   oplogSizeMB: 51200
   replSetName: bigdataops1

# 2 
systemLog:
   destination: file
   path: "/data/slot0/bigdata_bigdataops1_mongo/logs/mongo.log"
   logAppend: true
processManagement:
   fork: true
   pidFilePath: /data/slot0/bigdata_bigdataops1_mongo/tmp/mongo.pid
net:
   port: 9375
   bindIp: 10.149.14.232
#   maxIncomingConnections: 3000
#   http:
#      enabled: true
#     RESTInterfaceEnabled: true
security:
   keyFile: /data/slot0/bigdata_bigdataops1_mongo/etc/keyfile
   authorization: enabled
storage:
   journal:
      enabled: true
   dbPath: /data/slot0/bigdata_bigdataops1_mongo/data
   directoryPerDB: true
   syncPeriodSecs: 2
   engine: wiredTiger
   wiredTiger:
      engineConfig:
         cacheSizeGB: 10
replication:
   oplogSizeMB: 51200
   replSetName: bigdataops1

좋은 웹페이지 즐겨찾기