下載吧 - 綠色安全的游戲和軟件下載中心

          軟件下載吧

          當(dāng)前位置:軟件下載吧 > 數(shù)據(jù)庫(kù) > DB2 > MongoDB入門到進(jìn)階筆記:06- 實(shí)時(shí)監(jiān)控 mongostat

          MongoDB入門到進(jìn)階筆記:06- 實(shí)時(shí)監(jiān)控 mongostat

          時(shí)間:2024-02-08 11:17作者:下載吧人氣:39

          下載 tools
          mongodb-database-tools-rhel70-x86_64-100.6.0.tgz

          解壓到 mongodb/bin目錄下
          [root@5e7b4039fa6f bin]# pwd
          /data/mongodb/bin
          [root@5e7b4039fa6f bin]#
          [root@5e7b4039fa6f bin]# ll
          total 366500
          -rwxr-xr-x. 1 root root 14006152 Aug 18 21:04 bsondump
          -rwxr-xr-x. 1 root root 15205 Sep 29 11:18 install_compass
          -rwxr-xr-x. 1 root root 58599688 Sep 29 12:05 mongo
          -rwxr-xr-x. 1 root root 110063096 Sep 29 12:04 mongod
          -rwxr-xr-x. 1 root root 16681384 Aug 18 21:04 mongodump
          -rwxr-xr-x. 1 root root 16342896 Aug 18 21:04 mongoexport
          -rwxr-xr-x. 1 root root 17288152 Aug 18 21:04 mongofiles
          -rwxr-xr-x. 1 root root 16615512 Aug 18 21:04 mongoimport
          -rwxr-xr-x. 1 root root 17062464 Aug 18 21:04 mongorestore
          -rwxr-xr-x. 1 root root 76724856 Sep 29 12:05 mongos
          -rwxr-xr-x. 1 root root 16173064 Aug 18 21:04 mongostat
          -rwxr-xr-x. 1 root root 15705384 Aug 18 21:04 mongotop

          mongodb實(shí)時(shí)監(jiān)控之mongostat
          mongostat可以實(shí)時(shí)監(jiān)控mongodb的狀態(tài),一直刷新輸出
          測(cè)試腳本
          for(i=1; i<=50000;i++){
          db.myuser.insert( {name:’mytest’+i, age:i} )
          }

          mongostat –help
          mongostat -h 127.0.0.1:27017
          root@5e7b4039fa6f bin]# mongostat
          insert query update delete getmore command dirty used flushes vsize res qrw arw net_in net_out conn time
          418 *0 *0 *0 0 0|0 0.3% 0.3% 0 1.66G 194M 0|0 0|1 76.3k 164k 4 Nov 2 11:13:27.970
          320 *0 *0 *0 0 1|0 0.3% 0.3% 0 1.66G 194M 0|0 0|0 58.5k 139k 4 Nov 2 11:13:28.967
          381 *0 *0 *0 0 0|0 0.3% 0.3% 0 1.66G 194M 0|1 0|0 69.6k 154k 4 Nov 2 11:13:29.970
          365 *0 *0 *0 0 1|0 0.3% 0.4% 0 1.66G 194M 0|0 0|0 66.7k 151k 4 Nov 2 11:13:30.968
          371 *0 *0 *0 0 1|0 0.4% 0.4% 0 1.66G 194M 0|0 0|1 67.7k 152k 4 Nov 2 11:13:31.967
          346 *0 *0 *0 0 0|0 0.4% 0.4% 0 1.66G 194M 0|0 0|1 63.2k 146k 4 Nov 2 11:13:32.967
          352 *0 *0 *0 0 0|0 0.4% 0.4% 0 1.66G 194M 0|0 0|1 64.3k 147k 4 Nov 2 11:13:33.967
          299 *0 *0 *0 0 0|0 0.4% 0.4% 0 1.66G 194M 0|0 0|1 54.7k 134k 4 Nov 2 11:13:34.968
          328 *0 *0 *0 0 1|0 0.4% 0.4% 0 1.66G 194M 0|0 0|1 59.8k 141k 4 Nov 2 11:13:35.967
          307 *0 *0 *0 0 3|0 0.4% 0.4% 0 1.66G 194M 0|0 0|1 56.2k 136k 4 Nov 2 11:13:36.967
          dirty: 臟數(shù)據(jù)
          flushes 刷新后dirty會(huì)清零

          mongodb監(jiān)控之serverStatus
          serverStatus可用來(lái)獲取mongodb的狀態(tài)信息
          db.serverStatus()#查看所有的監(jiān)控信息
          db.serverStatus().network#單獨(dú)查看網(wǎng)絡(luò)流量信息
          db.serverStatus().network
          {
          “bytesIn” : NumberLong(98285080),
          “bytesOut” : NumberLong(51318350),
          “physicalBytesIn” : NumberLong(98280936),
          “physicalBytesOut” : NumberLong(51318350),
          “numSlowDNSOperations” : NumberLong(0),
          “numSlowSSLOperations” : NumberLong(0),
          “numRequests” : NumberLong(538374),
          “tcpFastOpen” : {
          “kernelSetting” : NumberLong(0),
          “serverSupported” : true,
          “clientSupported” : false,
          “accepted” : NumberLong(0)
          },
          “compression” : {
          “snappy” : {
          “compressor” : {

          db.serverStatus().mem #內(nèi)存
          db.serverStatus().mem
          { “bits” : 64, “resident” : 194, “virtual” : 1701, “supported” : true }

          db.serverStatus().opcounters#統(tǒng)計(jì)增、刪、改、查的次數(shù)
          db.serverStatus().opcounters
          {
          “insert” : NumberLong(537487),
          “query” : NumberLong(69),
          “update” : NumberLong(26),
          “delete” : NumberLong(9),
          “getmore” : NumberLong(0),
          “command” : NumberLong(1069)
          }

          db.serverStatus().connections#連接
          db.serverStatus().connections
          {
          “current” : 4,
          “available” : 838856,
          “totalCreated” : 20,
          “active” : 2,
          “threaded” : 4,
          “exhaustIsMaster” : 0,
          “exhaustHello” : 1,
          “awaitingTopologyChanges” : 1
          }

          使用非交互式shell進(jìn)行獲取
          echo ‘db.serverStatus()’ | mongo
          echo ‘db.serverStatus().opcounters’ | mongo
          [root@5e7b4039fa6f ~]# echo ‘db.serverStatus().opcounters’ | mongo
          MongoDB shell version v5.0.13
          connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
          Implicit session: session { “id” : UUID(“627d44f9-7102-441a-8a8a-547da8d9e672”) }

          MongoDB server version: 5.0.13

          Warning: the “mongo” shell has been superseded by “mongosh”,
          which delivers improved usability and compatibility.The “mongo” shell has been deprecated and will be removed in
          an upcoming release.
          For installation instructions, see

          https://docs.mongodb.com/mongodb-shell/install/

          {
          “insert” : NumberLong(537487),
          “query” : NumberLong(70),
          “update” : NumberLong(28),
          “delete” : NumberLong(14),
          “getmore” : NumberLong(0),
          “command” : NumberLong(1434)
          }
          bye
          echo ‘db.serverStatus().opcounters.insert’ |mongo
          [root@5e7b4039fa6f ~]# echo ‘db.serverStatus().opcounters.insert’ |mongo
          MongoDB shell version v5.0.13
          connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
          Implicit session: session { “id” : UUID(“15a87edc-5902-4a0b-97c2-3c9be5ff320f”) }
          MongoDB server version: 5.0.13
          Warning: the “mongo” shell has been superseded by “mongosh”,
          which delivers improved usability and compatibility.The “mongo” shell has been deprecated and will be removed in
          an upcoming release.
          For installation instructions, see
          https://docs.mongodb.com/mongodb-shell/install/
          NumberLong(537487)

          MongoDB入門到進(jìn)階筆記:06- 實(shí)時(shí)監(jiān)控 mongostat
          標(biāo)簽MongoDB,學(xué)習(xí)筆記,技術(shù)文檔,數(shù)據(jù)庫(kù),MongoDB

          相關(guān)下載

          查看所有評(píng)論+

          網(wǎng)友評(píng)論

          網(wǎng)友
          您的評(píng)論需要經(jīng)過(guò)審核才能顯示

          熱門閱覽

          最新排行

          公眾號(hào)

          主站蜘蛛池模板: 夜夜添无码试看一区二区三区| 日韩美女在线观看一区| 不卡一区二区在线| 亚洲国产成人久久综合一区| 波多野结衣一区二区三区88| 成人国产一区二区三区| 色一情一乱一伦一区二区三欧美| 一区二区三区免费视频播放器 | 久久久一区二区三区| 波多野结衣电影区一区二区三区| 骚片AV蜜桃精品一区| 日韩精品无码一区二区三区AV | 人妻无码一区二区三区免费| 美女免费视频一区二区| 免费一本色道久久一区| 麻豆一区二区三区精品视频| 波多野结衣AV无码久久一区| 国产一区二区精品久久91| 亚洲午夜精品一区二区麻豆| 乱色精品无码一区二区国产盗| 国模无码人体一区二区| 精品国产毛片一区二区无码| 风流老熟女一区二区三区| 国产福利一区二区| 精产国品一区二区三产区| 亚洲综合激情五月色一区| 久久综合亚洲色一区二区三区| 国产精品视频第一区二区三区| 在线精品亚洲一区二区三区| 亚洲AV无码一区二区三区国产| 无遮挡免费一区二区三区| 免费无码一区二区| 国产a久久精品一区二区三区| 风间由美在线亚洲一区| 韩国女主播一区二区| 免费观看日本污污ww网站一区| 国产91精品一区| aⅴ一区二区三区无卡无码| 国产AV国片精品一区二区| 亚洲日本一区二区三区在线不卡| 一区二区三区四区视频在线|