-
Notifications
You must be signed in to change notification settings - Fork 305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a new chart for multi-AZ setup #789
Comments
Thanks for creating the issue @Haleygo! |
Hi, I'm wondering the data consistency between the two AZ should be considered in this setup. The data ingestion cannot be 100% same for the two clusters, imagine a scenario like this: the first query goes to AZ 1, then the second query goes to AZ 2, if there is a ingestion lag in AZ 2, user may find that second query lacks partial result of first query. It’s confusing and can also make alerts false. |
Hi @chenlujjj ,
It doesn't just exist in multi-az set up, but could happen in any single vmcluster. If you have ingestion lag, let say 1min, caused by slow ingestion or slow network, vmalert which uses The same goes here, since vmagent sends identical data to multiple zones and vmselect has |
@Haleygo Thanks for the detailed explanation |
@chenlujjj it is expected that all queries will stick to one AZ (see vmauth hot-standby mode). And will switch to different AZ only if the first AZ responded with unrecoverable error (parital result or service unavailability). When you stick to the same datasource, there will be no discrepancy for a user. A discrepancy might appear in the case of fallback to another AZ, but it is expected that by the time this happens, system administrator will detect and fix "if there is a ingestion lag in AZ 2" problem. |
This is not the case in the reference diagram; there is a vmauth hot-standby in both AZs and the load balancer is balancing queries across both AZs. So the scenario outlined where queries are initially routed to separate AZs is not solved as even with the vmauth hot-standby sticking to the local cluster, that preference is only after the initial routing to one of the AZs. If we were to routing all queries to one AZ only and falling back to the other AZ it would defeat the point of the hot-standby vmauths. So outside of fixing the root cause of the lag or adjusting parameters, as per @Haleygo, I don't think there is another solution? |
Right. The balancer is there to provide a single endpoint for accessing the service. The diagram doesn't mention it, but it is expected that this balancer will be configured by the user according to their priorities and environment. With two AZ it is always better to stick to one of the AZs until it fails. The sticking logic could be based on geospatial info (using geographically closest AZ), for example.
|
Thank you for the detailed response @hagen1778! In that case, a couple of questions:
So instead of two clusters that are balanced, it's two clusters where one is a backup, but insertions are replicated in both so if the main cluster fails then insertions and queries switch to the backup AZ, vmstorage nodes scale up, and all of the data is already there due to the replication? |
It is for querying. For insertion, latency, freshness, etc doesn't matter that much.
This makes sense. HPA should work pretty well here for vmselects.
Precisely. If we imagine our two AZs are in different US states, or one in US and another in EU - it makes sense to read from the closest one. Btw, if you also have two teams using the service: one in US and second in EU - both of them could read data from the closest AZ. And both of them would have consistent data for subsequent requests. |
For now, we provide charts like victoria-metrics-cluster and victoria-metrics-k8s-stack to create a customize vmcluster instance with other optional components like vmalert. But there are cases where users want to setup multiple availability zone with one release, a new chart like victoria-metrics-cluster-distributed could help.
Describe alternatives you've considered
Install victoria-metrics-k8s-stack chart per available zone with different
affinity
for components.Additional information
mimir-distributed supports zoneAwareReplication.
The text was updated successfully, but these errors were encountered: