influxdb

Puppet module to manage InfluxDB 0.10 or 0.9 and its plugins like graphite or collectd

Olivier Hanesse

olivierHa

11,096 downloads

6,920 latest version

4.3 quality score

Version information

  • 0.5.0 (latest)
  • 0.4.2
  • 0.4.1
  • 0.4.0
  • 0.3.1
  • 0.3.0
  • 0.2.0
  • 0.1.1
  • 0.1.0
released Feb 5th 2016
This version is compatible with:
  • Puppet Enterprise >= 3.0.0 < 2015.3.0
  • Puppet >= 3.0.0 < 5.0.0
  • Debian
    ,
    RedHat

Start using this module

Documentation

olivierHa/influxdb — version 0.5.0 Feb 5th 2016

Build Status

####Table of Contents

  1. Overview
  2. Module Description - What the module does and why it is useful
  3. Setup - The basics of getting started with influxdb
  4. Usage - Configuration options and additional functionality
  5. Reference - An under-the-hood peek at what the module is doing and how
  6. Limitations - OS compatibility, etc.
  7. 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

influxdb_database { 'graphite':
  ensure  => 'present',
}

influxdb_retention_policy

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)

Contributing

Please report bugs and feature request using GitHub issue tracker

##Development

  • rspec and beaker tests
  • authentication/authorization for provider