How To Install victoria-metrics on Debian 12

Learn how to install victoria-metrics on Debian 12 with this tutorial. victoria-metrics is fast, cost-effective and scalable time series database

Introduction

In this tutorial we learn how to install victoria-metrics on Debian 12.

What is victoria-metrics

victoria-metrics is:

VictoriaMetrics is a fast, cost-effective and scalable time-series database. It can be used as long-term remote storage for Prometheus.

Prominent features:

  • Supports Prometheus querying API, so it can be used as Prometheus drop-in replacement in Grafana. VictoriaMetrics implements MetricsQL query language, which is inspired by PromQL.
  • Supports global query view. Multiple Prometheus instances may write data into VictoriaMetrics. Later this data may be used in a single query.
  • High performance and good scalability for both inserts and selects. Outperforms InfluxDB and TimescaleDB by up to 20x.
  • Uses 10x less RAM than InfluxDB when working with millions of unique time series (aka high cardinality).
  • Optimized for time series with high churn rate. Think about prometheus-operator metrics from frequent deployments in Kubernetes.
  • High data compression, so up to 70x more data points may be crammed into limited storage comparing to TimescaleDB.
  • Optimized for storage with high-latency IO and low IOPS (HDD and network storage in AWS, Google Cloud, Microsoft Azure, etc).
  • A single-node VictoriaMetrics may substitute moderately sized clusters built with competing solutions such as Thanos, M3DB, Cortex, InfluxDB or TimescaleDB.
  • Easy operation:
    • VictoriaMetrics consists of a single small executable without external dependencies.
    • All the configuration is done via explicit command-line flags with reasonable defaults.
    • All the data is stored in a single directory pointed by -storageDataPath flag.
    • Easy and fast backups from instant snapshots to S3 or GCS with vmbackup / vmrestore.
    • Data migration between VictoriaMetrics, Prometheus and InfluxDB with vmctl.
  • Storage is protectedfrom corruption on unclean shutdown (i.e. OOM, hardware reset or kill -9) thanks to the storage architecture.
  • Supports metrics’ scraping, ingestion and backfilling (#backfilling) via the following protocols:
    • Metrics from Prometheus exporters such as node_exporter.
    • Prometheus remote write API
    • InfluxDB line protocol
    • Graphite plaintext protocol with tags if -graphiteListenAddr is set.
    • OpenTSDB put message if -opentsdbListenAddr is set.
    • HTTP OpenTSDB /api/put requests if -opentsdbHTTPListenAddr is set.
    • /api/v1/import.
  • Ideally works with big amounts of time series data from Kubernetes, IoT sensors, connected cars, industrial telemetry, financial data and various Enterprise workloads.
  • Has open source cluster version.

There are three methods to install victoria-metrics on Debian 12. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install victoria-metrics Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install victoria-metrics using apt-get by running the following command:

sudo apt-get -y install victoria-metrics

Install victoria-metrics Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install victoria-metrics using apt by running the following command:

sudo apt -y install victoria-metrics

Install victoria-metrics Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Debian. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install victoria-metrics using aptitude by running the following command:

sudo aptitude -y install victoria-metrics

How To Uninstall victoria-metrics on Debian 12

To uninstall only the victoria-metrics package we can use the following command:

sudo apt-get remove victoria-metrics

Uninstall victoria-metrics And Its Dependencies

To uninstall victoria-metrics and its dependencies that are no longer needed by Debian 12, we can use the command below:

sudo apt-get -y autoremove victoria-metrics

Remove victoria-metrics Configurations and Data

To remove victoria-metrics configuration and data from Debian 12 we can use the following command:

sudo apt-get -y purge victoria-metrics

Remove victoria-metrics configuration, data, and all of its dependencies

We can use the following command to remove victoria-metrics configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge victoria-metrics

Dependencies

victoria-metrics have the following dependencies:

References

Summary

In this tutorial we learn how to install victoria-metrics package on Debian 12 using different package management tools: apt, apt-get and aptitude.