Snowflake Postgres 实例管理

Snowflake Postgres 提供多种实例管理操作,帮助您管理实例。这些操作属于维护形式,旨在确保实例持续运行和安全稳定。

执行实例管理操作需要短暂的服务中断。 请确保您的应用程序能够自动重新连接到数据库。

Note

除非您明确轮换凭证,否则实例的连接字符串在实例管理操作期间将保持不变。

When required to ensure the health of your instance, we may schedule maintenance operations on your behalf (for example, to modify instance storage size).

For a detailed description of how instance maintenance is carried out by our platform, see Snowflake Postgres Maintenance.

可用操作

The following operations are available from the Manage dropdown menu on your instance details page in the dashboard:

分支

You can fork an instance to create a new instance from an existing instance, optionally choosing a point in time to fork from. By default the new instance will be forked from the current state of the source instance. Read more about forking in Snowflake Postgres point-in-time recovery.

修改

要更改现有 Snowflake Postgres 实例的配置,您必须使用已被授予该实例 OWNERSHIP 或 OPERATE 权限的角色。

您可以在影响最小且不更改连接字符串的情况下,就地调整实例大小。在实例调整大小期间,您可以:

  • Change the COMPUTE_FAMILY to a different size.
  • 更改存储容量。支持增加或减少存储大小。
  • 将 Postgres 版本升级至较新的主要版本。

Modifying your instance’s resource configuration or major version requires a failover maintenance. See Snowflake Postgres maintenance failover for more information.

要进行更改,请执行以下操作:

  1. In the navigation menu, select Postgres.
  2. 选择您的实例。
  3. In the Manage menu at the top right, select Modify.
  4. Select the new COMPUTE_FAMILY and/or storage size from the dropdown menus. See Postgres major version upgrades for more information about changing the Postgres version.
  5. Select the Save button to confirm the changes.
Modify a Snowflake Postgres instance

如果为实例设置了维护窗口,则升级维护故障转移将在替换实例准备就绪后的下一个维护窗口执行。如果未设置维护窗口,则替换实例准备就绪后会立即执行升级维护故障转移。

如果您计划减少实例的存储大小,请注意:我们当前要求调整后的存储容量大于或等于当前磁盘使用量的 1.4 倍,以减少告警并避免立即触发扩容。

Important

COMPUTE_FAMILY and STORAGE_SIZE_GB changes made to a primary instance are not also applied to any present read replicas. They require their own Modify operations.

COMPUTE_FAMILY 和 STORAGE_SIZE_GB 变更 适用于 HA 备用,如果为给定实例启用了 HA。对于这些操作,HA 备用实例替换总是在其替换实例准备就绪后立即进行,因为这不需要将其主服务器停机。

Note

For details on how to track the progress of an ongoing Modify operation see the DESCRIBE POSTGRES INSTANCE usage notes.

Postgres 主要版本升级

Changes to an instance’s Postgres major version work via a Snowflake Postgres maintenance failover operation just as with other Modify operations, but there are some important differences where HA and read replica instances are concerned.

Postgres 主要版本升级操作只能应用于主实例。当主实例进行主要版本升级时,通过从主实例升级完成 创建的全新备份重建这些实例,将相同的升级应用于任何现有的只读副本和 HA 实例。

这意味着在运行主实例升级后的全新备份,并根据该备份构建新的 HA 和/或只读副本实例所需的时间内:

  • 主实例将没有有效的 HA 实例存在。
  • While they will remain accessible, read replicas will have stale data since they will not replicate from the primary until their replacement instances are ready.

For more details on Postgres major version upgrade operations, see Postgres major version upgrades.

启用高可用性

When High Availability (HA) is enabled, your instance includes a standby host that replaces the primary if your primary becomes unavailable. You can read more about this in Snowflake Postgres High Availability.

创建副本

You can create a replica of your instance from the dashboard. A replica is a read-only copy of the source instance that is kept in sync with the source instance. Find about more about creating and using replicas in Snowflake Postgres Read Replicas.

实例暂停与恢复

暂停

暂停实例会停用其所运行的虚拟机,同时保留其在存储中的磁盘映像,以便后续恢复实例。实例的常规计费会暂停,但存储成本将继续产生。现有的 10 天备份也会保留。

若有待重启才能应用的操作,这些操作将在实例恢复时应用。

