.. author:: brutus <[email protected]>
.. tag:: database
.. tag:: metrics
.. tag:: prometheus
.. tag:: golang
.. tag:: rust
.. tag_list::
InfluxDB is an open source time series database (TSDB). Or "a platform for building and operating time series applications". It is developed by InfluxData, written in Go and optimized for fast, high-availability storage and retrieval of time series data in fields such as operations monitoring, application metrics, Internet of Things sensor data, and real-time analytics.
It can scrape data from OpenMetrics endpoints. And has support for processing a wide assortment of sources via Telegraf. As well as multiple "officially recognized" language bindings.
Note
For this guide you should be familiar with the basic concepts of
The OSS Version is MIT licensed. Legal information can be found here:
Here's a quick overview of some key concepts / terminology:
Data is modeled as time series; i.e. data points stored in a "table-like" manner. A data point combines a unique timestamp with one or more typed values (fields) and optional labels (tags). Access is governed by granting users rights to objects, supporting multiple tenants.
- Organisation
- (~ workspace) groups buckets with related objects (e.g. dashboards, tasks, alerts) and access management for users.
- Bucket
- (~ database) contains measurements, combined with a retention period (i.e. how long will this data be stored).
- Measurement
- (~ table) a specific set of time series data, used for grouping points.
- Point
- (~ row) a single entry, combining a unique timestamp with one or more fields and optional tags.
- Field
- (~ column) a field name with a field value (typed).
- Tag
- (~ labels) a tag name with a tag value (string).
We aim to provide the latest stable version of influx
(CLI client) and
influxd
(server) for you. So no need to install anything. But you can of
course install other versions yourself, e.g. from
https://github.com/influxdata/influxdb/releases.
Use your favorite editor to create the file ~/etc/influxd.toml
with the
following content:
http-bind-address = "0.0.0.0:8086"
log-level = "error"
reporting-disabled = true
You might want to review these and other available options.
Use your favorite editor to create the file ~/etc/services.d/influxd.ini
with the following content.
[program:influxd]
startsecs = 60
startretries = 0
environment = INFLUXD_CONFIG_PATH=%(ENV_HOME)s/etc/influxd.toml
command = influxd run
If it's not in state RUNNING (after the time set in startsecs
has passed),
check your configuration.
Before we enable your installation for outside access, we run a quick setup:
[isabell@stardust ~]$ influx setup
And provide these:
- Enter a primary username.
- Enter a password for your primary user.
- Confirm your password by entering it again.
- Enter a name for your primary organization.
- Enter a name for your primary bucket.
- Enter a retention period for your primary bucket.
- Confirm the details for your primary user, organization, and bucket.
Note
InfluxDB is running on port 8086
, also see http-bind-address
in your ~/etc/influxd.toml
.
When designing your schema, think about when to use fields and when to use tags for your data:
- Fields aren't indexed, but required.
- Tags are indexed, but optional.
Queries that filter field values must scan all field values to match query conditions. As a result, queries on tags are more performant than queries on fields. So you might want to store commonly queried metadata in tags.
You should also think about your series cardinality.
To keep memory usage within acceptable limits and performance up, remember to downsample your data regularly. Here's an intro on how to set up tasks, to do that with Flux: https://www.influxdata.com/blog/downsampling-influxdb-v2-0/
Note
Check the update feed regularly to stay informed about the newest version.
Tested with InfluxDB 2.0.3, Uberspace 7.8.2
.. author_list::