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:
@@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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'],
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,4 +24,6 @@ class influxdb::params {
|
||||
$hh_dir = "${base_dir}/hh"
|
||||
$meta_dir = "${base_dir}/meta"
|
||||
$wal_dir = "${base_dir}/wal"
|
||||
|
||||
$snapshot = false
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user