Pub Sub increase/decrease 创建或删除新 GAME 实例时的 Cloud SQL 内存
PubSub increase/decrease CloudSQL memory when a new GAE instance is created or removed
部署新的 GAE 实例后,如何为 运行 下面的命令创建 pub/sub 主题?
gcloud sql instances patch <instance_name> --cpu=2 --memory=8GB
负载均衡器删除此实例时使用以下命令?
gcloud sql instances patch <instance_name> --cpu=1 --memory=6GB
第一件事是获取给定服务的实例数量,您可以通过 apps.services.versions.instances.list
method. After that, you should use the Cloud SQL API using curl 来管理实例。
第二部分将是自动化,为此我可以考虑使用 Cloud Scheluder 每 X 时间来触发:
Pub/Sub发布到一个Topic,会触发一个Cloud
函数为运行代码。
定位将要 运行 代码的 App 引擎 HTTP 处理程序
除此之外,请考虑到如果您更改 Cloud SQL 实例,您将遇到几分钟的停机时间。您可以依次创建故障转移、更改它然后执行故障转移。请记住,这会在故障转移期间产生额外费用,而且您将更改云实例的区域。
高可用性为数据冗余创建第二个实例。这意味着主实例通过切换到具有相同数据的较新实例而变得不健康。
如 docs 中所述:
The primary instance fails.
Each second, the primary instance writes to system database as a
heartbeat signal. If multiple heartbeats aren't detected (and the
failover replica is healthy), failover is initiated. This occurs if
the primary instance is unresponsive for approximately 60 seconds or
the primary zone experiences an outage.
Cloud SQL waits for the failover replica to catch up to the primary
instance's state.
The amount of time this step takes is affected by replication lag.
The failover replica is promoted to the primary instance role.
The failover replica now serves data from the secondary zone, and the
primary instance name and IP address move to the old failover replica.
The client application reconnects to the new primary instance without
needing to change its connection string because the primary instance
IP address has moved automatically. To see what zone your instance is
serving data from, go to its Overview page in the GCP Console.
A failover replica is recreated.
The new failover replica retains the incoming failover replica IP
address and is automatically recreated in a healthy zone.
Read replicas are recreated.
New read replicas retain the incoming read replica IP address and are
automatically recreated in a healthy zone.
部署新的 GAE 实例后,如何为 运行 下面的命令创建 pub/sub 主题?
gcloud sql instances patch <instance_name> --cpu=2 --memory=8GB
负载均衡器删除此实例时使用以下命令?
gcloud sql instances patch <instance_name> --cpu=1 --memory=6GB
第一件事是获取给定服务的实例数量,您可以通过 apps.services.versions.instances.list
method. After that, you should use the Cloud SQL API using curl 来管理实例。
第二部分将是自动化,为此我可以考虑使用 Cloud Scheluder 每 X 时间来触发:
Pub/Sub发布到一个Topic,会触发一个Cloud 函数为运行代码。
定位将要 运行 代码的 App 引擎 HTTP 处理程序
除此之外,请考虑到如果您更改 Cloud SQL 实例,您将遇到几分钟的停机时间。您可以依次创建故障转移、更改它然后执行故障转移。请记住,这会在故障转移期间产生额外费用,而且您将更改云实例的区域。
高可用性为数据冗余创建第二个实例。这意味着主实例通过切换到具有相同数据的较新实例而变得不健康。
如 docs 中所述:
The primary instance fails.
Each second, the primary instance writes to system database as a heartbeat signal. If multiple heartbeats aren't detected (and the failover replica is healthy), failover is initiated. This occurs if the primary instance is unresponsive for approximately 60 seconds or the primary zone experiences an outage.
Cloud SQL waits for the failover replica to catch up to the primary instance's state.
The amount of time this step takes is affected by replication lag.
The failover replica is promoted to the primary instance role.
The failover replica now serves data from the secondary zone, and the primary instance name and IP address move to the old failover replica. The client application reconnects to the new primary instance without needing to change its connection string because the primary instance IP address has moved automatically. To see what zone your instance is serving data from, go to its Overview page in the GCP Console.
A failover replica is recreated.
The new failover replica retains the incoming failover replica IP address and is automatically recreated in a healthy zone.
Read replicas are recreated.
New read replicas retain the incoming read replica IP address and are automatically recreated in a healthy zone.