如何啟動MongoDB的WEB介面
修改/etc/mongodb.conf,新增如下行:
httpinterface=true
mongodb.conf內容如下:
bash-4.2$ cat /etc/mongodb.conf
port=27017 #埠
dbpath= /data/mongodb #資料檔案存放目錄
logpath= /data/mongodb/logs/mongodb.log #日誌檔案存放目錄
logappend=true #使用追加的方式寫日誌
fork=true #以守護程式的方式啟用,即在後臺執行
maxConns=500 #最大同時連線數
noauth=true #不啟用驗證
journal=true
storageEngine=wiredTiger
httpinterface=true #啟動http介面,埠號為28017
手動用命令啟動mongodb:
bash-4.2$ mongod --config /etc/mongodb.conf --rest
about to fork child process, waiting until server is ready for connections.
forked process: 4203
child process started successfully, parent exiting
..............................................................................
(註釋: --rest代表turn on simple rest api)
檢視啟動日誌:
bash-4.2$ tail -f /data/mongodb/logs/mongodb.log
2016-07-01T17:29:13.766+0800 I CONTROL [initandlisten]
2016-07-01T17:29:13.996+0800 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory '/data/mongodb/diagnostic.data'
2016-07-01T17:29:13.999+0800 I NETWORK [websvr] admin web console waiting for connections on port 28017
2016-07-01T17:29:13.999+0800 I NETWORK [HostnameCanonicalizationWorker] Starting hostname canonicalization worker
2016-07-01T17:29:14.023+0800 I NETWORK [initandlisten] waiting for connections on port 27017
2016-07-01T17:29:16.631+0800 I NETWORK [initandlisten] connection accepted from 127.0.0.1:50609 #1 (1 connection now open)
2016-07-01T17:29:34.679+0800 I NETWORK [websvr] Socket recv() errno:11 Resource temporarily unavailable 192.168.23.1:61067
2016-07-01T17:29:52.455+0800 I NETWORK [websvr] Socket recv() errno:11 Resource temporarily unavailable 192.168.23.1:61076
2016-07-01T17:30:00.455+0800 I NETWORK [websvr] Socket recv() errno:11 Resource temporarily unavailable 192.168.23.1:61077
2016-07-01T17:30:33.228+0800 I NETWORK [conn1] end connection 127.0.0.1:50609 (0 connections now open)
waiting for connections on port 27017字樣代表MongoDB已成功啟動。
檢視本地IP地址:
bash-4.2$ ifconfig -a
eno16777736: flags=4163 mtu 1500
inet 192.168.23.131 netmask 255.255.255.0 broadcast 192.168.23.255
inet6 fe80::20c:29ff:feb2:3e46 prefixlen 64 scopeid 0x20
ether 00:0c:29:b2:3e:46 txqueuelen 1000 (Ethernet)
RX packets 2273 bytes 2027304 (1.9 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1398 bytes 159433 (155.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
開啟本地瀏覽器,輸入以下地址:
http://192.168.23.131:28017/
透過web頁面可以看到:
1.當前Mongodb的所有連線
2.各個資料庫和Collection的訪問統計,包括:Reads, Writes, Queries, GetMores ,Inserts, Updates, Removes
3.寫鎖的狀態
4.以及日誌檔案的最後幾百行(安裝的mongodb預設的日誌檔案位於/data/mongodb/logs/mongod.log)
5.所有的MongoDB命令
httpinterface=true
mongodb.conf內容如下:
bash-4.2$ cat /etc/mongodb.conf
port=27017 #埠
dbpath= /data/mongodb #資料檔案存放目錄
logpath= /data/mongodb/logs/mongodb.log #日誌檔案存放目錄
logappend=true #使用追加的方式寫日誌
fork=true #以守護程式的方式啟用,即在後臺執行
maxConns=500 #最大同時連線數
noauth=true #不啟用驗證
journal=true
storageEngine=wiredTiger
httpinterface=true #啟動http介面,埠號為28017
手動用命令啟動mongodb:
bash-4.2$ mongod --config /etc/mongodb.conf --rest
about to fork child process, waiting until server is ready for connections.
forked process: 4203
child process started successfully, parent exiting
..............................................................................
(註釋: --rest代表turn on simple rest api)
檢視啟動日誌:
bash-4.2$ tail -f /data/mongodb/logs/mongodb.log
2016-07-01T17:29:13.766+0800 I CONTROL [initandlisten]
2016-07-01T17:29:13.996+0800 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory '/data/mongodb/diagnostic.data'
2016-07-01T17:29:13.999+0800 I NETWORK [websvr] admin web console waiting for connections on port 28017
2016-07-01T17:29:13.999+0800 I NETWORK [HostnameCanonicalizationWorker] Starting hostname canonicalization worker
2016-07-01T17:29:14.023+0800 I NETWORK [initandlisten] waiting for connections on port 27017
2016-07-01T17:29:16.631+0800 I NETWORK [initandlisten] connection accepted from 127.0.0.1:50609 #1 (1 connection now open)
2016-07-01T17:29:34.679+0800 I NETWORK [websvr] Socket recv() errno:11 Resource temporarily unavailable 192.168.23.1:61067
2016-07-01T17:29:52.455+0800 I NETWORK [websvr] Socket recv() errno:11 Resource temporarily unavailable 192.168.23.1:61076
2016-07-01T17:30:00.455+0800 I NETWORK [websvr] Socket recv() errno:11 Resource temporarily unavailable 192.168.23.1:61077
2016-07-01T17:30:33.228+0800 I NETWORK [conn1] end connection 127.0.0.1:50609 (0 connections now open)
waiting for connections on port 27017字樣代表MongoDB已成功啟動。
檢視本地IP地址:
bash-4.2$ ifconfig -a
eno16777736: flags=4163 mtu 1500
inet 192.168.23.131 netmask 255.255.255.0 broadcast 192.168.23.255
inet6 fe80::20c:29ff:feb2:3e46 prefixlen 64 scopeid 0x20
ether 00:0c:29:b2:3e:46 txqueuelen 1000 (Ethernet)
RX packets 2273 bytes 2027304 (1.9 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1398 bytes 159433 (155.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
開啟本地瀏覽器,輸入以下地址:
http://192.168.23.131:28017/
透過web頁面可以看到:
1.當前Mongodb的所有連線
2.各個資料庫和Collection的訪問統計,包括:Reads, Writes, Queries, GetMores ,Inserts, Updates, Removes
3.寫鎖的狀態
4.以及日誌檔案的最後幾百行(安裝的mongodb預設的日誌檔案位於/data/mongodb/logs/mongod.log)
5.所有的MongoDB命令
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/15498/viewspace-2121343/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 如何安裝MongoDB併成功啟動MongoDB
- mongodb啟動MongoDB
- mongodb 啟動故障MongoDB
- MongoDB配置與啟動MongoDB
- mongodb 啟動報錯MongoDB
- Mongodb 啟動關閉指令碼並設定開機自動啟動MongodbMongoDB指令碼
- 如何製作 Uber 啟動開屏介面
- mongodb的安裝和啟動方法MongoDB
- Go控制Docker啟動MongoDBDockerMongoDB
- MongoDB 安裝與啟動MongoDB
- [Mongodb]安裝與啟動MongoDB
- 啟動MongoDB資料庫MongoDB資料庫
- windows 下 MongoDB 的安裝與啟動WindowsMongoDB
- windows下mongodb的安裝及啟動WindowsMongoDB
- mongodb服務在哪裡啟動?MongoDB
- MongoDB啟動引數介紹MongoDB
- VMware Server Web介面無法開啟ServerWeb
- mongoDB安裝與啟動的注意事項MongoDB
- mongodb的安裝與啟動(centos7)MongoDBCentOS
- 如何在我的應用啟動介面實現「開屏廣告」?
- mongodb啟動報錯怎麼辦MongoDB
- MongoDB啟動引數中文詳解MongoDB
- ubuntu如何關閉圖形介面,啟動文字模式Ubuntu模式
- Linux下的MongoDB安裝&啟動&關閉LinuxMongoDB
- RetHatLinux啟動到文字介面(不啟動xwindow)Linux
- 打造一個啟動介面
- Mongodb啟動命令mongod引數說明MongoDB
- mongodb啟動失敗問題解決MongoDB
- MongoDB啟動命令mongod引數的詳細解釋MongoDB
- 【Mongodb】如何建立mongodb的replica setMongoDB
- MongoDB啟動檔案配置引數詳解MongoDB
- Linux下Mongodb安裝和啟動配置LinuxMongoDB
- MongoDB Mongod啟動命令常用引數解釋MongoDB
- Rust使用Sauron實現Web介面互動RustWeb
- WEB前後端互動(UI介面和資料內容)如何實現Web後端UI
- 讀<<瞬間之美:Web介面設計如何讓使用者心動>>Web
- 去電介面啟動分析---之一
- 啟動Activity但不顯示其介面