alloydb-postgres-replication
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseUsage
使用方法
All scripts can be executed using Node.js. Replace and with actual values.
<param_name><param_value>Bash:
node <skill_dir>/scripts/<script_name>.js '{"<param_name>": "<param_value>"}'PowerShell:
node <skill_dir>/scripts/<script_name>.js '{\"<param_name>\": \"<param_value>\"}'Note: The scripts automatically load the environment variables from various .env files. Do not ask the user to set vars unless skill executions fails due to env var absence.
所有脚本均可通过Node.js执行。将和替换为实际值。
<param_name><param_value>Bash:
node <skill_dir>/scripts/<script_name>.js '{"<param_name>": "<param_value>"}'PowerShell:
node <skill_dir>/scripts/<script_name>.js '{\"<param_name>\": \"<param_value>\"}'注意:脚本会自动从多个.env文件加载环境变量。除非因缺少环境变量导致技能执行失败,否则无需要求用户设置变量。
Scripts
脚本
database_overview
database_overview
Fetches the current state of the PostgreSQL server, returning the version, whether it's a replica, uptime duration, maximum connection limit, number of current connections, number of active connections, and the percentage of connections in use.
获取PostgreSQL服务器的当前状态,返回版本信息、是否为副本实例、运行时长、最大连接限制、当前连接数、活跃连接数以及连接使用率百分比。
get_instance
get_instance
Retrieves details about a specific AlloyDB instance.
检索特定AlloyDB实例的详细信息。
Parameters
参数
| Name | Type | Description | Required | Default |
|---|---|---|---|---|
| project | string | The GCP project ID. This is pre-configured; do not ask for it unless the user explicitly provides a different one. | No | |
| location | string | The location of the instance (e.g., 'us-central1'). | Yes | |
| cluster | string | The ID of the cluster. | Yes | |
| instance | string | The ID of the instance. | Yes |
| 名称 | 类型 | 描述 | 是否必填 | 默认值 |
|---|---|---|---|---|
| project | string | GCP项目ID。该参数已预先配置;除非用户明确提供不同的ID,否则无需询问。 | 否 | |
| location | string | 实例所在区域(例如:'us-central1')。 | 是 | |
| cluster | string | 集群ID。 | 是 | |
| instance | string | 实例ID。 | 是 |
list_instances
list_instances
Lists all AlloyDB instances in a given project, location and cluster.
列出指定项目、区域和集群中的所有AlloyDB实例。
Parameters
参数
| Name | Type | Description | Required | Default |
|---|---|---|---|---|
| project | string | The GCP project ID. This is pre-configured; do not ask for it unless the user explicitly provides a different one. | No | |
| location | string | Optional: The location of the cluster (e.g., 'us-central1'). Use '-' to get results for all regions.(Default: '-') | No | |
| cluster | string | Optional: The ID of the cluster to list instances from. Use '-' to get results for all clusters.(Default: '-') | No | |
| 名称 | 类型 | 描述 | 是否必填 | 默认值 |
|---|---|---|---|---|
| project | string | GCP项目ID。该参数已预先配置;除非用户明确提供不同的ID,否则无需询问。 | 否 | |
| location | string | 可选:集群所在区域(例如:'us-central1')。使用'-'可获取所有区域的结果。(默认值:'-') | 否 | |
| cluster | string | 可选:要列出实例的集群ID。使用'-'可获取所有集群的结果。(默认值:'-') | 否 | |
list_publication_tables
list_publication_tables
Parameters
参数
| Name | Type | Description | Required | Default |
|---|---|---|---|---|
| table_names | string | Optional: Filters by a comma-separated list of table names. | No | `` |
| publication_names | string | Optional: Filters by a comma-separated list of publication names. | No | `` |
| schema_names | string | Optional: Filters by a comma-separated list of schema names. | No | `` |
| limit | integer | Optional: The maximum number of rows to return. | No | |
| 名称 | 类型 | 描述 | 是否必填 | 默认值 |
|---|---|---|---|---|
| table_names | string | 可选:按逗号分隔的表名列表进行过滤。 | 否 | `` |
| publication_names | string | 可选:按逗号分隔的发布名称列表进行过滤。 | 否 | `` |
| schema_names | string | 可选:按逗号分隔的模式名称列表进行过滤。 | 否 | `` |
| limit | integer | 可选:返回的最大行数。 | 否 | |
list_replication_slots
list_replication_slots
List key details for all PostgreSQL replication slots (e.g., type, database, active status) and calculates the size of the outstanding WAL that is being prevented from removal by the slot.
列出所有PostgreSQL复制槽的关键详情(例如:类型、数据库、活跃状态),并计算该槽阻止删除的未处理WAL的大小。
replication_stats
replication_stats
Lists each replica's process ID, user name, application name, backend_xmin (standby's xmin horizon reported by hot_standby_feedback), client IP address, connection state, and sync_state, along with lag sizes in bytes for sent_lag (primary to sent), write_lag (sent to written), flush_lag (written to flushed), replay_lag (flushed to replayed), and the overall total_lag (primary to replayed).
列出每个副本的进程ID、用户名、应用名称、backend_xmin(由hot_standby_feedback报告的备用实例xmin范围)、客户端IP地址、连接状态和sync_state,以及各类延迟的字节数:sent_lag(主节点到已发送)、write_lag(已发送到已写入)、flush_lag(已写入到已刷新)、replay_lag(已刷新到已重放),以及总延迟total_lag(主节点到已重放)。