Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
253 changes: 241 additions & 12 deletions docs/victorialogs/QuickStart.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,30 +165,259 @@ of VictoriaLogs first.

Comment thread
jespino marked this conversation as resolved.
The following options are available:

- [To run pre-built binaries](https://docs.victoriametrics.com/victorialogs/quickstart/#pre-built-binaries)
- [To run VictoriaLogs single node from a binary](https://docs.victoriametrics.com/victorialogs/quickstart/#pre-built-binaries)
- [To run VictoriaLogs cluster from binaries](https://docs.victoriametrics.com/victorialogs/quickstart/#starting-vl-cluster-from-binaries)
- [To run Docker image](https://docs.victoriametrics.com/victorialogs/quickstart/#docker-image)
- [To run in Kubernetes with Helm charts](https://docs.victoriametrics.com/victorialogs/quickstart/#helm-charts)
- [To run in Kubernetes with VictoriaMetrics Operator (VLSingle / VLCluster CRDs)](https://docs.victoriametrics.com/operator/resources/)
- [To build VictoriaLogs from source code](https://docs.victoriametrics.com/victorialogs/quickstart/#building-from-source-code)

### Pre-built binaries
### Starting VictoriaLogs Single Node from a Binary {id="pre-built-binaries"}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is overwriting the id intentionally to ensure not breaking links from other documents here.


Pre-built binaries for VictoriaLogs are available at the [releases](https://github.com/VictoriaMetrics/VictoriaLogs/releases/) page.
Just download the archive for the needed operating system and architecture, unpack it, and run `victoria-logs-prod` from it.
1. Download the archive for your OS and architecture from the [releases page](https://github.com/VictoriaMetrics/VictoriaLogs/releases/latest).
For example, on Linux with `amd64` architecture:

```sh
curl -L -O https://github.com/VictoriaMetrics/VictoriaLogs/releases/download/v1.52.0/victoria-logs-linux-amd64-v1.52.0.tar.gz
```

2. Extract the archive to /usr/local/bin by running:

```sh
sudo tar xzf victoria-logs-linux-amd64-v1.52.0.tar.gz -C /usr/local/bin
```

3. Create a VictoriaLogs user on the system:

```sh
sudo useradd -s /usr/sbin/nologin victorialogs
```

4. Create a folder for storing VictoriaLogs data:

```sh
sudo mkdir -p /var/lib/victoria-logs && sudo chown -R victorialogs:victorialogs /var/lib/victoria-logs
```

5. Create a Linux Service by running the following:

```sh
sudo bash -c 'cat <<END >/etc/systemd/system/victorialogs.service
[Unit]
Description=VictoriaLogs service
After=network.target

[Service]
Type=simple
User=victorialogs
Group=victorialogs
ExecStart=/usr/local/bin/victoria-logs-prod -storageDataPath=/var/lib/victoria-logs
SyslogIdentifier=victorialogs
Restart=always

PrivateTmp=yes
ProtectHome=yes
NoNewPrivileges=yes

ProtectSystem=full

[Install]
WantedBy=multi-user.target
END'
```

Extra [command-line flags](https://docs.victoriametrics.com/victorialogs/#list-of-command-line-flags) can be added to the `ExecStart` line.

> Please note, `victorialogs` service is listening on `:9428` for HTTP connections (see `-httpListenAddr` flag).

6. Start and enable the service by running the following command:

```sh
sudo systemctl daemon-reload && sudo systemctl enable --now victorialogs.service
```

For example, the following commands download VictoriaLogs archive for Linux/amd64, unpack and run it:
7. Check that the service started successfully:

```sh
sudo systemctl status victorialogs.service
```

8. After VictoriaLogs is in `Running` state, verify the [Web UI](https://docs.victoriametrics.com/victorialogs/querying/#web-ui) is working
by going to `http://<ip_or_hostname>:9428/select/vmui`.

### Starting VictoriaLogs Cluster from Binaries {id="starting-vl-cluster-from-binaries"}

VictoriaLogs cluster consists of [3 components](https://docs.victoriametrics.com/victorialogs/cluster/#architecture) -
`vlinsert`, `vlselect` and `vlstorage`. All of them share the same single-node VictoriaLogs executable,
and the role of every node is defined by its command-line flags.
It is recommended to run these components in the same private network (for [security reasons](https://docs.victoriametrics.com/victorialogs/#security)),
but on separate physical nodes for the best performance.

On all nodes, you will need to do the following:

1. Download the archive for your OS and architecture from the [releases page](https://github.com/VictoriaMetrics/VictoriaLogs/releases/latest).
For example, on Linux with `amd64` architecture:

```sh
curl -L -O https://github.com/VictoriaMetrics/VictoriaLogs/releases/download/v1.52.0/victoria-logs-linux-amd64-v1.52.0.tar.gz
tar xzf victoria-logs-linux-amd64-v1.52.0.tar.gz
./victoria-logs-prod -storageDataPath=victoria-logs-data
```

VictoriaLogs is ready for [data ingestion](https://docs.victoriametrics.com/victorialogs/data-ingestion/)
and [querying](https://docs.victoriametrics.com/victorialogs/querying/) at the TCP port `9428` now!
It has no external dependencies, so it can run in various environments without additional setup or configuration.
VictoriaLogs automatically adapts to the available CPU and RAM resources. It also automatically sets up and creates
the needed indexes during [data ingestion](https://docs.victoriametrics.com/victorialogs/data-ingestion/).
2. Extract the archive to /usr/local/bin by running:

```sh
sudo tar xzf victoria-logs-linux-amd64-v1.52.0.tar.gz -C /usr/local/bin
```

3. Create a user account for VictoriaLogs:

```sh
sudo useradd -s /usr/sbin/nologin victorialogs
```

See recommendations for installing each type of cluster component below.

> Please note, every cluster component is listening on `:9428` for HTTP connections by default (see `-httpListenAddr` flag).

#### Installing vlstorage

1. Create a folder for storing `vlstorage` data:

```sh
sudo mkdir -p /var/lib/vlstorage && sudo chown -R victorialogs:victorialogs /var/lib/vlstorage
```

2. Create a Linux Service for `vlstorage` by running the following command:

```sh
sudo bash -c 'cat <<END >/etc/systemd/system/vlstorage.service
[Unit]
Description=VictoriaLogs vlstorage service
After=network.target

[Service]
Type=simple
User=victorialogs
Group=victorialogs
Restart=always
ExecStart=/usr/local/bin/victoria-logs-prod -storageDataPath=/var/lib/vlstorage

PrivateTmp=yes
ProtectHome=yes
NoNewPrivileges=yes
ProtectSystem=full

[Install]
WantedBy=multi-user.target
END'
```

3. Start and Enable `vlstorage`:

```sh
sudo systemctl daemon-reload && sudo systemctl enable --now vlstorage
```

4. Check that the service started successfully:

```sh
sudo systemctl status vlstorage
```

5. After `vlstorage` is in `Running` state, confirm the service is healthy by visiting `http://<ip_or_hostname>:9428/health` link.
It should return `OK`.

#### Installing vlinsert

1. Create a Linux Service for `vlinsert` by running the following command:

```sh
sudo bash -c 'cat <<END >/etc/systemd/system/vlinsert.service
[Unit]
Description=VictoriaLogs vlinsert service
After=network.target

[Service]
Type=simple
User=victorialogs
Group=victorialogs
Restart=always
ExecStart=/usr/local/bin/victoria-logs-prod -storageNode=<list of vlstorages> -select.disable

PrivateTmp=yes
ProtectHome=yes
NoNewPrivileges=yes
ProtectSystem=full

[Install]
WantedBy=multi-user.target
END'
```

Replace `<list of vlstorages>` with comma-separated addresses of previously configured `vlstorage` services
(e.g. `vlstorage-1:9428,vlstorage-2:9428`). See more details in the `-storageNode` flag description
in [cluster docs](https://docs.victoriametrics.com/victorialogs/cluster/#architecture).
The `-select.disable` flag makes this node serve the [insert APIs](https://docs.victoriametrics.com/victorialogs/data-ingestion/#http-apis) only.

2. Start and Enable `vlinsert`:

```sh
sudo systemctl daemon-reload && sudo systemctl enable --now vlinsert.service
```

3. Check that the service started successfully:

```sh
sudo systemctl status vlinsert.service
```

4. After `vlinsert` is in `Running` state, confirm the service is healthy by visiting `http://<ip_or_hostname>:9428/health` link.
It should return `OK`.

#### Installing vlselect

1. Create a Linux Service for `vlselect` by running the following command:

```sh
sudo bash -c 'cat <<END >/etc/systemd/system/vlselect.service
[Unit]
Description=VictoriaLogs vlselect service
After=network.target

[Service]
Type=simple
User=victorialogs
Group=victorialogs
Restart=always
ExecStart=/usr/local/bin/victoria-logs-prod -storageNode=<list of vlstorages> -insert.disable

PrivateTmp=yes
ProtectHome=yes
NoNewPrivileges=yes
ProtectSystem=full

[Install]
WantedBy=multi-user.target
END'
```

Replace `<list of vlstorages>` with comma-separated addresses of previously configured `vlstorage` services,
the same way as for `vlinsert`. The `-insert.disable` flag makes this node serve
the [select APIs](https://docs.victoriametrics.com/victorialogs/querying/#http-api) only.

2. Start and Enable `vlselect`:

```sh
sudo systemctl daemon-reload && sudo systemctl enable --now vlselect.service
```

3. Check that the service started successfully:

```sh
sudo systemctl status vlselect.service
```

4. After `vlselect` is in `Running` state, confirm the service is healthy by visiting `http://<ip_or_hostname>:9428/select/vmui` link.
It should open the [Web UI](https://docs.victoriametrics.com/victorialogs/querying/#web-ui) page.

See also:

Expand Down