Tested with Travis CI
- Overview
- Module Description - What the module does and why it is useful
- Setup - The basics of getting started with graphite
- Usage - Configuration options and additional functionality
- Reference - An under-the-hood peek at what the module is doing and how
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
This module manages both the Graphite Django-based web frontend and/or the lighter API frontend.
This module installs the relevant frontend packages, configures them and optionally enables LDAP authentication and/or caching via Memcached or Redis where possible. It also manages running the frontend either directly as a standalone service or through a webserver such as Apache.
If running on Puppet 3.x you will need to have the future parser enabled. On RHEL/CentOS platforms you will need to enable the EPEL repository first.
- The package(s) providing the Graphite web software.
- The
/etc/graphite-web/local_settings.pyconfiguration file. - Creating the database schema.
- Generating a basic Apache virtual host configuration.
- The package(s) providing the Graphite API software.
- The
/etc/graphite-api.yamlconfiguraton file. - The service controlling the running of Graphite API as a daemon.
class { '::graphite::web':
secret_key => 'mysecretkey',
}
# or
include ::graphite::apiParameters within graphite::api:
IP address to listen on, defaults to 127.0.0.1.
An array of allowed host header values. Builds the allowed_origins setting.
An array of hashes for each carbon instance. Hash must contain host
and port keys and optionally an instance key. Builds the carbon.hosts
setting.
Maps to the carbon.carbon_prefix setting.
Maps to the carbon.retry_delay setting.
Maps to the carbon.timeout setting.
Defaults to /etc/graphite-api.yaml.
Group to run as, defaults to graphite-api.
The package name to install.
Port to listen on, defaults to 8888.
Maps to the render_errors setting.
Maps to the carbon.replicaton_factor setting.
The name of the service, defaults to graphite-api.
Path to the state directory, defaults to /var/lib/graphite-api.
Maps to the time_zone setting.
User to run as, defaults to graphite-api.
Maps to the whisper.directories setting.
Number of workers to run, defaults to 4.
Parameters within graphite::api::memcached:
An array of hashes for each memcached server. Hash must contain host and
port keys.
Defaults to graphite-api.
Defauls to 60.
Parameters within graphite::api::redis:
Redis hostname.
Redis database number, defaults to 0.
Defaults to graphite-api.
The package name of the Redis support package to install.
Optional Redis password.
Redis port, defauls to 6379.
Defaults to 60.
Parameters within graphite::web:
Maps to the SECRET_KEY setting.
An array of allowed host header values. Builds the ALLOWED_HOSTS setting.
A hash of Apache resources to create, each key should be an Apache defined type with the value being a further hash where each key is the title and the value is the resource attributes.
An array of hashes for each carbon instance. Hash must contain host
and port keys and optionally an instance key. Builds the
CARBONLINK_HOSTS setting.
Maps to the CARBONLINK_QUERY_BULK setting.
Maps to the CARBONLINK_TIMEOUT setting.
An array of hashes for each remote web instance. Hash must contain host key
and optionally a port key. Builds the CLUSTER_SERVERS setting.
Maps to the CONF_DIR setting. Also used as the path for the various
configuration files.
Hash of hashes for the database settings. Only key supported is default and
the child hash must contain name and engine keys and optionally user,
password, host and port keys. Builds the DATABASES setting.
Maps to the DEBUG setting.
Maps to the DEFAULT_CACHE_DURATION setting.
Maps to the DOCUMENTATION_URL setting.
Maps to the FLUSHRRDCACHED setting.
Maps to the GRAPHITE_ROOT setting. Defaults to /usr/share/graphite.
Only apache is currently supported.
Maps to the LOG_CACHE_PERFORMANCE setting.
Maps to the LOG_DIR setting.
Maps to the LOG_METRIC_ACCESS setting.
Maps to the LOG_RENDERING_PERFORMANCE setting.
An array of hashes for each memcached server. Hash must contain host and
port keys. Builds the MEMCACHE_HOSTS setting.
The name of the package to install.
Maps to the REMOTE_FIND_CACHE_DURATION setting.
Maps to the REMOTE_PREFETCH_DATA setting.
Maps to the REMOTE_RENDERING setting.
Maps to the REMOTE_RENDER_CONNECT_TIMEOUT setting.
Maps to the REMOTE_STORE_FETCH_TIMEOUT setting.
Maps to the REMOTE_STORE_FIND_TIMEOUT setting.
Maps to the REMOTE_STORE_MERGE_RESULTS setting.
Maps to the REMOTE_STORE_RETRY_DELAY setting.
Maps to the REMOTE_STORE_USE_POST setting.
An array of hashes for each remote web instance. Hash must contain host key
and optionally a port key. Builds the RENDERING_HOSTS setting.
Maps to the RRD_DIR setting. Defaults to ${storage_dir}/rrd.
Maps to the STORAGE_DIR setting. Defaults to /var/lib/carbon.
Maps to the TIME_ZONE setting.
Maps to the WHISPER_DIR setting. Defaults to ${storage_dir}/whisper.
Parameters within graphite::web::ldap:
Maps to the LDAP_URI setting.
Maps to the LDAP_SEARCH_BASE setting.
Maps to the LDAP_BASE_USER setting.
Maps to the LDAP_BASE_PASS setting.
Maps to the LDAP_USER_QUERY setting.
The name of the LDAP support package to install.
Install Graphite API in front of a single carbon cache instance:
include ::carbon
class { '::graphite::api':
carbon_hosts => [
{
'host' => '127.0.0.1',
'port' => 7002,
},
],
require => Class['::carbon'],
}Extend the above to include a Memcached caching layer:
include ::carbon
include ::memcached
class { '::graphite::api':
carbon_hosts => [
{
'host' => '127.0.0.1',
'port' => 7002,
},
],
require => Class['::carbon'],
}
class { '::graphite::api::memcached':
servers => [
{
'host' => '127.0.0.1',
'port' => 11211,
},
],
require => Class['::memcached'],
}Use Redis instead:
include ::carbon
include ::redis
class { '::graphite::api':
carbon_hosts => [
{
'host' => '127.0.0.1',
'port' => 7002,
},
],
require => Class['::carbon'],
}
class { '::graphite::api::redis':
host => '127.0.0.1',
require => Class['::redis'],
}Install Graphite web in front of a single carbon cache instance with Memcached caching enabled:
include ::carbon
include ::memcached
class { '::apache':
default_confd_files => false,
default_mods => false,
default_vhost => false,
}
class { '::graphite::web':
secret_key => 'abc123',
carbonlink_hosts => [
{
'host' => '127.0.0.1',
'port' => 7002,
},
],
memcache_hosts => [
{
'host' => '127.0.0.1',
'port' => 11211,
},
],
require => Class['::carbon'],
}Extend the above to also configure LDAP authentication:
include ::openldap
include ::openldap::client
class { '::openldap::server':
root_dn => 'cn=Manager,dc=example,dc=com',
root_password => 'secret',
suffix => 'dc=example,dc=com',
access => [
'to attrs=userPassword by self =xw by anonymous auth',
'to * by dn.base="gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth" manage by users read',
],
ldap_interfaces => ['127.0.0.1'],
local_ssf => 256,
}
::openldap::server::schema { 'cosine':
position => 1,
}
::openldap::server::schema { 'inetorgperson':
position => 2,
}
::openldap::server::schema { 'nis':
position => 3,
}
include ::carbon
include ::memcached
class { '::apache':
default_confd_files => false,
default_mods => false,
default_vhost => false,
}
class { '::graphite::web':
secret_key => 'abc123',
carbonlink_hosts => [
{
'host' => '127.0.0.1',
'port' => 7002,
},
],
memcache_hosts => [
{
'host' => '127.0.0.1',
'port' => 11211,
},
],
require => Class['::carbon'],
}
class { '::graphite::web::ldap':
bind_dn => 'cn=Manager,dc=example,dc=com',
bind_password => 'secret',
search_base => 'dc=example,dc=com',
search_filter => '(uid=%s)',
uri => 'ldap://127.0.0.1',
require => Class['::openldap::server'],
}graphite::api: Main class for managing the Carbon daemons.graphite::api::memcached: Main class for managing the Carbon daemons.graphite::api::redis: Main class for managing the Carbon daemons.graphite::web: Main class for managing the Carbon daemons.graphite::web::ldap: Main class for managing the Carbon daemons.
graphite::params: Different configuration data for different systems.graphite::api::install: Handles Graphite API installation.graphite::api::config: Handles Graphite API configuration.graphite::api::params: Different configuration data for different systems.graphite::api::service: Handles running the Graphite API service.graphite::api::memcached::install: Installs the Memcached support.graphite::api::memcached::config: Handles configuring Memcached caching.graphite::api::redis::install: Installs the Redis support.graphite::api::redis::config: Handles configuring Redis caching.graphite::web::install: Handles Graphite web installation.graphite::web::config: Handles Graphite web configuration.graphite::web::params: Different configuration data for different systems.graphite::web::ldap::install: Installs the LDAP support.graphite::web::ldap::config: Handles configuring LDAP authentication.
This module intentionally doesn't manage the Carbon daemons, see my other module which does that.
This module has been built on and tested against Puppet 3.0 and higher.
The module has been tested on:
- RedHat/CentOS Enterprise Linux 7
Testing on other platforms has been light and cannot be guaranteed.
Please log issues or pull requests at github.