Simple add to allow the user to provide several TSD's URI from the CLI.
tcollector will then trying to connect randomly to a server, and to another one if first is not available.
Handled several connections to TSD's
Perhaps keeping this option for backward compatibility reasons ?
Yeah, please don't change existing command line arguments, they are the public interface of tcollector to the outside world.
I'd recommend adding a new flag that takes your comma-separated list.
This way it's 100% backwards compatible.
Ensure backward compatibility on host and port options
My last commit should ensure 100% backward compatibility. Available connections are also represented as tuples, as it's could be more convenient to handle python objects rather than raw strings.
Fixed some non-obvious condition when preparing list of hosts
Updated shebang for using python's binary defined in user's environment
Oops, should be a different pull request ! Don't know how to remove a commit from a pull request....
For this commit, I think it's safer to use the user defined python.
Handled configuration file for enabling specific collectors
I don't know if it's in your framework's philosophy, but I added the possibility to configure enabled collectors through a configuration file. This choice has been motivated since it could be more convenient to handle package/configuration deployment (I mean with tools such as Puppet or Chef) than moving/renaming list of collector files beginning with a dot.
By the way, even if these tools are able to trigger service restart, tcollector will automatically reload itself this configuration file when required.
Hmm, this pull request sort of fell through the cracks. What do you think if I pull it as tsuna/tcollector@5f7046a – it contains a few fixes:
There was a small bug I introduced in the commit I referred to above, I'm planning to merge this one instead: tsuna/tcollector@047f7f8
Hmm... picking a TSD randomly for first iteration was a first kind of load balancing solution without adding extra load balancer. What do you think?
True, I didn't see it this way, but I see how this makes sense. I'll change the code to shuffle the list early on.
OK I added a couple lines in tsuna/tcollector@da080e4 (see L405-406 in the new file).
Ok, let's merge :)
A few words anyway: take note that blacklisting hosts might not be a good choice at all; for instance when you're rolling restarting all your TSDs, load could not be evenly spread (no connection on the last restarted TSD).
Merged upstream as OpenTSDB/tcollector@da080e4