大网数据广告活动
服务器运维问答

Monitoring MongoDB 3.2 using Stackdriver in Google Compute Engine failed silently

· 52CE 我爱测

I'm having problem monitoring MongoDB 3.2 with Stackdriver as of 28 Aug 2016. There is no mention of mongo whatsoever in /var/log/syslog but if I made a configuration error on the .conf file, it complains so I know it's loading t…

问题原文

原帖链接 · Hendy Irawan · CC BY-SA 3.0

I'm having problem monitoring MongoDB 3.2 with Stackdriver as of 28 Aug 2016.

There is no mention of mongo whatsoever in /var/log/syslog but if I made a configuration error on the .conf file, it complains so I know it's loading the file correctly...

So no errors, but no mention of mongo either in /var/log/syslog and https://app.google.stackdriver.com/services/mongodb claims I haven't installed the agent.

gke-fatih-standard-fb894cbb-d7ue:/opt/stackdriver/collectd/etc$ sudo service stackdriver-agent restart
[....] Restarting Stackdriver metrics collection agent: stackdriver-agentoption = Interval; value = 60.000000;
Created new plugin context.
option = Interval; value = 60.000000;
Created new plugin context.
option = PIDFile; value = /var/run/stackdriver-agent.pid;
option = Interval; value = 60.000000;
Created new plugin context.
. ok

$ tail -F /var/log/syslog
Aug 28 06:53:01 gke-fatih-standard-fb894cbb-d7ue /USR/SBIN/CRON[21824]: (root) CMD (/etc/supervisor/supervisor_watcher.sh 2>&1 | logger)
Aug 28 06:53:03 gke-fatih-standard-fb894cbb-d7ue collectd[21844]: type = syslog, key = LogLevel, value = info
Aug 28 06:53:03 gke-fatih-standard-fb894cbb-d7ue collectd[21844]: write_gcm: inside module_register for stackdriver_agent/5.5.0-340.wheezy
Aug 28 06:53:03 gke-fatih-standard-fb894cbb-d7ue collectd[21845]: type = syslog, key = LogLevel, value = info
Aug 28 06:53:03 gke-fatih-standard-fb894cbb-d7ue collectd[21845]: write_gcm: inside module_register for stackdriver_agent/5.5.0-340.wheezy
Aug 28 06:53:03 gke-fatih-standard-fb894cbb-d7ue collectd[21846]: Initialization complete, entering read-loop.
Aug 28 06:53:03 gke-fatih-standard-fb894cbb-d7ue collectd[21846]: match_throttle_metadata_keys: 1 history entries, 1 distinct keys, 78 bytes server memory.
Aug 28 06:53:03 gke-fatih-standard-fb894cbb-d7ue collectd[21846]: tcpconns plugin: Reading from netlink succeeded. Will use the netlink method from now on.
Aug 28 06:53:03 gke-fatih-standard-fb894cbb-d7ue collectd[21846]: write_gcm: Asking metadata server for auth token
Aug 28 06:53:04 gke-fatih-standard-fb894cbb-d7ue collectd[21846]: match_throttle_metadata_keys: 2 history entries, 1025 distinct keys, 102801 bytes server memory.

Note that instance/node is monitored correctly, only MongoDB is problematic.

/opt/stackdriver/collectd/etc/collect.d/mongo0.conf :

# scheduled to node: gke-fatih-standard-fb894cbb-d7ue
# This is the monitoring configuration for MongoDB.
# Look for STATS_USER, STATS_PASS, MONGODB_HOST and MONGODB_PORT to adjust your configuration file.
LoadPlugin mongodb
<Plugin "mongodb">
    # When using non-standard MongoDB configurations, replace the below with
    #Host "MONGODB_HOST"
    #Port "MONGODB_PORT"
    # Must use the load balancer because we don't know the fixed nodePort
    Host "xxx"
    Port "27017"

    # If you restricted access to the database, you can set the username and
    # password here:
    User "stats"
    Password "xxx"
</Plugin>

Related to Monitoring MongoDB 3 using StackDriver in GCE

已采纳解答

原帖链接 · Simon Moses · CC BY-SA 4.0

Google is deprecating their non-GCP focused Stackdriver integrations (like Mongo) and moving to the BindPlane MIaaS platform as their supported monitoring integrations platform for non-GCP datasources.

More details can be found here:

https://cloud.google.com/monitoring/agent/plugins/bindplane-transition

and here:

https://bluemedora.com/how-to-monitor-mongodb-bindplane-for-stackdriver-blue-medora/

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-08-28)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0 / CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。