I want to bind Metricbeats to a specific IP-address. Is there a way to do so?
For a Elasticsearch node I am able to set it in /etc/elasticsearch/elasticsearch.yml but for Metricbeats I am missing a setting like this.
yes, we want to send to ES-nodes. We have multiple network interfaces on the machine where Metricbeats is running. And just a particular one can reach the Elasticsearch node.
To communicate via curl from the machine where the Metricbeats is installed to the ES node it would be for instance work with:
curl --interface 10.30.150.32 -XGET http://10.30.134.155:9200/_cat/indices
The Problem is that the connection will work in case if the interface could be specified like in the curl command. If I use curl without "--interface" parameter the connection will not work. I think that's why Metricbeats is currently not able to connect to that particular ES-node. I am missing the setting in the metricbeats.yml "network.host" to bind the Metricbeats-process to a specific IPv4 address on the server.
That's kind of odd. It's been a while since I have looked at this sort of problem but surely the OS should be handling routing so this isn't necessary?
Hi Mark, let me drop some more info here. Imagine that you have a host you like to monitor using Metricbeat. There are 3 network interfaces on that host with following IP addresses - 10.30.146.32, 10.30.150.32, 10.30.154.32. The default route configured through interface having IP 10.30.146.32. But the desired IP address for Metricbeat to send data to Elasticsearch is 10.30.150.32.
So in general if you try to open TCP connection and you define only the remote (destination/server's) IP address and the remote port the OS will automatically pick a "suitable" local (source/client's) IP address and a random local unused port to bind to.
But there is a possibility to specify the local (source/client's) IP address and the local port to bind to when opening TCP connection. The Metricbeat does not support such configuration option.
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.