Compare commits

...

4 Commits

Author SHA1 Message Date
Artem Fetishev
7b07c894a8 final fixes
Signed-off-by: Artem Fetishev <rtm@victoriametrics.com>
2026-07-03 15:47:12 +02:00
Artem Fetishev
c08931dc7a fix ai code review remarks
Signed-off-by: Artem Fetishev <rtm@victoriametrics.com>
2026-07-03 15:37:43 +02:00
Artem Fetishev
154b340d3b update one more place
Signed-off-by: Artem Fetishev <rtm@victoriametrics.com>
2026-07-03 15:28:51 +02:00
Artem Fetishev
671fe570b2 docs: vmsingle multitenancy
Signed-off-by: Artem Fetishev <rtm@victoriametrics.com>
2026-07-03 15:18:55 +02:00
3 changed files with 73 additions and 6 deletions

View File

@@ -338,7 +338,9 @@ File bugs and feature requests in our [GitHub Issues](https://github.com/Victori
## Where can I find information about multi-tenancy?
See [these docs](https://docs.victoriametrics.com/victoriametrics/cluster-victoriametrics/#multitenancy).
Multitenancy is supported only by the [cluster version](https://docs.victoriametrics.com/victoriametrics/cluster-victoriametrics/) of VictoriaMetrics.
Multitenancy is fully supported only by the [cluster version](https://docs.victoriametrics.com/victoriametrics/cluster-victoriametrics/) of VictoriaMetrics.
Single-node provides limited [multitenancy](https://docs.victoriametrics.com/victoriametrics/single-server-victoriametrics/#multitenancy) support to facilitate
the migration [from single-node to cluster](https://docs.victoriametrics.com/victoriametrics/single-server-victoriametrics/#from-single-node-to-cluster).
## How to set a memory limit for VictoriaMetrics components?
@@ -467,7 +469,11 @@ Cluster version of VictoriaMetrics may be preferred over single-node VictoriaMet
The single-node version of VictoriaMetrics stores data on disk in slightly different format compared to the cluster version of VictoriaMetrics.
This makes it impossible to just copy the on-disk data from `-storageDataPath` directory from single-node VictoriaMetrics to a `vmstorage` node in VictoriaMetrics cluster.
If you need to migrate data from a single-node VictoriaMetrics to the cluster version, then [follow these instructions](https://docs.victoriametrics.com/victoriametrics/vmctl/victoriametrics/).
There are two options, however:
1. Deploy a new cluster next to the existing single-node and let them co-exist until the cluster is filled with new data and the old data in vmsingle becomes outside of the retention period. This option requires no data migration nor downtime. See instructions [here](https://docs.victoriametrics.com/victoriametrics/single-server-victoriametrics/#from-single-node-to-cluster).
2. If you need to actually migrate data from a single-node VictoriaMetrics to the cluster version (and/or possibly modify it), then follow [these vmctl instructions](https://docs.victoriametrics.com/victoriametrics/vmctl/victoriametrics/).
## Why isn't MetricsQL 100% compatible with PromQL?

View File

@@ -1682,9 +1682,46 @@ See also [retention filters](#retention-filters).
The downsampling can be evaluated for free by downloading and using enterprise binaries from [the releases page](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/latest).
See how to request a [free trial license](https://victoriametrics.com/products/enterprise/trial/).
## Multi-tenancy
## Multitenancy
Single-node VictoriaMetrics doesn't support multi-tenancy. Use the [cluster version](https://docs.victoriametrics.com/victoriametrics/cluster-victoriametrics/#multitenancy) instead.
Starting from `v1.147.0` single-node VictoriaMetrics has limited
[multitenancy](https://docs.victoriametrics.com/victoriametrics/cluster-victoriametrics/#multitenancy)
support. Specifically, single-node can serve multitenant queries as if it were a
`vmstorage`. Write path is not supported.
The functionality is disabled by default and can be enabled by setting the
`-vmselectAddr` flag. This will start the `vmselect RPC server` that accepts
requests and serves responses in cluster format.
Cluster data format assumes the presence of a `tenantID`. Single-node data
format still does not support multitenancy but it is possible to configure the
single-node which `tenantID` the single-node's data corresponds to with
`-accountID` and `-projectID` flags. Both are `0` by default, which means that
`"0:0"` `tenantID` is used by default.
For example, the following command will start a single-node that listens for
vmselect RPC requests on `8401` port. The requests must be either `multitenant`
(i.e. want data for all tenants) or for `"12:34"` tenant. Otherwise, the
single-node will return an empty result:
```shell
./victoria-metrics -storageDataPath=/data -vmselectAddr=:8401 -accountID=12 -projectID=34
```
The `tenantID` configuration is not persisted in any way and is enforced only at
runtime. Thus, it is safe to change the `-accountID` and `-projectID` flag
values at any time.
Note that the single-node's HTTP handlers still do not support multitenancy.
The purpose of this limited multitenancy support is enabling the single-node to
operate in VictoriaMetrics cluster setups. I.e. one or more single-nodes that
contain data for different tenants can be a part of a cluster, and the entire
non-homogenous deployment can be queried with a higher-level `vmselect`.
This, in turn, enables easy [migrations from single-node to cluster](#from-single-node-to-cluster).
Previously, the only option was the use of
[vmctl](https://docs.victoriametrics.com/victoriametrics/vmctl/victoriametrics/).
## Scalability and cluster version
@@ -2294,6 +2331,30 @@ Things to consider when copying data:
For scenarios like single-to-cluster, cluster-to-single, re-sharding or migrating only a fraction of data:
[see how to migrate data from VictoriaMetrics via vmctl](https://docs.victoriametrics.com/victoriametrics/vmctl/victoriametrics/).
### From Single-node to Cluster
When, for some reason, the deployment needs to be switched from single-node to
cluster (such as the single-node can't be scaled vertically anymore, or
multitenancy becomes a requirement, etc.) the migration can be as simple as:
1. Restart the existing single-node with multitenancy support enabled as
described in [Multitenancy](#multitenancy) section.
1. Deploy an empty cluster next to the existing single-node.
1. Deploy higher-level `vmselect` and configure it to query both the existing
single-node and the new cluster.
1. Start writing data to the cluster.
1. Stop writing data to the single-node.
This approach requires no data migration nor downtime (apart from restarting the
single-node at step 1). And once the single-node data becomes outside the
retention period, the single-node can be removed from the deployment.
Note that if you need to actually migrate data to cluster and/or modify it, you
will need to use
[vmctl](https://docs.victoriametrics.com/victoriametrics/vmctl/victoriametrics/)
instead.
### From other systems
Use [vmctl](https://docs.victoriametrics.com/victoriametrics/vmctl/) to migrate data from other systems to VictoriaMetrics.

View File

@@ -8,7 +8,7 @@ menu:
weight: 9
---
The simplest way to migrate data between VictoriaMetrics installations is [to copy data between instances](https://docs.victoriametrics.com/victoriametrics/single-server-victoriametrics/#data-migration).
The simplest way to migrate data between VictoriaMetrics installations is [to copy data between instances](https://docs.victoriametrics.com/victoriametrics/single-server-victoriametrics/#data-migration) or [to run single-node and cluster together](https://docs.victoriametrics.com/victoriametrics/single-server-victoriametrics/#from-single-node-to-cluster).
But when simple copy isn't possible (migration between single-node and cluster, or re-sharding) or when data need to be
modified - use `vmctl vm-native` to migrate data.
@@ -190,4 +190,4 @@ See general [vmctl migration tips](https://docs.victoriametrics.com/victoriametr
See `./vmctl vm-native --help` for details and full list of flags:
{{% content "vmctl_vm-native_flags.md" %}}
{{% content "vmctl_vm-native_flags.md" %}}