Process Management

This document covers how to manage the Vector process using various process managers.

Starting

Vector can be started by calling the vector binary directly, no subcommand is necessary.

  • Manual
  • Sytemd
  • Initd
  • Homebrew
vector --config /etc/vector/vector.toml

Flags

2 items
commonstringrequired

-c, --config

Path to the Vector configuration file.

Default: "/etc/vector/vector.toml"
View examples
commonstringrequired

test

test

Default: "/etc/vector/vector.toml"
View examples
FlagDescription
Required
-c, --config <path>Path the Vector configuration file.
Optional
-d, --dry-runVector will validate configuration and exit.
-q, --quietRaises the log level to warn.
-qqRaises the log level to error, the highest level possible.
-r, --require-healthyCauses vector to immediately exit if any sinks fail their healthchecks.
-t, --threadsLimits the number of internal threads Vector can spawn. See the Limiting Resources in the Agent role documentation.
-v, --verboseDrops the log level to debug.
-vvDrops the log level to trace, the lowest level possible.

Daemonizing

Vector does not directly offer a way to daemonize the Vector process. We highly recommend that you use a utility like Systemd to daemonize and manage your processes. Vector provides a vector.service file for Systemd.

Stopping

The Vector process should be stopped by sending it a SIGTERM process signal:

  • Manual
  • Systemd
  • Initd
  • Homebrew
kill -SIGTERM <vector-process-id>

If you are currently running the Vector process in your terminal, this can be achieved by a single ctrl+c key combination.

Graceful Shutdown

Vector is designed to gracefully shutdown within 20 seconds when a SIGTERM process signal is received. The shutdown process is as follows:

  1. Stop accepting new data for all sources.
  2. Gracefully close any open connections with a 20 second timeout.
  3. Flush any sink buffers with a 20 second timeout.
  4. Exit the process with a 1 code.

Force Killing

If Vector is forcefully killed there is potential for losing any in-flight data. To mitigate this we recommend enabling on-disk buffers and avoiding forceful shutdowns whenever possible.

Exit Codes

If Vector fails to start it will exit with one of the preferred exit codes as defined by sysexits.h. A full list of exit codes can be found in the exitcodes Rust crate. The relevant codes that Vector uses are:

CodeDescription
0No error.
78Bad configuration.

Reloading

Vector can be reloaded, on the fly, to recognize any configuration changes by sending the Vector process a SIGHUP signal:

  • Manual
  • Systemd
  • Initd
  • Homebrew
kill -SIGHUP <vector-process-id>

You can find the Vector process ID with:

ps -ax vector | grep vector

Configuration Errors

When Vector is reloaded it proceeds to read the new configuration file from disk. If the file has errors it will be logged to STDOUT and ignored, preserving any previous configuration that was set. If the process exits you will not be able to restart the process since it will proceed to use the new configuration file.

Graceful Pipeline Transitioning

Vector will perform a diff between the new and old configuration, determining which sinks and sources should be started and shutdown and ensures the transition from the old to new pipeline is graceful.