Enable snapshots for InfluxDB

This change allows the operator to backup the InfluxDB database using
the 'influxd backup' command.

Change-Id: Id23eb027de719b5f4fb44cac39d5eaf3dc8ae775
This commit is contained in:
Simon Pasquier
2016-02-10 10:23:29 +01:00
parent 948dcec103
commit ce33016637
5 changed files with 13 additions and 0 deletions

View File

@@ -22,6 +22,7 @@ class influxdb::configure (
$meta_dir = undef,
$wal_dir = undef,
$hh_dir = undef,
$snapshot = undef,
) {
Ini_setting {
@@ -83,4 +84,10 @@ class influxdb::configure (
setting => 'dir',
value => "\"${meta_dir}\"",
}
ini_setting { 'snapshot':
section => 'snapshot',
setting => 'enabled',
value => $snapshot,
}
}

View File

@@ -19,6 +19,7 @@ class influxdb (
$hh_dir = $influxdb::params::hh_dir,
$meta_dir = $influxdb::params::meta_dir,
$wal_dir = $influxdb::params::wal_dir,
$snapshot = $influxdb::params::snapshot,
$hostname = undef,
$raft_nodes = undef,
) inherits influxdb::params {
@@ -39,6 +40,7 @@ class influxdb (
hh_dir => $hh_dir,
meta_dir => $meta_dir,
wal_dir => $wal_dir,
snapshot => $snapshot,
notify => Class['influxdb::service'],
}
}

View File

@@ -24,4 +24,6 @@ class influxdb::params {
$hh_dir = "${base_dir}/hh"
$meta_dir = "${base_dir}/meta"
$wal_dir = "${base_dir}/wal"
$snapshot = false
}

View File

@@ -26,5 +26,6 @@ describe 'influxdb::configure' do
it { is_expected.to contain_ini_setting('wal_dir') }
it { is_expected.to contain_ini_setting('hh_dir') }
it { is_expected.to contain_ini_setting('meta_dir') }
it { is_expected.to contain_ini_setting('snapshot') }
end
end

View File

@@ -29,6 +29,7 @@ class lma_monitoring_analytics::influxdb (
meta_dir => "${base_directory}/meta",
hh_dir => "${base_directory}/hh",
wal_dir => "${base_directory}/wal",
snapshot => true,
hostname => $hostname,
raft_nodes => $raft_nodes,
}