Hello all! I currently have influxdb and chronograf running on a virtual machine. I have edited both configs so they bind to the machines public ip address. However, when I try to send a datapoint via http to influxdb or try and access chronograf from a remote machine it won’t let me. I don’t have auth configured, could that be the issue? Thanks in advance to all of those who reply.
Hello all! I currently have influxdb and chronograf running on a virtual
machine. I have edited both configs so they bind to the machines public ip
address.
What does “netstat -lptn” tell you for those applications - do they appear
actually to be listening on the correct address?
However, when I try to send a datapoint via http to influxdb or
try and access chronograf from a remote machine it won’t let me.
What won’t let you? What happens? What goes wrong? What message do you
receive?
I don’t have auth configured, could that be the issue?
Possibly, depending on what the problem is. Tell us what happens when you try
to connect and we might have a better idea.
PS: Does your virtual machine come with any firewall protection, and if so,
have you opened up the appropriate ports for inbound traffic?
Antony.
Hi @Pooh
Performing netstat -lptn
gives me the following:
tcp 0 0 public-ip-here:8086 0.0.0.0:* LISTEN 4034/influxd
tcp 0 0 public-ip-here:8088 0.0.0.0:* LISTEN 4034/influxd
tcp 0 0 public-ip-here:8888 0.0.0.0:* LISTEN 3990/chronograf
I currently do not have a firewall set up… Should I try doing that then give my IP address access?
@Pooh I just enabled my Firewall, and have opened up port 8086 and 8888 to my remote machine.
Hi @Pooh
Performing
netstat -lptn
gives me the following:
If you run the command as root, you can see the application names in the final
column.
I find the first entry in your results very weird:
tcp 0 public-ip 0.0.0.0:* LISTEN -
It’s telling us that somethng listening on your public IP address, but without
any port number. That’s odd.
The only other port you have listening on the public IP is 8888 - is that the
port number you configured Influx to use?
I currently do not have a firewall set up… Should I try doing that then
give my IP address access?
No, if there is no firewall then adding one at this point will only complicate
things. I’m assuming “no firewall” means “all traffic is allowed”.
However, once you’ve sorted out the problem and traffic is working, please do
install a firewall to make the machine a bit more secure.
However, when I try to send a datapoint via http to influxdb or
try and access chronograf from a remote machine it won’t let me.What won’t let you? What happens? What goes wrong? What message do you
receive?Tell us what happens when you try to connect and we might have a better
idea.
Antony.
Hi. @Pooh I have edited the previous post with the updated result from netstat -lptn
Chornograf is running fine on my VM, but when I try to access it via http://public-ip-here:8888 on a remote machine, I get a chome error: This site can’t be reached
Then, when trying to send a datapoint via http using a simple python script I get a ConnectionTimeoutError.
I just enabled my Firewall, and have opened up port 8086 and 8888 to
my remote machine.
Okay.
Performing
netstat -lptn
gives me the following:
tcp 0 0 public-ip-here:8086 0.0.0.0:* LISTEN 4034/infl uxd
tcp 0 0 public-ip-here:8088 0.0.0.0:* LISTEN 4034/infl uxd
tcp 0 0 public-ip-here:8888 0.0.0.0:* LISTEN 3990/chro nograf
That looks a lot better.
Now - what happens when you try to send a data point?
Please don’t just say “it doesn’t work” - tell us what error message you get,
or anything else you can spot which tells us what is or isn’t happening.
Also, if you try the identical command on the VM itself (still using the
public IP address), is there any difference in the outcome?
Antony.
@Pooh I can access chronograf inside my virtual machine no problem. Still can’t access it from a remote machine, and I get the same error: This site can’t be reached
from chrome.
Weirdly enough, both services are active
running on my VM, however when I type influx
on the VM, I get the following error: Failed to connect to http://localhost:8086: Get http://localhost:8086/ping: dial tcp 127.0.0.1:8086: connect: connection refused Please check your connection settings and ensure 'influxd' is running.
EDIT:
Executing the same python code to send a simple http request works on the VM
Weirdly enough, both services are
active
running on my VM, however when I
typeinflux
on the VM, I get the following error:Failed to connect to http://localhost:8086: Get http://localhost:8086/ping: dial tcp 127.0.0.1:8086: connect: connection refused Please check your connection settings and ensure 'influxd' is running.
Note that this is trying to connect to localhost (127.0.0.1).
Executing the same python code to send a simple http request works on the
VM
Whereas that connects to the public IP address.
Performing
netstat -lptn
gives me the following:
tcp 0 0 public-ip-here:8086 0.0.0.0:* LISTEN 4034/influxd
That tells you that Infux is listening on the public IP address. It is not
listening on the localhost address, so you cannot reach it on 127.0.0.1:8086
Maybe you’d be better telling Influx simply to listen on all interfaces, then
you can connect to it on both localhost and the public IP.
Antony.
@Pooh, so I set the bind address for both influxdb and chronograf to both my public ip and my local ip.
I still can not connect to chorongraf from my remote machine.
Well, all I can say is that this has to be a networking problem, not an Influx
or Chronograf one.
You know you can connect to both on the VM itself, so they’re running
properly.
You can SSH to the machine (at least, I assume that’s how you’re logged in to
it?), so we know that it does have network connectivity.
And yet you can’t connect to Influx or Chronograf from an external address,
which makes me think yet again about some firewall in the way.
Can you install nmap on the machine you’re trying to connect from and see
what “nmap -sS -P0 tar.get.add.ress” shows you (where tar.get.add.ress is the
public IP of the machine we’re talking about and trying to connect to)?
Antony.
@Pooh Thank you for the help. The issue had to do with port forwarding from the guest to the host machine. Everything works as it should now.
I wonder how you’re managing to do port forwarding when the VM server has the
public IP address on it.
Port forwarding would normally imply that the virtualisation host has the
public IP, and the VM guest has a private IP to which connections are being
translated.
What virtualisation environment are you using?
Antony.
I am using Virtual Box on my host machine… Not the cleanest solution but it works. I am just trying to imitate a server, by having a raspberry pi send the data to the Virtual Machine running the influxdb instance.