We deploy metricbeat on 3 mongo servers ( 1 primary, 2 secondary )
While metricbeat run on secondary server we get the following error:
Error fetching data for metricset mongodb.replstatus: error getting replication info: no reachable servers
Once this server become the primary this error disappear.
Is this a bug or by design that metricset mongodb.replstatus work only for primary server:
metricbeat.yml -
metricbeat.modules:
- module: mongodb
metricsets: ["dbstats", "status", "collstats", "metrics", "replstatus"]
period: 10s
enabled: true
# The hosts must be passed as MongoDB URLs in the format:
# [mongodb://][user:pass@]host[:port].
# The username and password can also be set using the respective configuration
# options. The credentials in the URL take precedence over the username and
# password configuration options.
hosts: ["localhost:27017"]
username: beats
password: pass