要暂停或恢复 Snowflake Postgres 实例,您必须使用已被授予该实例 OWNERSHIP 或 OPERATE 权限的角色。

Snowflake Postgres 允许您从仪表板暂停实例。

  1. In the navigation menu, select Postgres.
  2. 选择您的实例。
  3. In the Manage menu at the top right, select Suspend.
  4. Click the Suspend button to confirm the action.
Suspend a Snowflake Postgres instance

恢复

您随时可以恢复已暂停的实例。恢复实例所需的时间取决于实例及其数据集的大小。恢复实例后,常规计费和备份也将重新开始。

  1. In the navigation menu, select Postgres.
  2. 选择您的实例。
  3. In the Manage menu at the top right, select Resume.
  4. Click the Resume button to confirm the action.
Resume a Snowflake Postgres instance

刷新

Refresh is a instance maintenance operation that will replace your instance without making any changes to its configured resources. Use this to ensure your instance has up-to-date OS security patches, the latest Postgres minor version for its given major version, and works properly with the latest Snowflake Postgres features.

  1. In the navigation menu, select Postgres.
  2. 选择您的实例。
  3. In the Manage menu at the top right, select Refresh.
  4. If you want the Refresh maintenance failover to occur as soon as the replacement server is ready, select Bypass maintenance Window and apply immediately.
  5. Click the Refresh button to confirm the action.
Refresh a Snowflake Postgres instance

Note

For details on how to track the progress of an ongoing Refresh operation, see the DESCRIBE POSTGRES INSTANCE usage notes.

重新启动服务

You can restart either PostgreSQL or the underlying server that runs your Postgres instance if needed. This type of instance management operation restarts the server in-place, without creating a replica or performing a fail-over. Read more about restarting services in Snowflake Postgres maintenance restart.

重新生成凭据

Regenerating credentials will return a new connection string for your database instance, replacing the existing credentials. Read more about this topic in Snowflake Postgres Roles.

自定义配置参数

You can make changes to many of Postgres’s own server settings for your Snowflake Postgres instances. You can see the list of available configuration parameters in Snowflake Postgres Server Settings.

要更改 Snowflake Postgres 实例的 Postgres 设置,您必须使用已被授予该实例 OWNERSHIP 或 OPERATE 权限的角色。

要进行更改,请执行以下操作:

  1. In the navigation menu, select Postgres
  2. 选择您的实例
  3. On the right side of the page select the edit icon next to Custom parameters
  4. 从列表中选择配置参数,或使用搜索框查找特定参数
  5. 输入配置参数的新值。
  6. When you’ve finished add new values for parameters, click Continue to review, and then click Submit to confirm the changes.
Example: changing the max_connections configuration parameter for a Snowflake Postgres instance

实例状态

Any instance management operation, whether it’s creating a new instance or modifying an existing one, takes some time to complete. The exact duration depends on many factors, including your data and schema sizes, and how busy your instance is. An instance’s state gives you insight into the progress of an ongoing operation. It is shown in the dashboard, or you can check it by running the DESCRIBE POSTGRES INSTANCE command.

下方列出了可能的实例状态。在实例修改操作期间,替换实例将经历第一张表中列出的所有状态。正在创建的新实例则会经历部分(而非全部)所列状态。下表列出了您在常规操作中可能看到的其他状态。

创建、修改和分支期间出现的状态:

StateWhat’s happeningTypical durationNext state
CreatingA new underlying server is being created1-2 minutesRestoring
RestoringLatest base backup is being restored to the serverVariableStarting
StartingPostgres is being started on the instance and WAL that accumulated during base backup is being appliedVariableReplaying
ReplayingAccumulated WAL since last base backup is being replayedVariableFinalizing
FinalizingInstance configuration is being finalized and the server is being made available1-2 minutesReady
ReadyNew instance matches source instance and is ready for the operation to proceed. If scheduled for an upcoming maintenance window, the instance is kept Ready until that time. If scheduled for now, the operation proceeds once it reaches Ready. Running instances normally show the Ready state.N/AN/A

您可能在平台上看到的其他实例状态:

StateWhat’s happeningTypical durationNext state
RestartingUnderlying server is being restarted1-2 minutesReady
ResumingA new server is being built and a suspended instance is being resumed3-5 minutesReady
SuspendingInstance is being suspended3-5 minutesSuspended
SuspendedInstance is currently suspendedUntil resumedResuming