How to run metricbeat in background?

Hi Team,
I am trying to install Metricbeat 7.10.1 Linux version on my Linux machine but I am unable to run the metricbeat in the Background.
Can any one help me on this so that i can run this beat in background itself

I tried
" sudo ./metricbeat and if I close terminal Beat also Stopped
Another scnario is if I give command like "sudo ./metirbeat -e " still if I close the Terminal I am getting stopped the Beat as well

Any alternate command is there for starting and stopping in background for Linux Version Beats

Hi!

You can run it as linux service as the installation docs propose: Metricbeat quick start: installation and configuration | Metricbeat Reference [7.10] | Elastic

C.

yes But if I start and if I close terminal Beat also stopped

sudo service metricbeat start should start the service and no matter what you do with the terminal it will continue running in the background as a linux service. Did you try that and service was stoped after exiting terminal?

Yes that command is for Deb Version I know, But here I am using Linux version of Beats there Only ./metricbeat -e is there

./metricbeat -e is just executing the binary. Installing Metricbeat as a service, or Deb as you mentioned, will give you the option to run it as linux service and have the background capabilities as well as be able to configure it to start automatically on boot. Running as a service is possible on both deb based systems (ubuntu, debian) but also on rpm based (centos, fedora).

If just want to stick with the simple binary execution then just a ./metricbeat -e & will do the trick but I wouldn't recommend that. Whatever you prefer :slight_smile: .

C.

If I execute the ./metricbeat. Then If I close terminal beat is stopped So My question is that is there any way to start metricbeat as a background service for Linux version

So You are telling that for Deb and rpm version Only it will run background as a service For LInux version just executing the binary am i right ?

Not sure that I understand what is this Linux version you are referring to? Debian, Ubuntu, Fedora and Centos are linux distributions. In this distributions you can get the binary of Metricbeat and run it directly with ./metricbeat OR you can install Metricbeat as a service and run it as a linux service. This is the only difference, the way you want to install and operate Metricbeat execution. If you want to just get the binary and run it natively on Linux then just add & in the end of the command and you will run it in the background as I mentioned above. If you don't want to install via deb or rpm then you will need to define the linux service on your own so as to wrap Metricbeat's binary execution. Hope that helps.

C.


I am referring this metricbeat running process.

if I start like this with ./packetbeat -e &

If i press enter then the service is stopped.

It was exited only by hitting enter :thinking: ? Interesting.
Can you try with nohup ./metricbeat -e &?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.