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.
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.
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?
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.
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.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.