Windows Server 2008 R2 SP1 설치 MongoDB
2. d: \ \ 로 압축 을 풀 고 mongodb 로 이름 을 바 꿉 니 다. 경 로 는 d: \ mongodb 3 이 고 데이터베이스 가 있 는 디 렉 터 리 를 설정 하여 디 렉 터 리 를 만 듭 니 다. \ \ data \ db 4, MongoDB 서 비 스 를 시작 합 니 다. 먼저 - help 를 통 해 도움말 을 볼 수 있 습 니 다.
- C:\>d:\mongodb\bin\mongod.exe --help
- Allowed options:
-
- General options:
- -h [ --help ] show this usage information
- --version show version information
- -f [ --config ] arg configuration file specifying additional options
- -v [ --verbose ] be more verbose (include multiple times for more
- verbosity e.g. -vvvvv)
- --quiet quieter output
- --port arg specify port number - 27017 by default
- --bind_ip arg comma separated list of ip addresses to listen on
- - all local ips by default
- --maxConns arg max number of simultaneous connections - 20000 by
- default
- --objcheck inspect client data for validity on receipt
- --logpath arg log file to send write to instead of stdout - has
- to be a file, not directory
- --logappend append to logpath instead of over-writing
- --pidfilepath arg full path to pidfile (if not set, no pidfile is
- created)
- --keyFile arg private key for cluster authentication
- --auth run with security
- --cpu periodically show cpu and iowait utilization
- --dbpath arg directory for datafiles - defaults to \data\db\
- --diaglog arg 0=off 1=W 2=R 3=both 7=W+some reads
- --directoryperdb each database will be stored in a separate
- directory
- --ipv6 enable IPv6 support (disabled by default)
- --journal enable journaling
- --journalCommitInterval arg how often to group/batch commit (ms)
- --journalOptions arg journal diagnostic options
- --jsonp allow JSONP access via http (has security
- implications)
- --noauth run without security
- --nohttpinterface disable http interface
- --nojournal disable journaling (journaling is on by default
- for 64 bit)
- --noprealloc disable data file preallocation - will often hurt
- performance
- --noscripting disable scripting engine
- --notablescan do not allow table scans
- --nssize arg (=16) .ns file size (in MB) for new databases
- --profile arg 0=off 1=slow, 2=all
- --quota limits each database to a certain number of files
- (8 default)
- --quotaFiles arg number of files allowed per db, requires --quota
- --repair run repair on all dbs
- --repairpath arg root directory for repair files - defaults to
- dbpath
- --rest turn on simple rest api
- --slowms arg (=100) value of slow for profile and console log
- --smallfiles use a smaller default file size
- --syncdelay arg (=60) seconds between disk syncs (0=never, but not
- recommended)
- --sysinfo print some diagnostic system information
- --upgrade upgrade db if needed
-
- Windows Service Control Manager options:
- --install install Windows service
- --remove remove Windows service
- --reinstall reinstall Windows service (equivalent to --remove
- followed by --install)
- --serviceName arg Windows service name
- --serviceDisplayName arg Windows service display name
- --serviceDescription arg Windows service description
- --serviceUser arg account for service execution
- --servicePassword arg password used to authenticate serviceUser
-
- Replication options:
- --oplogSize arg size to use (in MB) for replication op log. default is
- 5% of disk space (i.e. large is good)
-
- Master/slave options:
- --master master mode
- --slave slave mode
- --source arg when slave: specify master as <server:port>
- --only arg when slave: specify a single database to replicate
- --slavedelay arg specify delay (in seconds) to be used when applying
- master ops to slave
- --autoresync automatically resync if slave data is stale
-
- Replica set options:
- --replSet arg arg is <setname>[/<optionalseedhostlist>]
- --replIndexPrefetch arg specify index prefetching if secondary)
- [none|_id_only|all]
-
- Sharding options:
- --configsvr declare this is a config db of a cluster; default port
- 27019; default dir /data/configdb
- --shardsvr declare this is a shard db of a cluster; default port
- 27018
- --noMoveParanoia turn off paranoid saving of data for moveChunk. this
- is on by default for now, but default will switch
자세 한 내용 을 도 와 드 리 겠 습 니 다.
- C:\ >d:\mongodb\bin\mongod.exe --dbpath=d:\data\db
- Sun Dec 30 20:22:19 [initandlisten] MongoDB starting : pid=2512 port=27017 ddbpath=d:\data\db 64-bit host=WIN-6HB65GUTBNC
-
- Sun Dec 30 20:22:19 [initandlisten] db version v2.2.2, pdfile version 4.5
- Sun Dec 30 20:22:19 [initandlisten] git version: d1b43b61a5308c4ad0679d34b262c5af9d664267
- Sun Dec 30 20:22:19 [initandlisten] build info: windows sys.getwindowsversion(major=6, minor=1, build=7601, platform=2,
- service_pack='Service Pack 1') BOOST_LIB_VERSION=1_49
- Sun Dec 30 20:22:19 [initandlisten] options: { dbpath: "d:\data\db" }
- Sun Dec 30 20:22:19 [initandlisten] journal ddir=d:/data/db/journal
- Sun Dec 30 20:22:19 [initandlisten] recover : no journal files present, no recovery needed
- Sun Dec 30 20:22:19 [initandlisten] preallocating a journal file d:/data/db/journal/prealloc.1
- Sun Dec 30 20:22:29 [initandlisten] preallocating a journal file d:/data/db/journal/prealloc.2
- Sun Dec 30 20:22:39 [initandlisten] waiting for connections on port 27017
- Sun Dec 30 20:22:39 [websvr] admin web console waiting for connections on port 28017
출력 내용 을 통 해 MongoDB 의 프로 세 스 번호, 감청 포트 번호, 버 전 번호, 웹 액세스 포트 등 정 보 를 볼 수 있 습 니 다. 5. 브 라 우 저 를 통 해 현재 상태 통계 정 보 를 볼 수 있 습 니 다. 예 를 들 어:http://127.0.0.1:28017/
6 、 MongoDB 서비스 정지, Ctrl - C
- C:\Users\Administrator>d:\mongodb\bin\mongod.exe --dbpath=d:\data\db
- Sun Dec 30 20:22:19 [initandlisten] MongoDB starting : pid=2512 port=27017 ddbpath=d:\data\db 64-bit host=WIN-6HB65GUTBNC
-
- Sun Dec 30 20:22:19 [initandlisten] db version v2.2.2, pdfile version 4.5
- Sun Dec 30 20:22:19 [initandlisten] git version: d1b43b61a5308c4ad0679d34b262c5af9d664267
- Sun Dec 30 20:22:19 [initandlisten] build info: windows sys.getwindowsversion(major=6, minor=1, build=7601, platform=2,
- service_pack='Service Pack 1') BOOST_LIB_VERSION=1_49
- Sun Dec 30 20:22:19 [initandlisten] options: { dbpath: "d:\data\db" }
- Sun Dec 30 20:22:19 [initandlisten] journal ddir=d:/data/db/journal
- Sun Dec 30 20:22:19 [initandlisten] recover : no journal files present, no recovery needed
- Sun Dec 30 20:22:19 [initandlisten] preallocating a journal file d:/data/db/journal/prealloc.1
- Sun Dec 30 20:22:29 [initandlisten] preallocating a journal file d:/data/db/journal/prealloc.2
- Sun Dec 30 20:22:39 [initandlisten] waiting for connections on port 27017
- Sun Dec 30 20:22:39 [websvr] admin web console waiting for connections on port 28017
- Sun Dec 30 20:32:19 Ctrl-C signal
- Sun Dec 30 20:32:19 [consoleTerminate] got CTRL_C_EVENT, will terminate after current cmd ends
- Sun Dec 30 20:32:19 [consoleTerminate] now exiting
- Sun Dec 30 20:32:19 dbexit:
- Sun Dec 30 20:32:19 [consoleTerminate] shutdown: going to close listening sockets...
- Sun Dec 30 20:32:19 [consoleTerminate] closing listening socket: 368
- Sun Dec 30 20:32:19 [consoleTerminate] closing listening socket: 376
- Sun Dec 30 20:32:19 [consoleTerminate] shutdown: going to flush diaglog...
- Sun Dec 30 20:32:19 [consoleTerminate] shutdown: going to close sockets...
- Sun Dec 30 20:32:19 [consoleTerminate] shutdown: waiting for fs preallocator...
- Sun Dec 30 20:32:19 [consoleTerminate] shutdown: lock for final commit...
- Sun Dec 30 20:32:19 [consoleTerminate] shutdown: final commit...
- Sun Dec 30 20:32:19 [consoleTerminate] shutdown: closing all files...
- Sun Dec 30 20:32:19 [consoleTerminate] closeAllFiles() finished
- Sun Dec 30 20:32:19 [consoleTerminate] journalCleanup...
- Sun Dec 30 20:32:19 [consoleTerminate] removeJournalFiles
- Sun Dec 30 20:32:19 [consoleTerminate] shutdown: removing fs lock...
- Sun Dec 30 20:32:19 dbexit: really exiting now
-
7. MongoDB 를 Windows 서비스 에 추가 하여 파일 D: \ mongodb \ \ logs \ \ mongodb. log 를 만 들 고 다음 명령 을 수행 합 니 다. d: \ mongodb \ \ bin \ mongodb. exe -- dbpath = d: \ \ data \ db -- logpath = d: \ mongodb \ logs \ \ mongodb. log – install
- C:\ >d:\mongodb\bin\mongod.exe --dbpath=d:\data\db --logpath=d:\mongodb\logs\mongodb.log --install
- all output going to: d:\mongodb\logs\mongodb.log
- log file [d:\mongodb\logs\mongodb.log] exists; copied to temporary file [d:\mongodb\logs\mongodb.log.2012-12-30T12-30-11]
이 때 net start "Mongo DB" 를 통 해 서 비 스 를 시작 할 수 있 습 니 다. C: \ > net start "Mongo DB"
Mongo DB 서비스 가 시작 되 었 습 니 다.
net stop "Mongo DB" 를 통 해 서 비 스 를 닫 습 니 다. C: \ > net stop "Mongo DB" 에서 시스템 오류 109 가 발생 했 습 니 다.
파이프 가 끝 났 습 니 다.닫 을 때 오류 알림 이 있 을 수 있 습 니 다. bug 일 것 입 니 다. 무시 할 수 있 습 니 다. 영향 을 주지 않 지만 항상 기분 이 좋 지 않 습 니 다. MongoDB 팀 이 이 작은 bug 를 빨리 해결 하 기 를 바 랍 니 다.8. MongoDB 를 방문 하여 D: \ mongodb \ bin \ mongo. exe 를 더 블 클릭 하거나 cmd 명령 프롬프트 에 'D: \ mongodb \ bin \ mongo. exe' 를 입력 하면 접근 할 수 있 습 니 다.
- C:\>d:\mongodb\bin\mongo.exe --help
- MongoDB shell version: 2.2.2
- usage: d:\mongodb\bin\mongo.exe [options] [db address] [file names (ending in .js)]
- db address can be:
- foo foo database on local machine
- 192.169.0.5/foo foo database on 192.168.0.5 machine
- 192.169.0.5:9999/foo foo database on 192.168.0.5 machine on port 9999
- options:
- --shell run the shell after executing files
- --nodb don't connect to mongod on startup - no 'db address'
- arg expected
- --norc will not run the ".mongorc.js" file on start up
- --quiet be less chatty
- --port arg port to connect to
- --host arg server to connect to
- --eval arg evaluate javascript
- -u [ --username ] arg username for authentication
- -p [ --password ] arg password for authentication
- -h [ --help ] show this usage information
- --version show version information
- --verbose increase verbosity
- --ipv6 enable IPv6 support (disabled by default)
-
- file names: a list of files to run. files have to end in .js and will exit after unless --shell is specified
다음은 서비스 로 시 작 될 때의 로그 내용 입 니 다.
- Sun Dec 30 21:05:49 Trying to start Windows service 'MongoDB'
- Sun Dec 30 21:05:49 Service running
- Sun Dec 30 21:05:49 [initandlisten] MongoDB starting : pid=3884 port=27017 ddbpath=d:\data\db 64-bit host=WIN-6HB65GUTBNC
- Sun Dec 30 21:05:49 [initandlisten] db version v2.2.2, pdfile version 4.5
- Sun Dec 30 21:05:49 [initandlisten] git version: d1b43b61a5308c4ad0679d34b262c5af9d664267
- Sun Dec 30 21:05:49 [initandlisten] build info: windows sys.getwindowsversion(major=6, minor=1, build=7601, platform=2, service_pack='Service Pack 1') BOOST_LIB_VERSION=1_49
- Sun Dec 30 21:05:49 [initandlisten] options: { dbpath: "d:\data\db", logpath: "d:\mongodb\logs\mongodb.log", service: true }
- Sun Dec 30 21:05:50 [initandlisten] journal ddir=d:/data/db/journal
- Sun Dec 30 21:05:50 [initandlisten] recover : no journal files present, no recovery needed
- Sun Dec 30 21:05:50 [initandlisten] waiting for connections on port 27017
- Sun Dec 30 21:05:50 [websvr] admin web console waiting for connections on port 28017
- Sun Dec 30 21:10:06 [initandlisten] connection accepted from 127.0.0.1:16061 #5 (1 connection now open)
- Sun Dec 30 21:11:34 [initandlisten] connection accepted from 124.193.159.8:27974 #6 (2 connections now open)
- Sun Dec 30 21:12:52 [serviceShutdown] got SERVICE_CONTROL_STOP request from Windows Service Control Manager, will terminate after current cmd ends
- Sun Dec 30 21:12:52 [serviceShutdown] now exiting
- Sun Dec 30 21:12:52 dbexit:
- Sun Dec 30 21:12:52 [serviceShutdown] shutdown: going to close listening sockets...
- Sun Dec 30 21:12:52 [serviceShutdown] closing listening socket: 412
- Sun Dec 30 21:12:52 [serviceShutdown] closing listening socket: 420
- Sun Dec 30 21:12:52 [serviceShutdown] shutdown: going to flush diaglog...
- Sun Dec 30 21:12:52 [serviceShutdown] shutdown: going to close sockets...
- Sun Dec 30 21:12:52 [serviceShutdown] shutdown: waiting for fs preallocator...
- Sun Dec 30 21:12:52 [serviceShutdown] shutdown: lock for final commit...
- Sun Dec 30 21:12:52 [serviceShutdown] shutdown: final commit...
- Sun Dec 30 21:12:52 [serviceShutdown] shutdown: closing all files...
- Sun Dec 30 21:12:52 [serviceShutdown] closeAllFiles() finished
- Sun Dec 30 21:12:52 [serviceShutdown] journalCleanup...
- Sun Dec 30 21:12:52 [conn6] end connection 124.193.159.8:27974 (1 connection now open)
- Sun Dec 30 21:12:52 [conn5] end connection 127.0.0.1:16061 (1 connection now open)
- Sun Dec 30 21:12:52 [serviceShutdown] removeJournalFiles
- Sun Dec 30 21:12:52 [serviceShutdown] shutdown: removing fs lock...
- Sun Dec 30 21:12:52 [initandlisten] now exiting
- Sun Dec 30 21:12:52 dbexit: ; exiting immediately
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
HDU 1406 정수 (매 거 + 타 표)완전무결 하 다 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 25482 ...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.