####Table of Contents
- Overview
- Module Description - What the module does and why it is useful
- Setup - The basics of getting started with influxdb
- 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
##Overview
The influxdb module lets you use Puppet to install, configure, and manage Influxdb version 0.10.x and 0.9.x The current InfluxDB version is 0.10
##Module Description
InfluxDB is a Open source distributed time series, events, and metrics database. This module handles the installation and every configuration parameters.
Support for Puppet 3.x and Puppet 4.x
##Setup
###Beginning with influxdb
To install InfluxDB with the default parameters
class { 'influxdb': }
###What influxdb affects
- influxdb package.
- influxdb configuration file.
- influxdb service.
##Usage
To enable Graphite plugin :
class { 'influxdb':
graphite => {
main => {
enabled => true,
}
}
}
With InfluxDB, you can configure several graphite backends.
####A more complex example
class { 'influxdb':
graphite => {
main => {
enabled => true,
database => 'mygraphitedb',
batch_size => 500,
tags => ['region=us-east', 'zone=1c'],
templates => [
"servers.* .host.measurement*",
"stats.* .host.measurement* region=us-west,agent=sensu",
]
},
udp => {
enabled => true,
bind-address => ':20003',
protocol => 'udp',
}
}
}
To enable Collectd plugin:
class { 'influxdb':
collectd => {
enabled => true,
}
}
####Hiera example
influxdb::package_ensure: 'latest'
influxdb::graphite:
main:
enabled: true
batch_size: 3
influxdb::data:
dir: '/mnt/influxdb/data'
##Reference
###Classes
####Public Classes
influxdb
: Guides the basic setup of InfluxDB.
####Private Classes
influxdb::install
: Installs InfluxDB packages.influxdb::config
: Configures InfluxDB.influxdb::params
: Manages InfluxDB parameters.influxdb::service
: Manages the InfluxDB daemon.
###Parameters
As InfluxDB is moving quickly, this module has a "dynamic" structure. Each section of the Influxdb configuration file is mapped to a hash. So you can easily add/remove new parameters as the influxdb software evolves, without change this module.
####Section Hashes
Each config file section accepts a hash of values. Defaults are set in params.pp
Here are the default values for the meta section :
$meta = {
dir => '/var/lib/influxdb/meta',
hostname => 'localhost',
bind-address => ':8088',
retention-autocreate => true,
election-timeout => '1s',
heartbeat-timeout => '1s',
leader-lease-timeout => '500ms',
commit-timeout => '50ms',
cluster-tracing => false,
raft-promotion-enabled => true,
logging-enabled => true,
}
####package_ensure
Choose whether to install or uninstall, or force to the latest version. Default: present
####manage_repo
Choose whether to configure influxdb repositories. Default: true
####config_file
Full path to config file (e.g. /etc/influxdb/influxdb.conf). Defaults to "/etc/influxdb/influxdb.conf"
####influxdb_user
Ownership of influxdb directories. (Don't set user that will run influxdb ... yet) Default: 'influxdb'
####influxdb_group
Group of influxdb directories. Default: 'influxdb'
####conf_template
Specify template to use for influxdb conf file. Defaults to "influxdb/influxdb.conf.erb"
###Defined Types
influxdb_database { 'graphite':
ensure => 'present',
}
influxdb_retention_policy
creates retention policy on databases.
To use it you must create the title of the resource as shown below,
following the pattern of policy_name@database
:
influxdb_retention_policy { '1w@graphite':
ensure => present,
database => 'graphite',
duration => '1w',
is_default => true,
replication => '1',
}
##Limitations
This module has been tested on:
- Debian 7 Wheezy
- Debian 8 Jessie
It should also work on Debian-based OS (Ubuntu) and RedHat osfamily
This module is fully compatible with Puppet 3.x and Puppet 4.x
Providers work without authentication/authorization (work in progress)
Please report bugs and feature request using GitHub issue tracker
##Development
- rspec and beaker tests
- authentication/authorization for provider