diff --git a/.fixtures.yml b/.fixtures.yml index 92436be..c73d620 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -1,7 +1,6 @@ --- fixtures: repositories: - inifile: https://github.com/puppetlabs/puppetlabs-inifile staging: https://github.com/nanliu/puppet-staging symlinks: influxdb: "#{source_dir}" diff --git a/.travis.yml b/.travis.yml index fb77a9e..9c29ca7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,15 +5,16 @@ branches: language: ruby rvm: - 2.0.0 +env: + - PUPPET_VERSION="3.2.4" + - PUPPET_VERSION="3.3.2" + - PUPPET_VERSION="3.4.3" + - PUPPET_VERSION="3.5.1" + - PUPPET_VERSION="3.6.2" + - PUPPET_VERSION="3.7.3" +sudo: false bundler_args: --without development script: bundle exec rake spec SPEC_OPTS='--format documentation' -env: - matrix: - - PUPPET_VERSION="2.7.25" - - PUPPET_VERSION="3.1.1" - - PUPPET_VERSION="3.2.4" - - PUPPET_VERSION="3.3.2" - - PUPPET_VERSION="3.4.2" notifications: email: - justin@downing.us diff --git a/Gemfile b/Gemfile index 373f09d..a39a37c 100644 --- a/Gemfile +++ b/Gemfile @@ -1,10 +1,10 @@ source 'https://rubygems.org' -puppetversion = ENV.key?('PUPPET_GEM_VERSION') ? "= #{ENV['PUPPET_GEM_VERSION']}" : ['>= 3.4'] - gem 'rake' gem 'librarian-puppet' -gem 'puppet', puppetversion -gem 'puppet-blacksmith' +gem 'metadata-json-lint' +gem 'puppet', ENV['PUPPET_VERSION'] || '~> 3.7.0' gem 'puppet-lint' +gem 'puppet-syntax' gem 'puppetlabs_spec_helper' +gem 'rspec-puppet', :git => 'https://github.com/rodjek/rspec-puppet.git' diff --git a/LICENSE b/LICENSE index 605f773..be6a607 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2014 Justin Downing +Copyright (c) 2014-2015 Justin Downing Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/Puppetfile b/Puppetfile index cb63748..f68c815 100644 --- a/Puppetfile +++ b/Puppetfile @@ -1,4 +1,3 @@ -forge 'http://forge.puppetlabs.com' +forge 'https://forgeapi.puppetlabs.com' -mod 'nanliu/staging', '>= 0.4.0' -mod 'puppetlabs/inifile', '>= 1.0.0' +metadata diff --git a/Puppetfile.lock b/Puppetfile.lock index 26b5799..cd90d24 100644 --- a/Puppetfile.lock +++ b/Puppetfile.lock @@ -1,10 +1,8 @@ FORGE - remote: http://forge.puppetlabs.com + remote: https://forgeapi.puppetlabs.com specs: - nanliu/staging (0.4.0) - puppetlabs/inifile (1.0.3) + nanliu-staging (0.4.0) DEPENDENCIES - nanliu/staging (>= 0.4.0) - puppetlabs/inifile (>= 1.0.0) + nanliu-staging (< 0.4.1, >= 0.4.0) diff --git a/README.md b/README.md index 7ff4bd8..f2448e0 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,33 @@ you have any ideas or contributions, feel free to open a pull request! Most of the configuration is parameterized, so you can freely adjust settings. +## Plugins + +InfluxDB ships with three input plugins. These can be configured from the Puppet module: + +#### collectd +``` +class { 'influxdb': + input_plugins_collectd => true +} +``` + +#### graphite +``` +class { 'influxdb': + input_plugins_graphite => true +} +``` + +#### udp +``` +class { 'influxdb': + input_plugins_udp => true +} +``` + +You can read more about the other input-plugins configuration options in [manifests/init.pp](https://github.com/justindowning/puppet-influxdb/blob/master/manifests/init.pp) and [templats/config.toml.erb](https://github.com/justindowning/puppet-influxdb/blob/master/templates/config.toml.erb). + ## Testing ``` diff --git a/Rakefile b/Rakefile index 0f572fd..a86124b 100644 --- a/Rakefile +++ b/Rakefile @@ -1,15 +1,16 @@ -require 'bundler' -Bundler.require(:rake) - require 'puppetlabs_spec_helper/rake_tasks' require 'puppet-lint/tasks/puppet-lint' -require 'puppet_blacksmith/rake_tasks' +require 'puppet-syntax/tasks/puppet-syntax' Rake::Task[:lint].clear PuppetLint::RakeTask.new :lint do |config| config.ignore_paths = ["modules/**/**/*.pp","pkg/**/**/*.pp"] config.log_format = '%{path}:%{linenumber}:%{KIND}: %{message}' - config.disable_checks = [ "80chars", 'autoloader_layout', 'class_inherits_from_params_class'] + config.disable_checks = [ 'autoloader_layout', 'class_inherits_from_params_class'] +end + +task :metadata do + sh "metadata-json-lint metadata.json" end -task :default => [:spec, :lint] +task :default => [ :syntax, :lint, :spec, :metadata ] diff --git a/Vagrantfile b/Vagrantfile index dc2442d..69211e5 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -6,8 +6,8 @@ Vagrant.configure("2") do |config| config.vm.synced_folder "modules", "/tmp/puppet-modules", type: "rsync", rsync__exclude: ".git/" config.vm.synced_folder ".", "/tmp/puppet-modules/influxdb", type: "rsync", rsync__exclude: ".git/" - config.vm.define "centos", primary: true do |centos| - centos.vm.box = "puppetlabs/centos-6.5-64-puppet" + config.vm.define "centos", autostart: false do |centos| + centos.vm.box = 'puppetlabs/centos-7.0-64-puppet' centos.vm.provision :puppet do |puppet| puppet.manifests_path = "tests" puppet.manifest_file = "vagrant.pp" @@ -15,8 +15,8 @@ Vagrant.configure("2") do |config| end end - config.vm.define "ubuntu", autostart: false do |ubuntu| - ubuntu.vm.box = "puppetlabs/ubuntu-14.04-64-puppet" + config.vm.define "ubuntu", primary: true do |ubuntu| + ubuntu.vm.box = 'puppetlabs/ubuntu-14.04-64-puppet' ubuntu.vm.provision :puppet do |puppet| puppet.manifests_path = "tests" puppet.manifest_file = "vagrant.pp" diff --git a/manifests/config.pp b/manifests/config.pp index ccc9147..a1e135d 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -1,213 +1,11 @@ # == Class: influxdb::config -# More information on these settings available at: http://influxdb.org/docs/configuration.html class influxdb::config { - ini_setting { 'hostname': - section => '', - setting => 'hostname', - value => "\"${influxdb::hostname}\"", - } - - ini_setting { 'bind_address': - section => '', - setting => 'bind-address', - value => "\"${influxdb::bind_address}\"", - } - - # [logging] - ini_setting { 'logging_level': - section => 'logging', - setting => 'level', - value => "\"${influxdb::logging_level}\"", - } - - ini_setting { 'logging_file': - section => 'logging', - setting => 'file', - value => "\"${influxdb::logging_file}\"", - } - - # [admin] - ini_setting { 'admin_port': - section => 'admin', - setting => 'port', - value => $influxdb::admin_port, - } - - ini_setting { 'admin_assets': - section => 'admin', - setting => 'assets', - value => "\"${influxdb::admin_assets}\"", - } - - # [api] - ini_setting { 'api_port': - section => 'api', - setting => 'port', - value => $influxdb::api_port, - } - - ini_setting { 'api_read_timeout': - section => 'api', - setting => 'read-timeout', - value => "\"${influxdb::api_read_timeout}\"", - } - - # [raft] - ini_setting { 'raft_port': - section => 'raft', - setting => 'port', - value => $influxdb::raft_port, - } - - ini_setting { 'raft_dir': - section => 'raft', - setting => 'dir', - value => "\"${influxdb::raft_dir}\"", - } - - ini_setting { 'raft_election_timeout': - section => 'raft', - setting => 'election-timeout', - value => "\"${influxdb::raft_election_timeout}\"", - } - - # [storage] - ini_setting { 'storage_dir': - section => 'storage', - setting => 'dir', - value => "\"${influxdb::storage_dir}\"", - } - - ini_setting { 'storage_write_buffer_size': - section => 'storage', - setting => 'write-buffer-size', - value => $influxdb::storage_write_buffer_size, - } - - # [cluster] - ini_setting { 'cluster_seed_servers': - section => 'cluster', - setting => 'seed-servers', - value => $influxdb::cluster_seed_servers, - } - - ini_setting { 'cluster_protobuf_port': - section => 'cluster', - setting => 'protobuf_port', - value => $influxdb::cluster_protobuf_port, - } - - ini_setting { 'cluster_protobuf_timeout': - section => 'cluster', - setting => 'protobuf_timeout', - value => "\"${influxdb::cluster_protobuf_timeout}\"", - } - - ini_setting { 'cluster_protobuf_heartbeat': - section => 'cluster', - setting => 'protobuf_heartbeat', - value => "\"${influxdb::cluster_protobuf_heartbeat}\"", - } - - ini_setting { 'cluster_protobuf_min_backoff': - section => 'cluster', - setting => 'protobuf_min_backoff', - value => "\"${influxdb::cluster_protobuf_min_backoff}\"", - } - - ini_setting { 'cluster_protobuf_max_backoff': - section => 'cluster', - setting => 'protobuf_max_backoff', - value => "\"${influxdb::cluster_protobuf_max_backoff}\"", - } - - ini_setting { 'cluster_write_buffer_size': - section => 'cluster', - setting => 'write-buffer-size', - value => $influxdb::cluster_write_buffer_size, - } - - ini_setting { 'cluster_max_response_buffer_size': - section => 'cluster', - setting => 'max-response-buffer-size', - value => $influxdb::cluster_max_response_buffer_size, - } - - ini_setting { 'cluster_concurrent_shard_query_limit': - section => 'cluster', - setting => 'concurrent-shard-query-limit', - value => $influxdb::cluster_concurrent_shard_query_limit, - } - - # [leveldb] - ini_setting { 'leveldb_max_open_files': - section => 'leveldb', - setting => 'max-open-files', - value => $influxdb::leveldb_max_open_files, - } - - ini_setting { 'leveldb_lru_cache_size': - section => 'leveldb', - setting => 'lru-cache-size', - value => "\"${influxdb::leveldb_lru_cache_size}\"", - } - - ini_setting { 'leveldb_max_open_shards': - section => 'leveldb', - setting => 'max-open-shards', - value => $influxdb::leveldb_max_open_shards, - } - - ini_setting { 'leveldb_point_batch_size': - section => 'leveldb', - setting => 'point-batch-size', - value => $influxdb::leveldb_point_batch_size, - } - - ini_setting { 'leveldb_point_write_size': - section => 'leveldb', - setting => 'point-write-size', - value => $influxdb::leveldb_point_write_size, - } - - # [sharding] - - # [wal] - ini_setting { 'wal_dir': - section => 'wal', - setting => 'dir', - value => "\"${influxdb::wal_dir}\"", - } - - ini_setting { 'wal_flush_after': - section => 'wal', - setting => 'flush-after', - value => $influxdb::wal_flush_after, - } - - ini_setting { 'wal_bookmark_after': - section => 'wal', - setting => 'bookmark-after', - value => $influxdb::wal_bookmark_after, - } - - ini_setting { 'wal_index_after': - section => 'wal', - setting => 'index-after', - value => $influxdb::wal_index_after, - } - - ini_setting { 'wal_requests_per_logfile': - section => 'wal', - setting => 'requests-per-logfile', - value => $influxdb::wal_requests_per_logfile, - } - - # defaults for all settings - Ini_setting { - ensure => present, - path => $influxdb::config_path, - notify => Service['influxdb'], - require => Package['influxdb'], + file { $influxdb::config_path: + content => template('influxdb/config.toml.erb'), + owner => 'influxdb', + group => 'influxdb', + mode => '0644', + require => Class['influxdb::install'], + notify => Class['influxdb::service'], } } diff --git a/manifests/init.pp b/manifests/init.pp index 929c9b4..5977e9c 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -4,20 +4,49 @@ $version = $influxdb::params::version, $install_from_repository = $influxdb::params::install_from_repository, $config_path = $influxdb::params::config_path, + $hostname = $influxdb::params::hostname, $bind_address = $influxdb::params::bind_address, + $reporting_disabled = $influxdb::params::reporting_disabled, + $authentication_enabled = $influxdb::params::authentication_enabled, + $logging_level = $influxdb::params::logging_level, $logging_file = $influxdb::params::logging_file, + $admin_port = $influxdb::params::admin_port, - $admin_assets = $influxdb::params::admin_assets, + $api_port = $influxdb::params::api_port, $api_read_timeout = $influxdb::params::api_read_timeout, + + $input_plugins_collectd = $influxdb::params::input_plugins_collectd, + $input_plugins_collectd_address = $influxdb::params::input_plugins_collectd_address, + $input_plugins_collectd_port = $influxdb::params::input_plugins_collectd_port, + $input_plugins_collectd_database = $influxdb::params::input_plugins_collectd_database, + $input_plugins_collectd_typesdb = $influxdb::params::input_plugins_collectd_typesdb, + + $input_plugins_udp = $influxdb::params::input_plugins_udp, + $input_plugins_udp_port = $influxdb::params::input_plugins_udp_port, + $input_plugins_udp_database = $influxdb::params::input_plugins_udp_database, + + $input_plugins_graphite = $influxdb::params::input_plugins_graphite, + $input_plugins_graphite_protocol = $influxdb::params::input_plugins_graphite_protocol, + $input_plugins_graphite_address = $influxdb::params::input_plugins_graphite_address, + $input_plugins_graphite_port = $influxdb::params::input_plugins_graphite_port, + $input_plugins_graphite_database = $influxdb::params::input_plugins_graphite_database, + $raft_port = $influxdb::params::raft_port, $raft_dir = $influxdb::params::raft_dir, + $raft_debug = $influxdb::params::raft_debug, $raft_election_timeout = $influxdb::params::raft_election_timeout, + $storage_dir = $influxdb::params::storage_dir, $storage_write_buffer_size = $influxdb::params::storage_write_buffer_size, - $cluster_seed_servers = $influxdb::params::cluster_seed_servers, + $storage_max_open_shards = $influxdb::params::storage_max_open_shards, + $storage_point_batch_size = $influxdb::params::storage_point_batch_size, + $storage_write_batch_size = $influxdb::params::storage_write_batch_size, + $storage_retention_sweep_period = $influxdb::params::storage_retention_sweep_period, + + $cluster_dir = $influxdb::params::cluster_dir, $cluster_protobuf_port = $influxdb::params::cluster_protobuf_port, $cluster_protobuf_timeout = $influxdb::params::cluster_protobuf_timeout, $cluster_protobuf_heartbeat = $influxdb::params::cluster_protobuf_heartbeat, @@ -26,11 +55,7 @@ $cluster_write_buffer_size = $influxdb::params::cluster_write_buffer_size, $cluster_max_response_buffer_size = $influxdb::params::cluster_max_response_buffer_size, $cluster_concurrent_shard_query_limit = $influxdb::params::cluster_concurrent_shard_query_limit, - $leveldb_max_open_files = $influxdb::params::leveldb_max_open_files, - $leveldb_lru_cache_size = $influxdb::params::leveldb_lru_cache_size, - $leveldb_max_open_shards = $influxdb::params::leveldb_max_open_shards, - $leveldb_point_batch_size = $influxdb::params::leveldb_point_batch_size, - $leveldb_write_batch_size = $influxdb::params::leveldb_write_batch_size, + $wal_dir = $influxdb::params::wal_dir, $wal_flush_after = $influxdb::params::wal_flush_after, $wal_bookmark_after = $influxdb::params::wal_bookmark_after, diff --git a/manifests/params.pp b/manifests/params.pp index 003d5df..95bc22b 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -8,54 +8,68 @@ $hostname = $::hostname $bind_address = '0.0.0.0' + $reporting_disabled = false + + # [authentication] + $authentication_enabled = false # [logging] $logging_level = 'info' $logging_file = '/opt/influxdb/shared/influxdb.log' # [admin] - $admin_port = '8083' - $admin_assets = '/opt/influxdb/current/admin' + $admin_port = 8083 # [api] - $api_port = '8086' + $api_port = 8086 $api_read_timeout = '5s' # [input_plugins] + $input_plugins_collectd = false + $input_plugins_collectd_address = $bind_address + $input_plugins_collectd_port = 25826 + $input_plugins_collectd_database = '' + $input_plugins_collectd_typesdb = '/usr/share/collectd/types.db' + + $input_plugins_udp = false + $input_plugins_udp_port = 4444 + $input_plugins_udp_database = '' + + $input_plugins_graphite = false + $input_plugins_graphite_protocol = 'tcp' + $input_plugins_graphite_address = $bind_address + $input_plugins_graphite_port = 2003 + $input_plugins_graphite_database = '' # [raft] - $raft_port = '8090' + $raft_port = 8090 $raft_dir = '/opt/influxdb/shared/data/raft' + $raft_debug = false $raft_election_timeout = '1s' # [storage] $storage_dir = '/opt/influxdb/shared/data/db' - $storage_write_buffer_size = '10000' + $storage_write_buffer_size = 10000 + $storage_max_open_shards = 0 + $storage_point_batch_size = 100 + $storage_write_batch_size = 5000000 + $storage_retention_sweep_period = '10m' # [cluster] - $cluster_seed_servers = '[]' - $cluster_protobuf_port = '8099' + $cluster_dir = '/opt/influxdb/shared/data/cluster' + $cluster_protobuf_port = 8099 $cluster_protobuf_timeout = '2s' $cluster_protobuf_heartbeat = '200ms' $cluster_protobuf_min_backoff = '1s' $cluster_protobuf_max_backoff = '10s' - $cluster_write_buffer_size = '10000' - $cluster_max_response_buffer_size = '100' - $cluster_concurrent_shard_query_limit = '10' - - # [leveldb] - $leveldb_max_open_files = '40' - $leveldb_lru_cache_size = '200m' - $leveldb_max_open_shards = '0' - $leveldb_point_batch_size = '100' - $leveldb_point_write_size = '5000000' - - # [sharding] + $cluster_write_buffer_size = 10000 + $cluster_max_response_buffer_size = 100 + $cluster_concurrent_shard_query_limit = 10 # [wal] $wal_dir = '/opt/influxdb/shared/data/wal' - $wal_flush_after = '0' - $wal_bookmark_after = '0' - $wal_index_after = '1000' - $wal_requests_per_logfile = '10000' + $wal_flush_after = 1000 + $wal_bookmark_after = 1000 + $wal_index_after = 1000 + $wal_requests_per_logfile = 10000 } diff --git a/metadata.json b/metadata.json index 32db868..4b52d9f 100644 --- a/metadata.json +++ b/metadata.json @@ -3,30 +3,31 @@ "version": "0.3.0", "source": "https://github.com/justindowning/puppet-influxdb", "author": "Justin Downing", - "license": "Apache License, Version 2.0", + "license": "Apache-2.0", "summary": "Setup and manage influxdb", "description": "Setup and manage influxdb", "project_page": "https://github.com/justindowning/puppet-influxdb", + "source": "https://github.com/justindowning/puppet-influxdb.git", + "issues_url": "https://github.com/justindowning/puppet-influxdb/issues", "dependencies": [ - { "name": "nanliu/staging", "version_requirement": ">= 0.4.0" }, - { "name": "puppetlabs/inifile", "version_requirement": ">= 1.0.0" } + { "name": "nanliu/staging", "version_requirement": ">=0.4.0 <0.4.1" } ], "operatingsystem_support": [ { "operatingsystem": "RedHat", - "operatingsystemrelease": [ "5", "6" ] + "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "CentOS", - "operatingsystemrelease": [ "5", "6" ] + "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "OracleLinux", - "operatingsystemrelease": [ "5", "6" ] + "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "Scientific", - "operatingsystemrelease": [ "5", "6" ] + "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "Debian", @@ -38,7 +39,7 @@ } ], "requirements": [ - { "name": "pe", "version_requirement": "3.2.x" }, + { "name": "pe", "version_requirement": "3.x" }, { "name": "puppet", "version_requirement": "3.x" } ] } diff --git a/templates/config.toml.erb b/templates/config.toml.erb new file mode 100644 index 0000000..53000fd --- /dev/null +++ b/templates/config.toml.erb @@ -0,0 +1,158 @@ +# ** This file is managed by Puppet ** # + +# If hostname (on the OS) doesn't return a name that can be resolved by the other +# systems in the cluster, you'll have to set the hostname to an IP or something +# that can be resolved here. +hostname = "<%= @hostname %>" +bind-address = "<% @bind_address %>" + +# Once every 24 hours InfluxDB will report anonymous data to m.influxdb.com +# The data includes raft name (random 8 bytes), os, arch and version +# We don't track ip addresses of servers reporting. This is only used +# to track the number of instances running and the versions which +# is very helpful for us. +# Change this option to true to disable reporting. +reporting-disabled = <%= @reporting_disabled %> + +# Control authentication +# If not set authetication is DISABLED. Be sure to explicitly set this flag to +# true if you want authentication. If authentication is enabled, and no administrative +# user exists in the system, the system will allow one administrative user to be +# created without requiring any authentication. +[authentication] +enabled = <%= @authentication_enabled %> + +[logging] +# logging level can be one of "fine", "debug", "info", "warn" or "error" +level = "<%= @logging_level %>" +file = "<%= @logging_file %>" # stdout to log to standard out, or syslog facility + +# Configure the admin server +[admin] +port = <%= @admin_port %> # binding is disabled if the port isn't set + +# Configure the http api +[api] +port = <%= @api_port %> # binding is disabled if the node is not a Data node. +# ssl-port = 8084 # SSL support is enabled if you set a port and cert +# ssl-cert = "/path/to/cert.pem" + +# connections will timeout after this amount of time. Ensures that clients that misbehave +# and keep alive connections they don't use won't end up connection a million times. +# However, if a request is taking longer than this to complete, could be a problem. +read-timeout = "<%= @api_read_timeout %>" + +[input_plugins] +<%- if @input_plugins_collected -%> + [input_plugins.collectd] + enabled = <%= @input_plugins_collectd %> + address = "<%= @input_plugins_collectd_address %>" + port = <%= @input_plugins_collectd_port %> + database = <%= @input_plugins_collectd_database %> + # types.db can be found in a collectd installation or on github: + # https://github.com/collectd/collectd/blob/master/src/types.db + typesdb = <%= @input_plugins_collectd_typesdb %> # The path to the collectd types.db file +<% end -%> + +<% if @input_plugins_udp -%> + [input_plugins.udp] + enabled = <%= @input_plugins_udp %> + port = <%= @input_plugins_udp_port %> + database = <%= @input_plugins_udp_database %> + + # Configure multiple udp apis each can write to separate db. Just + # repeat the following section to enable multiple udp apis on + # different ports. + [[input_plugins.udp_servers]] # array of tables + enabled = false + # port = 5551 + # database = "db1" +<% end -%> + +<% if @input_plugins_graphite -%> +[[graphite]] # 1 or more of these sections may be present. +enabled = <% @input_plugins_graphite %> +protocol = <% @input_plugins_graphite_protocol %> +address = "<%= @input_plugins_graphite_address %>" +port = <%= @input_plugins_graphite_port %> +database = <%= @input_plugins_graphite_database %> +<% end -%> + +# Raft configuration +[raft] +# The raft port should be open between all servers in a cluster. +# However, this port shouldn't be accessible from the internet. +port = <%= @raft_port %> # Binding is disabled if node is not a Broker. + +# Where the raft logs are stored. The user running InfluxDB will need read/write access. +dir = "<%= @raft_dir %>" + +debug = <%= @raft_debug %> +election-timeout = "<%= @raft_election_timeout %>" + +[storage] +dir = "<%= @storage_dir %>" +# How many requests to potentially buffer in memory. If the buffer gets filled then writes +# will still be logged and once the local storage has caught up (or compacted) the writes +# will be replayed from the WAL +write-buffer-size = <%= @storage_write_buffer_size %> + +# The default setting on this is 0, which means unlimited. Set this to something if you want to +# limit the max number of open files. max-open-files is per shard so this * that will be max. +max-open-shards = <%= @storage_max_open_shards %> + +# The default setting is 100. This option tells how many points will be fetched from LevelDb before +# they get flushed into backend. +point-batch-size = <%= @storage_point_batch_size %> + +# The number of points to batch in memory before writing them to leveldb. Lowering this number will +# reduce the memory usage, but will result in slower writes. +write-batch-size = <%= @storage_write_batch_size %> + +# The server will check this often for shards that have expired that should be cleared. +retention-sweep-period = "<%= @storage_retention_sweep_period %>" + +[cluster] + +# Location for cluster state storage. For storing state persistently across restarts. +dir = "<%= @cluster_dir %>" +# Replication happens over a TCP connection with a Protobuf protocol. +# This port should be reachable between all servers in a cluster. +# However, this port shouldn't be accessible from the internet. + +protobuf_port = <%= @cluster_protobuf_port %> +protobuf_timeout = "<%= @cluster_protobuf_timeout %>" # the write timeout on the protobuf conn any duration parseable by time.ParseDuration +protobuf_heartbeat = "<%= @cluster_protobuf_heartbeat %>" # the heartbeat interval between the servers. must be parseable by time.ParseDuration +protobuf_min_backoff = "<%= @cluster_protobuf_min_backoff %>" # the minimum backoff after a failed heartbeat attempt +protobuf_max_backoff = "<%= @cluster_protobuf_max_backoff %>" # the maxmimum backoff after a failed heartbeat attempt + +# How many write requests to potentially buffer in memory per server. If the buffer gets filled then writes +# will still be logged and once the server has caught up (or come back online) the writes +# will be replayed from the WAL +write-buffer-size = <%= @cluster_write_buffer_size %> + +# the maximum number of responses to buffer from remote nodes, if the +# expected number of responses exceed this number then querying will +# happen sequentially and the buffer size will be limited to this +# number +max-response-buffer-size = <%= @cluster_max_response_buffer_size %> + +# When queries get distributed out to shards, they go in parallel. This means that results can get buffered +# in memory since results will come in any order, but have to be processed in the correct time order. +# Setting this higher will give better performance, but you'll need more memory. Setting this to 1 will ensure +# that you don't need to buffer in memory, but you won't get the best performance. +concurrent-shard-query-limit = <%= @cluster_concurrent_shard_query_limit %> + +[wal] + +dir = "<%= @wal_dir %>" +flush-after = <%= @wal_flush_after %> # the number of writes after which wal will be flushed, 0 for flushing on every write +bookmark-after = <%= @wal_bookmark_after %> # the number of writes after which a bookmark will be created + +# the number of writes after which an index entry is created pointing +# to the offset of the first request, default to 1k +index-after = <%= @wal_index_after %> + +# the number of requests per one log file, if new requests came in a +# new log file will be created +requests-per-logfile = <%= @wal_requests_per_logfile %>