간단 MongoDB 운영 명령


1. MongoDB Windows Service 등록하는 방법


mongod.exe -f d:\mongodb\config\mongod.yaml -install



mongod.yaml file 구성


systemLog:
   destination: file
   path: "d:\\mongodb\\data\\log\\mongod.log"
   logAppend: true
storage:
   dbPath: "d:\\mongodb\\data\\db"
   journal:
      enabled: true
net:
   bindIp: 0.0.0.0
   port: 27017




2. 전체 백업

mongodump.exe --out 백업디렉토리 --db db명


3. db전체 복원

mongorestore /db:db명  백업화일위치디렉토리

+ Recent posts