Multiple carbon-cache on same machine behind carbon-relay

Asked by redbaron

Hi,
If I want to run multiple carbon-caches behind carbon-relay on same server using consistent hashing, do I need to define separate LOCAL _DATA_DIR and WHISTLELISTS_DIR for each carbone-cache instance?

Question information

Language:
English Edit question
Status:
Answered
For:
Graphite Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Michael Leinartas (mleinartas) said :
#1

No, since you're using consistent hashing you'll avoid two carbon instances trying to write to the same file (which can be done, but should be avoided) so you should be good to share the directory between multiple instances. The WHITELISTS_DIR you can probably ignore in all cases as it's not used unless you use the feature.

Revision history for this message
Jimmy (jimmyattime) said :
#2

Hi Redbaron,

How does your carbon.conf file look like to get the multiple carbon-caches to run on the same server? I tried a few configurations but only 1 cache starts up and listens on the default port 2003.

Revision history for this message
Michael Leinartas (mleinartas) said :
#3

There's a section in the example carbon.conf that gives how to do this:

# To configure special settings for the 'foo' carbon-cache instance, uncomment this:
#[cache:foo]
#LINE_RECEIVER_PORT = 2103
#PICKLE_RECEIVER_PORT = 2104
#CACHE_QUERY_PORT = 7102
# and any other settings you want to customize, defaults are inherited
# from [carbon] section.

The default instance is instance 'a', so for an additional instance you can add
[cache:b]
and override the ports of the receivers so that they dont conflict.

You can then manage the individual instances like so:
carbon-cache.py --instance=a start
carbon-cache.py --instance=b start

or manage both at once by not specifying an instance.

Revision history for this message
Michael Leinartas (mleinartas) said :
#4

A correction to my earlier post:
if an instance is not specified *only* the 'a' instance will be affected. For other instances, you must specify the --instance parameter.

Can you help with this problem?

Provide an answer of your own, or ask redbaron for more information if necessary.

To post a message you must log in.