relay-rules and consistent hashing

Asked by Gui

Hello,

I have 4 carbon-cache on two hosts and one relay.
How can I, with one relay, send all a.* metrics with consistent-hashing to the two carbon-caches on hosta.
All metrics b.* with consistent-hashing to the two other carbon-caches ?

I was thinking of
---carbon.conf
[relay]
...
RELAY_METHOD = rules
DESTINATIONS = hosta:2004:a,hosta:2104:b,hostb:2004:c,hostb:2104:d

---relay-rules.conf
[metrica]
pattern = ^a.*
destinations = hosta:2004:a,hosta:2104:b
[metricb]
pattern = ^b.*
destinations = hostb:2004:c,hostb:2104:d

but with this configuration, the same metric is send to the two caches on the same host (as if REPLICATION_FACTOR=2)

One other solution might be 3 relays for 4 carbon-caches (but it's a lot of relays imho)

---carbon.conf
[relay:a]
...
RELAY_METHOD = rules
DESTINATIONS = hosta:2004:a,hosta:2104:b,hostb:2004:c,hostb:2104:d

[relay:b]
PICKLE_RECEIVER_PORT = 2114
...
RELAY_METHOD = consistent-hashing
DESTINATIONS = hosta:2004:a,hosta:2104:b

[relay:c]
PICKLE_RECEIVER_PORT = 2214
...
RELAY_METHOD = consistent-hashing
DESTINATIONS = hostb:2004:c,hostb:2104:d

---relay-rules.conf
[metrica]
pattern = ^a.*
destinations = localhost:2114
[metricb]
pattern = ^b.*
destinations = localhost:2214

What are your opinions ?
Regards

Question information

Language:
English Edit question
Status:
Expired
For:
Graphite Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Denis Zhdanov (deniszhdanov) said :
#2

Hi Gui,

I think proper solution for your problem is using more than 1 relay tier. It's quite straightforward and widely used.