Consistent hashing Exception

Asked by Pra

Trying to setup a carbon relay with consistent-hashing sending metrics to multiple cache instances on the same box. Using below settings. When the router is trying to create the hashing ring, it is throwing "destination instance already configured" exception. Looks like the carbon-relay code is expecting a unique IP for each destination. Any idea how we can send metrics to same host and multiple cache instances?

carbon 0.9.13
==============

[relay:c]
LINE_RECEIVER_INTERFACE = 0.0.0.0
PICKLE_RECEIVER_INTERFACE = 0.0.0.0
MAX_QUEUE_SIZE = 10000
MAX_DATAPOINTS_PER_MESSAGE = 5000
LINE_RECEIVER_PORT = 2413
PICKLE_RECEIVER_PORT = 2414
RELAY_METHOD = consistent-hashing
DESTINATIONS = 127.0.0.1:2104:c, 127.0.0.1:2204:c, 127.0.0.1:2304:c, 127.0.0.1:2404:c

Exception:
 /app/graphite/bin/carbon-relay.py --instance=c start
Starting carbon-relay (instance c)
Traceback (most recent call last):
  File "/app/graphite/bin/carbon-relay.py", line 32, in <module>
    run_twistd_plugin(__file__)
  File "/app/graphite/lib/carbon/util.py", line 92, in run_twistd_plugin
    runApp(config)
  File "/app/graphite/lib/twisted/scripts/twistd.py", line 25, in runApp
    _SomeApplicationRunner(config).run()
  File "/app/graphite/lib/twisted/application/app.py", line 348, in run
    self.application = self.createOrGetApplication()
  File "/app/graphite/lib/twisted/application/app.py", line 408, in createOrGetApplication
    ser = plg.makeService(self.config.subOptions)
  File "/app/graphite/lib/twisted/plugins/carbon_relay_plugin.py", line 21, in makeService
    return service.createRelayService(options)
  File "/app/graphite/lib/carbon/service.py", line 203, in createRelayService
    client_manager.startClient(destination)
  File "/app/graphite/lib/carbon/client.py", line 232, in startClient
    self.router.addDestination(destination)
  File "/app/graphite/lib/carbon/routers.py", line 52, in addDestination
    raise Exception("destination instance (%s, %s) already configured" % (server, instance))
Exception: destination instance (127.0.0.1, c) already configured

Question information

Language:
English Edit question
Status:
Solved
For:
Graphite Edit question
Assignee:
No assignee Edit question
Solved by:
Jason Dixon
Solved:
Last query:
Last reply:
Revision history for this message
Best Jason Dixon (jason-dixongroup) said :
#1

It's telling you that your instance identifier (in this case, "c") must be unique across your array of DESTINATIONS.

Revision history for this message
Pra (gurijala) said :
#2

Thanks Jason Dixon, that solved my question.

Revision history for this message
Pra (gurijala) said :
#3

Thank you. Overlooked the configuration and was adding relay instance identifier instead of cache instance id. Changes made and it works now.

DESTINATIONS = 127.0.0.1:2104:a, 127.0.0.1:2204:b, 127.0.0.1:2304:c, 127.0.0.1:2404:d