Running metricbeat service on dedicated non standard port


(Tushar Raut) #1

Hi,

I just want to confirm Is it possible to run metricbeat on some specific port which is non standard port and open on my setup?

Metricbeat service uses dynamic port and there is nothing I found for configuration change which will enable metricbeat service on dedicated port.

We can easily change service settings to run metricbeat service as specific user but running on same on some specific port is dont think so possible.

Thank you.


(Jaime Soriano) #2

Hi @tushar_raut,

I don't fully understand you, what metricbeat port are you refering to? Do you have some error log about already used ports?


(Tushar Raut) #3

Hi @jsoriano,

Like elasticsearch service uses http port 9200 and tcp port 9300, I would like to force metricbeat service to run with non standard port for example 8001.


(Jaime Soriano) #4

But metricbeat in principle doesn't need to open any port, you can run metricbeat and elasticsearch in the same host without any special settings.


(Tushar Raut) #5

Yes, default metricbeat does not required any special settings and it uses any random port. I want my metricbeat service run on specific port not on random port.


(Jaime Soriano) #6

Do you mean the client-side port used when connecting to ES? This is not possible to be configured in metricbeat, also this is usually fine with a random port, why would you need to specify this port?


(Tushar Raut) #7

I would like to monitor metricbeat service running on some host using heart beat.
For now as metricbeat service run's on random port I can check and configure same in heartbeat but after every metricbeat service restart I need to change metricbeat port number in heartbeat settings. If metricbeat service is running on dedicated port then I can directly configure same port in heartbeat and that is kind of one time activity.


(Jaime Soriano) #8

I still don't fully understand your scenario, in principle Beats don't listen for connections on any port, with the exception of some specific metricbeat modules or filebeat inputs, but they are intended to collect events in some specific scenarios, not to be used for general health checking.

How are you finding this random port? What heartbeat settings are you using?

To ensure that metricbeat is running you can use a service manager, for example in Linux systems where systemd is available, the configuration we provide includes Restart=always, so it is restarted if it unexpectedly stops. This is not enough if the configuration is incorrect, because even if it is restarted it will inmediately stop again, for that you may want to check if there are events in Elasticsearch. Or in general you can also enable x-pack monitoring for metricbeat.


(Tushar Raut) #9

Got it, I will start exploring xpack beats monitoring option. thank you @jsoriano.


(system) #10

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