# Running metricbeat service on dedicated non standard port

**URL:** <https://discuss.elastic.co/t/running-metricbeat-service-on-dedicated-non-standard-port/149412>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [September 21, 2018, 8:00am UTC](https://discuss.elastic.co/t/running-metricbeat-service-on-dedicated-non-standard-port/149412 "2018-09-21T08:00:36Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![tushar\_raut](https://avatars.discourse-cdn.com/v4/letter/t/48db29/32.png) [@tushar\_raut](https://discuss.elastic.co/u/tushar_raut)\
**Post date:** [September 21, 2018, 8:00am UTC](https://discuss.elastic.co/t/running-metricbeat-service-on-dedicated-non-standard-port/149412/1 "2018-09-21T08:00:37Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jsoriano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsoriano/32/27920_2.png) [@jsoriano](https://discuss.elastic.co/u/jsoriano)\
**Post date:** [September 21, 2018, 10:52am UTC](https://discuss.elastic.co/t/running-metricbeat-service-on-dedicated-non-standard-port/149412/2 "2018-09-21T10:52:13Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![tushar\_raut](https://avatars.discourse-cdn.com/v4/letter/t/48db29/32.png) [@tushar\_raut](https://discuss.elastic.co/u/tushar_raut)\
**Post date:** [September 21, 2018, 3:01pm UTC](https://discuss.elastic.co/t/running-metricbeat-service-on-dedicated-non-standard-port/149412/3 "2018-09-21T15:01:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jsoriano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsoriano/32/27920_2.png) [@jsoriano](https://discuss.elastic.co/u/jsoriano)\
**Post date:** [September 21, 2018, 5:08pm UTC](https://discuss.elastic.co/t/running-metricbeat-service-on-dedicated-non-standard-port/149412/4 "2018-09-21T17:08:13Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![tushar\_raut](https://avatars.discourse-cdn.com/v4/letter/t/48db29/32.png) [@tushar\_raut](https://discuss.elastic.co/u/tushar_raut)\
**Post date:** [September 21, 2018, 5:22pm UTC](https://discuss.elastic.co/t/running-metricbeat-service-on-dedicated-non-standard-port/149412/5 "2018-09-21T17:22:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jsoriano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsoriano/32/27920_2.png) [@jsoriano](https://discuss.elastic.co/u/jsoriano)\
**Post date:** [September 21, 2018, 5:40pm UTC](https://discuss.elastic.co/t/running-metricbeat-service-on-dedicated-non-standard-port/149412/6 "2018-09-21T17:40:11Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![tushar\_raut](https://avatars.discourse-cdn.com/v4/letter/t/48db29/32.png) [@tushar\_raut](https://discuss.elastic.co/u/tushar_raut)\
**Post date:** [September 21, 2018, 6:07pm UTC](https://discuss.elastic.co/t/running-metricbeat-service-on-dedicated-non-standard-port/149412/7 "2018-09-21T18:07:34Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jsoriano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsoriano/32/27920_2.png) [@jsoriano](https://discuss.elastic.co/u/jsoriano)\
**Post date:** [September 22, 2018, 10:49am UTC](https://discuss.elastic.co/t/running-metricbeat-service-on-dedicated-non-standard-port/149412/8 "2018-09-22T10:49:27Z")

</div>

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](https://freedesktop.org/wiki/Software/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](https://www.elastic.co/guide/en/beats/metricbeat/6.4/monitoring.html).

---

<div class="post-metadata">

**Author:** ![tushar\_raut](https://avatars.discourse-cdn.com/v4/letter/t/48db29/32.png) [@tushar\_raut](https://discuss.elastic.co/u/tushar_raut)\
**Post date:** [September 24, 2018, 9:56am UTC](https://discuss.elastic.co/t/running-metricbeat-service-on-dedicated-non-standard-port/149412/9 "2018-09-24T09:56:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 22, 2018, 9:56am UTC](https://discuss.elastic.co/t/running-metricbeat-service-on-dedicated-non-standard-port/149412/10 "2018-10-22T09:56:10Z")

</div>

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