Code Monkey home page Code Monkey logo

puppet-influxdb's Introduction

puppet-influxdb

License

  1. Overview
  2. Description
  3. Setup
  4. Usage
  5. Limitations
  6. Development
  7. Miscellaneous

Overview

InfluxDB is a time-series database built from the ground up to handle high write & query loads. InfluxDB is a custom high performance datastore written specifically for timestamped data, including DevOps monitoring, application metrics, IoT sensor data, & real-time analytics. Conserve space on your machine by configuring InfluxDB to keep data for a defined length of time, automatically expiring & deleting any unwanted data from the system. InfluxDB also offers a SQL-like query language for interacting with data.

influxdata.com

Description

Puppet module to install, deploy and configure InfluxDB.

Setup

Copy this module in your modules folder without puppet- in the name.

or

puppet module install vpgrp-influxdb

Usage

class { 'influxdb': }

Limitations

So far, this is compatible with Debian, RedHat, and other derivatives.

Development

Please read carefully CONTRIBUTING.md before making a merge request.

Miscellaneous

    ╚⊙ ⊙╝
  ╚═(███)═╝
 ╚═(███)═╝
╚═(███)═╝
 ╚═(███)═╝
  ╚═(███)═╝
   ╚═(███)═╝

puppet-influxdb's People

Contributors

aba-rechsteiner avatar anthonysomerset avatar axxelg avatar camskkz avatar damoun avatar duncangibb avatar ekohl avatar jimirocks avatar rockyluke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

puppet-influxdb's Issues

Incorrect resource ordering / dependency

Hi

I get this when creating database with the module:

Error: /Stage[main]/Main/Influxdb::Database[librenms]/Exec[create_database_librenms]: Could not evaluate: Could not find command 'influx'

Works in second run though.

Puppet looks like this:

class { 'influxdb': }

influxdb::database { 'librenms':
  ensure  => present,
}

I tried adding a require on the database for the class, but I got the same result, so I'm probably missing some resource that isn't explicitly referred to here.

InfluxdDB fails to start due to bad graphite configuration when graphite is configured

I tried out the current git revision to enable https, but the module failed to start InfluxDB due to a misconfiguration with graphite:

class { 'influxdb':
  admin_enable   => true,
  admin_username => $influxdb_admin_username,
  admin_password => $influxdb_admin_password,
  domain_name    => 'whatever', # affects ssl cert paths
  https_enable   => true
}

Logs:

-- Logs begin at Tue 2019-09-10 08:45:40 UTC, end at Tue 2019-09-10 10:45:40 UTC. --
Sep 10 09:00:39 hostdata-01 systemd[1]: Started InfluxDB is an open-source, distributed, time series database.
Sep 10 09:00:40 hostdata-01 influxd[18551]: run: invalid graphite config: no measurement in template `server`. To generate a valid configuration file run `influxd config > influxdb.generated.conf`
Sep 10 09:00:40 hostdata-01 systemd[1]: influxdb.service: Main process exited, code=exited, status=1/FAILURE
Sep 10 09:00:40 hostdata-01 systemd[1]: influxdb.service: Failed with result 'exit-code'.
Sep 10 09:00:41 hostdata-01 systemd[1]: influxdb.service: Service hold-off time over, scheduling restart.
Sep 10 09:00:41 hostdata-01 systemd[1]: influxdb.service: Scheduled restart job, restart counter is at 1.
Sep 10 09:00:41 hostdata-01 systemd[1]: Stopped InfluxDB is an open-source, distributed, time series database.

Removing the [[graphite]] section in influxdb.conf makes the service work.

Puppet 8x compatibility

Hi,
Would it be possible to make the module compatible with Puppet 8x ?

For example, currently :

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Unknown variable: '::operatingsystem'. (file: /etc/puppetlabs/code/environments/flp_puppet8/modules/influxdb/manifests/params.pp, line: 37, column: 8) on node cladev-ubu2004.adm.fr.clara.net
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

Thanks.

InfluxDB 1.7.7 won't start without graphite

I use no graphite. But even this module generates graphite-enabled=false the influxdb considers the config beeing invalid and won't start.

I use master branch of the module

Bug: data cache param values should be in double quotes

The 2020-03-13 merge of 5bdf872 adds support for changing TSM engine settings. The values of these settings should be in double quotes in the templated config in case they use suffixes (k, m, g for *-memory-size; m, h for *-duration).

This bug is reproducible in the default config (tested on Ubuntu 18.04): influxd fails to start with log message "run: parse config: Near line 76 (last key parsed 'data'): expected a top-level item to end with a newline, comment, or EOF, but got 'm' instead". Line 76 is

cache-snapshot-write-cold-duration = 10m

Changing that to

cache-snapshot-write-cold-duration = "10m"

fixes the problem.

I have a trivial patch to do this for all four relevant settings, which I will commit tagged to this issue and open a PR for shortly.

Installation is failing on fresh Debian Buster installation

Error: Error: /Stage[main]/Influxdb/Exec[wait_for_influxdb_to_listen]: Could not evaluate: Could not find command 'influx'

