Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beats Won't Start if Modules Can't Connect #5090

Closed
ChristopherCorcoran opened this issue Sep 4, 2017 · 4 comments
Closed

Beats Won't Start if Modules Can't Connect #5090

ChristopherCorcoran opened this issue Sep 4, 2017 · 4 comments
Labels

Comments

@ChristopherCorcoran
Copy link

If I use a filebeats module, like 'system' or 'nginx', filebeats will fail to start if elasticsearch isn't up and running. There's no retry logic in the modules, like there is when you run beats without them. Same is true with metricbeats and the mongodb module. If mongod isn't up, then the metric module won't even start.

This effectively means that modules cannot be reliably used in production, despite the great benefit they provide on perfect, problem free systems.

@tsg tsg added the question label Sep 4, 2017
@tsg
Copy link
Contributor

tsg commented Sep 4, 2017

Which version of Beats are you on? Generally speaking, only the --setup flag / setup command require ES to be up when starting. That's mainly needed for loading the Kibana dashboards. Without setup, which is how the the init scripts start the Beats, they don't need ES to up.

The modules in Metricbeat should all keep polling until the monitored service is up. Let me know the version and the module if that's not the case.

@ChristopherCorcoran
Copy link
Author

ChristopherCorcoran commented Sep 5, 2017

Version 5.5.2. Not using setup here.

Here's the mongo module entry from my metricbeat.yml:

`- module: mongodb
metricsets: ["status","dbstats"]
hosts: ["localhost:27017"]

`

And from my filebeat.yml:

`filebeat.modules:

  • module: nginx
  • module: system
    `

In the former case, metricbeat won't start unless mongod is running, and in the latter case, filebeat won't start, unless elasticsearch is running (output works fine, without these modules).

Sorry about the formating. The "Insert Code" thing doesn't seem to be working right.

tsg added a commit to tsg/beats that referenced this issue Sep 7, 2017
Moving the Dial call to the Fetch, so that in case Mongodb is not (yet)
available, Metricbeat doesn't exit with an error, but just reports the
service being down. This is consistent with the way most of the other
modules are working.

Fixes elastic#5090
@tsg tsg added bug v5.5.0 and removed question labels Sep 7, 2017
@tsg
Copy link
Contributor

tsg commented Sep 7, 2017

You are right on both accounts.

For Filebeat modules, that was fixed a while ago in #4479, and the fix is in 6.0.0-beta2, but wasn't backported to 5.5. Is using 6.0.0-beta2 an option for you?

For the Metricbeat MongoDB issue, I opened #5120 with a fix.

exekias pushed a commit that referenced this issue Sep 7, 2017
MB mongodb module: connect on fetch, not on init

Moving the Dial call to the Fetch, so that in case Mongodb is not (yet)
available, Metricbeat doesn't exit with an error, but just reports the
service being down. This is consistent with the way most of the other
modules are working.

Fixes #5090
tsg added a commit to tsg/beats that referenced this issue Sep 7, 2017
MB mongodb module: connect on fetch, not on init

Moving the Dial call to the Fetch, so that in case Mongodb is not (yet)
available, Metricbeat doesn't exit with an error, but just reports the
service being down. This is consistent with the way most of the other
modules are working.

Fixes elastic#5090

(cherry picked from commit 9c9eaab)
exekias pushed a commit that referenced this issue Sep 8, 2017
… init (#5128)

MB mongodb module: connect on fetch, not on init

Moving the Dial call to the Fetch, so that in case Mongodb is not (yet)
available, Metricbeat doesn't exit with an error, but just reports the
service being down. This is consistent with the way most of the other
modules are working.

Fixes #5090

(cherry picked from commit 9c9eaab)
@ChristopherCorcoran
Copy link
Author

We'll hold off on the beta for now since we have a filebeats workaround (manually specifying the pipeline on the client to deliver syslog and nginx to, without using the modules).

Thanks for addressing the mongo issue. We can probably hold off on that until 6.0 is released.

leweafan pushed a commit to leweafan/beats that referenced this issue Apr 28, 2023
… not on init (elastic#5128)

MB mongodb module: connect on fetch, not on init

Moving the Dial call to the Fetch, so that in case Mongodb is not (yet)
available, Metricbeat doesn't exit with an error, but just reports the
service being down. This is consistent with the way most of the other
modules are working.

Fixes elastic#5090

(cherry picked from commit 01fc151)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants