在 GCP 上为 cassandra 升级 VM

upgrade VM for cassandra on GCP

我正在将我的 MVP 应用程序移至 GCP。它是具有标准数据库工作负载 (CRUD) 的通用 Web 应用程序。我正在使用 cassandraplay,每个都有自己的 docker 图像。我不希望开始时有太多流量,因此希望从较小的 VM 开始以保持低成本。我还使用 kubernetes 运算符来表示 Cassandra - https://github.com/datastax/cass-operator

当流量负载增加时,是否可以稍后为 Cassandra 更改机器配置(CPU、磁盘大小)?我是否必须在升级时完全停止应用程序,还是可以进行滚动升级?

任何关于以后如何进行升级的提示都将不胜感激。

是的,使用 GKE 集群时可以稍后更改机器配置而无需停机。

查看文档 Migrating workloads to different machine types:

A node pool is a subset of machines that all have the same configuration, including machine type (CPU and memory) authorization scopes. Node pools represent a subset of nodes within a cluster; a container cluster can contain one or more node pools.

When you need to change the machine profile of your Compute Engine cluster, you can create a new node pool and then migrate your workloads over to the new node pool.

To migrate your workloads without incurring downtime, you need to:

  • Mark the existing node pool as unschedulable.
  • Drain the workloads running on the existing node pool.
  • Delete the existing node pool.

Kubernetes, which is the cluster orchestration system of GKE clusters, automatically reschedules the evicted Pods to the new node pool as it drains the existing node pool.

Note: This tutorial is only applicable if your container does not have Cluster Autoscaling enabled. If the Autoscaler adds or removes nodes while you are attempting a migration, you might not be able to mark all the nodes in the pool as unschedulable and drain them properly.

详细的分步说明以及文档中提供的命令和示例。要禁用集群自动缩放,您可以按照文档 Disabling autoscaling for an existing node pool:

gcloud container clusters update cluster-name --no-enable-autoscaling \
    --node-pool pool-name [--zone compute-zone --project project-id]