This module installs and makes basic configs for graphite, with carbon and whisper.
RHEL/CentOS/Scientific 6+ Debian 6+ Ubunutu 10.04 and newer
Configure conf files as you need:
Only if you want to use carbon-link clusters or ldap you should edit:
templates/opt/graphite/webapp/graphite/local_settings.py.erb
stdlib by puppetlabs
facter > 1.6.2 puppet > 2.6.2
On Redhat distributions you need the EPEL or RPMforge repository, because Graphite needs packages, which are not part of the default repos.
The descriptions are short and their are more variables to tweak your graphite if needed. For further information take a look at the file templates/opt/graphite/conf/carbon.conf.erb
Parameter | Default | Description |
---|---|---|
gr_user | its empty | The user who runs graphite. If this is empty carbon runs as the user that invokes it. |
gr_max_cache_size | inf | Limit the size of the cache to avoid swapping or becoming CPU bound. Use the value "inf" (infinity) for an unlimited cache size. |
gr_max_updates_per_second | 500 | Limits the number of whisper update_many() calls per second, which effectively means the number of write requests sent to the disk. |
gr_max_creates_per_minute | 50 | Softly limits the number of whisper files that get created each minute. |
gr_carbon_metric_interval | 60 | Set the interval between sending internal performance metrics; affects all carbon daemons. |
gr_line_receiver_interface | 0.0.0.0 | Interface the line receiver listens |
gr_line_receiver_port | 2003 | Port of line receiver |
gr_enable_udp_listener | False | Set this to True to enable the UDP listener. |
gr_udp_receiver_interface | 0.0.0.0 | Its clear, isnt it? |
gr_udp_receiver_port | 2003 | Self explaining |
gr_pickle_receiver_interface | 0.0.0.0 | Pickle is a special receiver who handle tuples of data. |
gr_pickle_receiver_port | 2004 | Self explaining |
gr_use_insecure_unpickler | False | Set this to True to revert to the old-fashioned insecure unpickler. |
gr_cache_query_interface | 0.0.0.0 | Interface to send cache queries to. |
gr_cache_query_port | 7002 | Self explaining. |
gr_timezone | GMT | Timezone for graphite to be used. |
gr_storage_schemas | [ { name => "default", pattern => ".*", retentions => "1s:30m,1m:1d,5m:2y" } ] | The storage schemas. |
gr_storage_aggregation_rules | { '00_min' => { pattern => '\.min$', factor => '0.1', method => 'min' }, '01_max' => { pattern => '\.max$', factor => '0.1', method => 'max' }, '02_sum' => { pattern => '\.count$', factor => '0.1', method => 'sum' }, '99_default_avg' => { pattern => '.*', factor => '0.5', method => 'average'} } | The storage aggregation rules |
gr_web_server | apache | The web server to use. Valid values are 'apache' and 'nginx'. 'nginx' is only supported on Debian-like systems. |
gr_web_servername | FQDN | Virtualhostname of Graphite webgui. |
gr_web_cors_allow_from_all | false | Include CORS Headers for all hosts (*) in web server config. |
gr_apache_port | 80 | The HTTP port apache will use. |
gr_apache_port_https | 443 | The HTTPS port apache will use. |
gr_django_1_4_or_less | false | Django settings style. |
gr_django_db_xxx | sqlite3 settings | Django database settings. (engine|name|user|password|host|port) |
gr_enable_carbon_aggregator | false | Enable the carbon aggregator daemon |
gr_aggregator_line_interface | '0.0.0.0' | address for line interface to listen on |
gr_aggregator_line_port | 2023 | TCP port for line interface to listen on |
gr_aggregator_pickle_interface | '0.0.0.0' | address for pickle interface |
gr_aggregator_pickle_port | 2024 | pickle port |
gr_aggregator_forward_all | 'True' | Forward all metrics to the destination(s) |
gr_aggregator_destinations | [ '127.0.0.1:2004' ] | array of backend carbons |
gr_aggregator_max_queue_size | 10000 | maximum queue size |
gr_aggregator_use_flow_control | 'True" | Enable flow control |
gr_aggregator_max_intervals | 5 | maximum # intervals to keep around |
gr_aggregator_rules | { 'carbon-class-mem' => 'carbon.all..memUsage (60) = sum carbon..*.memUsage', 'carbon-all-mem' => 'carbon.all.memUsage (60) = sum carbon.*.*.memUsage', } | array of carbon aggregation rules |
gr_memcache_enable | false | Enable / Disable memcache usage |
gr_memcache_hosts | "['127.0.0.1:11211']" | List of memcache hosts to use. |
secret_key | UNSAFE_DEFAULT | CHANGE IT! Secret used as salt for things like hashes, cookies, sessions etc. Has to be the same on all nodes of a graphite cluster. |
nginx_htpasswd | undef | The user and salted SHA-1 (SSHA) password for Nginx authentication. If set, Nginx will be configured to use HTTP Basic authentication with the given user & password. |
node "graphite.my.domain" { include graphite }
# This carbon cache will accept TCP and UDP datas and # the cachesize is limited to 256mb node "graphite.my.domain" { class {'graphite': gr_max_cache_size => 256, gr_enable_udp_listener => True } }
node "graphite.my.domain" { class { 'graphite': gr_django_db_engine => 'django.db.backends.mysql', gr_django_db_name => 'graphite', gr_django_db_user => 'graphite', gr_django_db_password => 'SECRET123', gr_django_db_host => 'mysql.my.domain', gr_django_db_port => 3306, gr_enable_carbon_aggregator => true, secret_key => 'ABCD1234', } }
The default puppet set up won't work if you have an existing web server in place. In my case this was Nginx. For me moving apache off to another port was good enough. To allow this you do
# Move apache to alternate HTTP/HTTPS ports: node "graphite.my.domain" { class {'graphite': gr_apache_port => 2080, gr_apache_port_https => 2443, } }