graphios icon indicating copy to clipboard operation
graphios copied to clipboard

carbon_servers does not work for multiple servers

Open druchoo opened this issue 9 years ago • 6 comments

carbon_servers = server1:2004,server2:2004

throws error:

April 22 19:36:29 graphios_backends.py WARNING Can't connect to carbon: server2:2004 [Errno 9] Bad file descriptor
April 22 19:36:29 graphios_backends.py CRITICAL Can't send message to carbon error:[Errno 9] Bad file descriptor
April 22 19:36:29 graphios.py CRITICAL keeping ********/host-perfdata.1429730053, insufficent metrics sent from carbon.

Sorry not setup for pulls but here's a proposed fix

# diff /usr/lib/python2.6/site-packages/graphios_backends.py ~/git/graphios/graphios_backends.py
363a364
>         sock = socket.socket()
366d366
<             sock = socket.socket()

druchoo avatar Apr 22 '15 19:04 druchoo

I also have similar problem.what are the changes need to be made in configuration files to connect to the carbon in different server ?

ghost avatar Feb 12 '16 07:02 ghost

@Lagadapati11 no changes needed in config just to graphios_backends.py

druchoo avatar Feb 16 '16 15:02 druchoo

I'm having this issue too. I took a look at graphios_backends.py but I don't see a problem with the indentation, which I gather is what the patch above was addressing.

This is what is in my graphios.cfg file:

carbon_servers = 172.16.0.181:2004,172.16.0.184:2004

Here's the log error I get:

June 21 23:49:07 graphios_backends.py DEBUG Connecting to carbon at 172.16.0.181:2004
June 21 23:49:07 graphios_backends.py DEBUG connected
June 21 23:49:07 graphios_backends.py DEBUG Connecting to carbon at 172.16.0.184:2004
June 21 23:49:07 graphios_backends.py WARNING Can't connect to carbon: 172.16.0.184:2004 [Errno 9] Bad file descriptor
June 21 23:49:07 graphios_backends.py CRITICAL Can't send message to carbon error:[Errno 9] Bad file descriptor
June 21 23:49:07 graphios.py CRITICAL keeping /var/spool/graphios/host-perfdata.1498053268, insufficent metrics sent from carbon.                              Should be 1, got 0

I've checked, and carbon-cache on the 2nd graphite server is accessible via port 2004 so it's not a connectivity issue.

guybluebat avatar Jun 22 '17 00:06 guybluebat

Never mind, I realised that the sock = socket.socket() needs to go inside the for loop. This wasn't clear to me from the patch noted above.

guybluebat avatar Jun 22 '17 00:06 guybluebat

Hi, We are also facing the same after our server restart. Can you please let me know the solution for this?

LavsChandu avatar Sep 21 '17 13:09 LavsChandu

can y pls let me know the latest of graphiod_banckends.py file if any?

LavsChandu avatar Sep 21 '17 13:09 LavsChandu