← Back to team overview

graphite-dev team mailing list archive

Re: [Question #107945]: High avalability

 

Question #107945 on Graphite changed:
https://answers.launchpad.net/graphite/+question/107945

    Status: Open => Answered

chrismd proposed the following answer:
My apologies for the delay in getting back to you Miquel. I took a break
from Graphite for the past couple weeks :)

The documentation is quite lacking right now so I will do my best to sum
up the HA setup process here.

The first step is to setup two functioning Graphite installations on two
different servers (or however many you have). It is important they they
share the same database so you will need to setup a Mysql or Postgres DB
and configure all the Graphite instances to use it. That is documented
in the INSTALL file, and in the comments of local_settings.py.example.
Also you should run a carbon-cache.py instance on each graphite server.

Then, to cluster the webapps you simply define the CLUSTER_SERVERS list
in your local_settings.py file on each server. It should be a list of
all the other servers in your cluster. What this does is cause the
webapp to distribute queries to its peers when users are browsing the
metric hierarchy or requesting graphs or data. If you have metric1
stored on server1 and metric2 stored on server2, you should see both
metric1 and metric2 in the hierarchy when browsing either server, and
you should be able to draw both metrics in one graph, basically it
should feel like one big honkin' graphite server when in fact it is
many.

The other part of this process though is to distribute the data to your
graphite servers. The simplest way would be to simply have half your
clients send data to one server, and half to the other, but sometimes a
more sophisticated approach than this is needed. There is a program
called carbon-relay that essentially routes your datapoints based on a
set of rules (defined in $GRAPHITE_ROOT/conf/relay-rules.conf file). You
can run carbon-relay wherever (doesn't have to be on the graphite
servers), and you can have all of your datapoints sent directly to it.
For real HA you can run multiple carbon-relays behind a VIP as long as
they all have identical relay-rules.conf files. Anyways, the relay-rules
allows you to say "metric names that match this regex go to this set of
servers" or "metric names on this pre-defined list go to this set of
servers", etc. If you want your data to be highly available you should
make sure that it is sent to at least two servers. If one goes down the
data should still be available as long as it is present on another
server in the cluster.

I think that covers it, let me know if you run into any issues.

-- 
You received this question notification because you are a member of
graphite-dev, which is an answer contact for Graphite.