linux 启动mongodb
生活随笔
收集整理的這篇文章主要介紹了
linux 启动mongodb
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
linux 啟動mongodb
1.啟動mongodb服務(wù)
先cd到mongodb的目錄下
cd mongodb創(chuàng)建data數(shù)據(jù)目錄,和log日志目錄
mkdir -p data/db mkdir logs啟動mongodb服務(wù)
./bin/mongod --dbpath=./data/db --logpath=./logs/mongodb.log --fork建議以后臺方式啟動(–fork),否則以常駐方式啟動不能關(guān)閉啟動的終端
其他參數(shù)
--dbpath arg (=/data/db/) directory for datafiles 指定數(shù)據(jù)存放目錄 --quiet quieter output 靜默模式 --logpath arg file to send all output to instead of stdout 指定日志存放目錄 --logappend appnd to logpath instead of over-writing 指定日志是以追加還是以覆蓋的方式寫入日志文件 --fork fork server process 以創(chuàng)建子進程的方式運行 --cpu periodically show cpu and iowait utilization 周期性的顯示cpu和io的使用情況 --noauth run without security 無認證模式運行 --auth run with security 認證模式運行 --objcheck inspect client data for validity on receipt 檢查客戶端輸入數(shù)據(jù)的有效性檢查 --quota enable db quota management 開始數(shù)據(jù)庫配額的管理 --quotaFiles arg number of files allower per db, requires --quota 規(guī)定每個數(shù)據(jù)庫允許的文件數(shù) --appsrvpath arg root directory for the babble app server --nocursors diagnostic/debugging option 調(diào)試診斷選項 --nohints ignore query hints 忽略查詢命中率 --nohttpinterface disable http interface 關(guān)閉http接口,默認是28017 --noscripting disable scripting engine 關(guān)閉腳本引擎 --noprealloc disable data file preallocation 關(guān)閉數(shù)據(jù)庫文件大小預(yù)分配 --smallfiles use a smaller default file size 使用較小的默認文件大小 --nssize arg (=16) .ns file size (in MB) for new databases 新數(shù)據(jù)庫ns文件的默認大小 --diaglog arg 0=off 1=W 2=R 3=both 7=W+some reads 提供的方式,是只讀,只寫,還是讀寫都行,還是主要寫+部分的讀模式 --sysinfo print some diagnostic system information 打印系統(tǒng)診斷信息 --upgrade upgrade db if needed 如果需要就更新數(shù)據(jù)庫 --repair run repair on all dbs 修復(fù)所有的數(shù)據(jù)庫 --notablescan do not allow table scans 不運行表掃描 --syncdelay arg (=60) seconds between disk syncs (0 for never) 系統(tǒng)同步刷新磁盤的時間,默認是60s2.啟動mongodb
$ mongo總結(jié)
以上是生活随笔為你收集整理的linux 启动mongodb的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 18k金和黄金的区别——哪个更好——18
- 下一篇: Linux的一些配置文件位置