mongoDB之监控工具mongostat及其参数的具体含义
mongostat是mongdb自带的状态检测工具,在命令行下使用。它会间隔固定时间获取mongodb的当前运行状态,并输出。如果你发现数据库突然变慢或者有其他问题的话,你第一手的操作就考虑采用mongostat来查看mongo的状态。
mongostat命令格式,当然也可以加参数:
在对应的 mongodb2.6.1的版本下, ./mongo --help如下:
Options:
  --help                                produce help message
  -v [ --verbose ]                      be more verbose (include multiple times
                                        for more verbosity e.g. -vvvvv)
  --quiet                               silence all non error diagnostic 
                                        messages
  --version                             print the program's version and exit
  -h [ --host ] arg                     mongo host to connect to ( <set 
                                        name>/s1,s2 for sets)
  --port arg                            server port. Can also use --host 
                                        hostname:port
  --ipv6                                enable IPv6 support (disabled by 
                                        default)
  -u [ --username ] arg                 username
  -p [ --password ] arg                 password
  --authenticationDatabase arg          user source (defaults to dbname)
  --authenticationMechanism arg (=MONGODB-CR)
                                        authentication mechanism
  --gssapiServiceName arg (=mongodb)    Service name to use when authenticating
                                        using GSSAPI/Kerberos
  --gssapiHostName arg                  Remote host name to use for purpose of 
                                        GSSAPI/Kerberos authentication
  --noheaders                           don't output column names
  -n [ --rowcount ] arg (=0)            number of stats lines to print (0 for 
                                        indefinite)
  --http                                use http instead of raw db connection
  --discover                            discover nodes and display stats for 
                                        all
  --all                                 all optional fields
mongostat -discover
以上参考文档:http://cn.docs.mongodb.org/manual/reference/mongostat/
主要详细说明一下各列的意义(也可以参考./mongostat --help)
如果在windows下的cmd窗口中执行mongostat命令时,可能由于窗口太窄,监控数据排列较乱而阻碍视觉的情况,大家可以把结果输出到一个txt文件中,然后去查看这个文件,办法是曲折了一些哈哈。
E:\mongodb-win32-x86_64-2.2.1\bin\mongostat -n 2 > E:\test.txt
打印2行结果到E盘的跟目录下的test.txt中。
参考文档:http://cn.docs.mongodb.org/manual/reference/mongostat/ 
                    
                     
                    
                 
                    
                
 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号