Verified that the command is not there

 # dpkg -L influxdb | grep influx
 /etc/influxdb
 /etc/influxdb/influxdb.conf
 /etc/init.d/influxdb
 /etc/logrotate.d/influxdb
 /lib/systemd/system/influxdb.service
 /usr/bin/influxd
 /usr/share/doc/influxdb
 /usr/share/doc/influxdb/NEWS.Debian.gz
 /usr/share/doc/influxdb/changelog.Debian.amd64.gz
 /usr/share/doc/influxdb/changelog.Debian.gz
 /usr/share/doc/influxdb/changelog.gz
/usr/share/doc/influxdb/copyright
/usr/share/man/man8/influxd.8.gz
/var/lib/influxdb
/var/log/influxdb

It seems like the version from the Debian repo was installed and not that from the Influx repo.

# apt policy influxdb
influxdb:
  Installed: 1.6.4-1+b22
  Candidate: 1.8.3-1
  Version table:
     1.8.3-1 500
        500 https://repos.influxdata.com/debian buster/stable amd64 Packages
 *** 1.6.4-1+b22 500
        500 http://ftp.stratoserver.net/pub/linux/debian buster/main amd64 Packages
        100 /var/lib/dpkg/status

After upgrading the influx package wiht # apt upgrade everything looks good:

Notice: /Stage[main]/Influxdb/Exec[wait_for_influxdb_to_listen]/returns: executed successfully

There is notify => Exec['apt_update'] in place so it looks like notify and/or Exec are not blocking the require => Class['influxdb::repos'], for package { $package_names:... in init.pp so InfluxDB is installed before the packages in the Influx repo are known to apt.

I haven't found a proper solution for this. I will submit a MR but it is ugly by all means and I hesitated to even upload it. Maybe somebody can come up with a better approach.

Feature Request: Retention Policies

Would it be possible to add a resource for creating influxdb retention policies?

Ansible has an influxdb_retention_policy module that has this functionality.

I'm currently using this module to setup a Telegraf database for system metrics, but I'm concerned the database will fill the disk after enough time passes.

Need to updateapt source before installing

It is possible to end up with an old version of influxdb on debian/ubuntu if an apt update isn't run between adding the repo and installing the package. This is quite common actually.

I had a quick look around and the puppet telegraf module fixes this by adding:

    Class['apt::update'] -> Package[$telegraf::package_name]

Right after defining the apt::source resource.

Dependency compatibility

The dependencies for this module require an outdated version of puppetlabs/apt ( >= 4.5.1 <= 7.1.0), making it difficult to install since the current version is 7.6.0

Wrong debian release name in /etc/apt/sources.list.d/influxdb.list

This module (v1.5.0) creates a /etc/apt/sources.list.d/influxdb.list with a hard-coded release name 'buster' even though my machine is running 'bullseye':

cat influxdb.list
# This file is managed by Puppet. DO NOT EDIT.
# influxdb
deb https://repos.influxdata.com/debian buster stable

Instead of hard-coding the value I think you should use e.g. $::lsbdistcodename
(In my opinion this is also better than using 'stable')

Also:
If you browse to https://repos.influxdata.com/debian/ you see instructions to generate a trusted gpg key to go with the apt source.

Also:
The hard-coded apt source is missing the 'main' dir:
deb https://repos.influxdata.com/debian buster stable
should look like this:
deb https://repos.influxdata.com/debian <release> main

Also:
The current version (v1.5.0) seem to try to install an old gpg key (05CE15085FC09D18E99EFB22684A14CF2582E0C5) and it also use the deprecated 'apt-key' command.
Error: Execution of '/usr/bin/apt-key adv --no-tty --keyserver keyserver.ubuntu.com --recv-keys 05CE15085FC09D18E99EFB22684A14CF2582E0C5' returned 2: Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead
The module should install the new key directly to /etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg

Unable to enable socket connections

unix-socket-enabled is not configurable. It's a fixed setting commented out in influxdb.conf.erb

  # Enable http service over unix domain socket
  # unix-socket-enabled = false

MR will follow but there is a related topic to discuss. The default setting for http_bind_socket is /var/run/influxdb.sock This is the same default influxdb itself uses, but it is not working for most installations. Usually the influxdb user cannot write to /var/run/ so fails to create the socket and exits with run: open server: open service: listen unix /var/run/influxdb.sock: bind: permission denied

I doubt that influxdb would accept a braking change to change the default. Because this puppet module did not support sockets so far, this could be changed here without breaking existing installations.

This is a decision of keeping defaults consistent vs. providing working defaults. What is your opinion?

This module autorequires puppetlabs/apt 4.5.1

Since you have a Puppetfile tools like librarian-puppet will try to force-install stdlib 4.25.0 and apt 4.5.1 even though in the metadata.json is says otherwise. This breaks our deployment.

No access to private key

By default in this module InfluxDB runs as the user influxDB. If you enable HTTPS and set the private key using your company's domain name (which is required with the template influxdb.conf.erb with the following line) then the key has to be in /etc/ssl/private/ which by default only root can access.
https-private-key = "/etc/ssl/private/<%= @domain_name %>.key"

I think the best option would be to add a new parameter that is a full path to the private key so users can set a private key that influxdb can access and then change the template line to something like
https-private-key = "<%= @ssl_private_key %>"

install fails due to include_src option

Installing this module fails when using a modern puppetlabs/apt module since the include_src option changed syntax. I removed the option in my installation since a new apt module also defaults to false.

Not sure what version you want to target of puppetlabs/apt. The current "version_requirement": ">= 1.5.0 <= 7.0.0" in metadata.json is confusing since the latest released version is only 4.5.1.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.