vitess-operator
vitess-operator copied to clipboard
how to restore a cluster in case of failure
Hello. Very interesting solution. I have a MySQL server s 3 slave behaves very badly because of this we are looking for a shard solution because the data already reaches 6 TB. I liked Vitess, and the solution on K8S Vitess-operator, although I have not yet been able to fully understand how to do it correctly. I have several questions.
- why Deployment and not Stateful?
- how to restore a cluster in case of failure?
- how to properly configure the MySQL server config that Vtablet runs or does it happen automatically?
- for vtablet I made pv with node affinity like a hotel, but the operator created a few pv for other components automatically, can I control them too?
- in the latest version of “external source” there is an error, but v19. gets connected.
I must say the Vitess documents are good, but the Vitess operator documents are not so good at all.
I'm a fairly new user to Vitess & vitess-operator, but I'll take a crack at these questions:
- The operator is just a stateless operator so a Deployment is fine; what it actually deploys (via. the
VitessClusterCRD) are a mix of Deployments (eg. for vtgate, which is stateless) and managed Pods (it handles creating them per-replica and any failover operations). - To restore individual databases, you can use
vtctldclient RestoreFromBackupand it will use the configured storage. For restoring the entire cluster, this involves restoring both mysqld instances (which are all standalone and have their own volumes) and restoring the the lockserver/topo etcd state, as this is the global state for the entire cluster. I haven't done the lockserver restore yet, but would be interested to see if anyone has any tips and I'll definitely be testing this soon. - Using the operator, you just define keyspaces and it will provision tablets (and their associated mysqld instance), and the operator handles configuring replication, failover, etc.
- Not sure about this? I think the other PV it creates is for backups but these are largely ephemeral AFAIK - would also be good to know about this.
- Not sure what this means