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
-c, --config
Path to the Vector configuration file.
"/etc/vector/vector.toml"
test
test
"/etc/vector/vector.toml"
Flag | Description |
---|---|
Required | |
-c, --config <path> | Path the Vector configuration file. |
Optional | |
-d, --dry-run | Vector will validate configuration and exit. |
-q, --quiet | Raises the log level to warn . |
-qq | Raises the log level to error , the highest level possible. |
-r, --require-healthy | Causes vector to immediately exit if any sinks fail their healthchecks. |
-t, --threads | Limits the number of internal threads Vector can spawn. See the Limiting Resources in the Agent role documentation. |
-v, --verbose | Drops the log level to debug . |
-vv | Drops 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:
- Stop accepting new data for all sources.
- Gracefully close any open connections with a 20 second timeout.
- Flush any sink buffers with a 20 second timeout.
- 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:
Code | Description |
---|---|
0 | No error. |
78 | Bad 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.