Install Vector From Source
This page covers installing Vector from source. Because Vector is written in Rust it can compile to a single static binary. You can view an example of this in the musl builder Docker image.
We recommend installing Vector through a supported container platform, package manager, or pre-built archive, if possible. These handle permissions, directory creation, and other intricacies covered in the Next Steps section.
Installation
Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stableInstall C++ toolchain
Install C and C++ compilers (GCC or Clang) and GNU
make
if they are not pre-installed on your system.Create the
vector
directorymkdir vectorDownload Vector's Source
- Latest (0.5.0)
- Master
mkdir -p vector && \curl -sSfL --proto '=https' --tlsv1.2 https://api.github.com/repos/timberio/vector/tarball/v0.5.0 | \tar xzf - -C vector --strip-components=1Change into the
vector
directorycd vectorCompile Vector
[FEATURES="<flag1>,<flag2>,..."] make buildThe
FEATURES
environment variable is optional. You can override the default features with this variable. See feature flags for more info.When finished, the vector binary will be placed in
target/<target>/release/vector
. For example, if you are building Vector on your Mac, your target triple isx86_64-apple-darwin
, and the Vector binary will be located attarget/x86_64-apple-darwin/release/vector
.Start Vector
Finally, start vector:
target/<target>/release/vector --config config/vector.toml
Next Steps
Configuring
The Vector configuration file is located at:
config/vector.toml
A full spec is located at config/vector.spec.toml
and examples are
located in config/vector/examples/*
. You can learn more about configuring
Vector in the Configuration section.
Data Directory
We highly recommend creating a data directory that Vector can use:
mkdir /var/lib/vector
Make sure that this directory is writable by the vector
process.
Vector offers a global data_dir
option that
you can use to specify the path of your directory.
data_dir = "/var/lib/vector" # default
Service Managers
Vector archives ship with service files in case you need them:
Init.d
To install Vector into Init.d run:
cp -av distribution/init.d/vector /etc/init.d
Systemd
To install Vector into Systemd run:
cp -av distribution/systemd/vector.service /etc/systemd/system
Updating
Simply follow the same installation instructions above.
How It Works
Feature Flags
The following feature flags are supported via the FEATURES
env var when
executing make build
:
[FEATURES="<flag1>,<flag2>,..."] make build
Feature | Description | Enabled by default |
---|---|---|
jemallocator | Enables vendored jemalloc instead of default memory allocator, which improves performance. | |
leveldb | Enables support for disk buffers using vendored LevelDB. | |
leveldb/leveldb-sys-2 | Can be used together with leveldb feature to use LevelDB from leveldb-sys 2.x crate, which doesn't require cmake as build dependency, but supports less platforms. | |
leveldb/leveldb-sys-3 | Can be used together with leveldb feature to use LevelDB from development version of leveldb-sys 3.x crate, which requires cmake as build dependency, but supports more platforms. | |
openssl/vendored | Enables vendored OpenSSL. If disabled, system SSL library is used instead. | |
rdkafka | Enables vendored librdkafka dependency, which is required for kafka source and kafka sink. | |
rdkafka/cmake_build | Can be used together with rdkafka feature to build librdkafka using cmake instead of default build script in case of build problems on non-standard system configurations. | |
shiplift/unix-socket | Enables support for Unix domain sockets in docker source. |