Tuesday, April 21, 2015

Multiple instance for carbon to leverage the traffic

hi,

if you are keen to leverage your carbon traffics, or may be you wish to categorise the metrics from the different sources. Then, you can follow these steps.

1. The configuration file is /opt/graphite/conf/carbon.conf

2. Please look closely at line until you see this. please uncomment them when you need to spawn another carbon instance.

# To configure special settings for the carbon-cache instance 'b', uncomment this:
[cache:b]
LINE_RECEIVER_PORT = 2103
PICKLE_RECEIVER_PORT = 2104
CACHE_QUERY_PORT = 7102

3. Make sure disable the UDP_LISTENER.
# Set this to True to enable the UDP listener. By default this is off
# because it is very common to run multiple carbon daemons and managing
# another (rarely used) port for every carbon instance is not fun.
ENABLE_UDP_LISTENER = False
UDP_RECEIVER_INTERFACE = 0.0.0.0
UDP_RECEIVER_PORT = 2003

4. Once you are done. you need to top up the daemon file like this.

start() {
        echo -n $"Starting $prog: "

        PYTHONPATH=/usr/local/lib/python2.6/dist-packages/ /opt/graphite/bin/carbon-cache.py --instance=a start
        PYTHONPATH=/usr/local/lib/python2.6/dist-packages/ /opt/graphite/bin/carbon-cache.py --instance=b start
        RETVAL=$?
.
.
.
stop() {
        echo -n $"Stopping $prog: "

        PYTHONPATH=/usr/local/lib/python2.6/dist-packages/ /opt/graphite/bin/carbon-cache.py --instance=a stop > /dev/null 2>&1
        PYTHONPATH=/usr/local/lib/python2.6/dist-packages/ /opt/graphite/bin/carbon-cache.py --instance=b stop > /dev/null 2>&1
.
.
.
status()

No comments: