Edit the config file `/opt/graphite/conf/carbon.conf`, find line `ENABLE_UPD_LISTENER` and
change this setting to `True`.
### Configure storage-schemas.conf
Create a new file at `/opt/graphite/conf/storage-schemas.conf` with the following content:
```
[carbon]
pattern = ^carbon\..*
retentions = 1m:30d,10m:1y,1h:5y
[default]
pattern = .*
retentions = 10s:1d,1m:7d,10m:1y
```
This config specifies the resolution of metrics and the retention periods. For example for all metrics begining with the word `carbon` receive metrics every minute and store for 30 days, then
roll them up into 10 minute buckets and store those for 1 year, then roll those up into 1 hour buckets and store those for 5 years. For all other metrics
the default rule will be applied with other retention periods.
This configuration is very important, as the first retention period must match the rate of which you send metrics. The default rule has 10 seconds
as its first resolution so when configuring StatsD we should configure it to send metrics every 10 seconds.
> If you send values more frequently than the highest resolution, for example if you send data every second but
> the storage schema rules defines the highest resolution to be 10 seconds, then the values you send will just
> overwrite each other and the last value sent during every 10 second period will be saved. StatsD can work around this
You do not really need to change the default config, but is very important to
understand what the config controls and what implications that it has. Graphite
does rollups as part of the metric ingestion according to the rules defined in
`storage-schemas.conf`. For example, given storage schema rule `10s:1d,1m:7d`,
when aggregating 6 values (each representing 10 seconds) into a 1min bucket graphite
will use an `aggregationMethod` like for example `average`. What method to use
will be determined by the rules specified in `storage-aggregation.conf`.
The default rules all look at the metric path ending. Does it end with `.count` then use `sum` when doing rollups, does it end with `max` then use `max` function, and if it does not
end with max, min or count then use average. This means that naming metrics is very important! But don't worry if you use StatsD it will send the correct names to graphite.
### Start carbon
Lets install supervisord and let it start carbon.
`apt-get install supervisor`
Create a new file in `/etc/supervisor/conf.d/carbon.conf` with the following: