用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/pluginagentmarketplace/custom-plugin-postgresql --skill postgresql-replication命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | postgresql-replication |
| description | PostgreSQL streaming replication - setup, monitoring, failover |
| version | 3.0.0 |
| sasmp_version | 1.3.0 |
| bonded_agent | 08-postgresql-devops |
| bond_type | SECONDARY_BOND |
| category | database |
| difficulty | advanced |
| estimated_time | 4h |
Atomic skill for streaming replication
Production-ready patterns for streaming replication, monitoring, and failover with Patroni.
parameters:
operation:
type: string
required: true
enum: [setup_primary, setup_replica, monitor, failover]
replication_mode:
type: string
enum: [async, sync]
default: async
-- postgresql.conf
wal_level = replica
max_wal_senders = 10
max_replication_slots = 10
-- Create replication user
CREATE ROLE replicator WITH REPLICATION LOGIN PASSWORD 'secret';
-- Create slot
SELECT pg_create_physical_replication_slot('replica1');
pg_basebackup -h primary -D /data -U replicator -v -P -R
-- On primary
SELECT client_addr, state,
pg_size_pretty(pg_wal_lsn_diff(sent_lsn, replay_lsn)) as lag
FROM pg_stat_replication;
pg_is_in_recovery(), pg_last_wal_replay_lsn();
scope: cluster
bootstrap:
dcs:
ttl: 30
maximum_lag_on_failover: 1048576
| Mode | Data Safety | Latency |
|---|---|---|
| async | Possible loss | Low |
| sync | No loss | Higher |
| Problem | Cause | Solution |
|---|---|---|
| Lag increasing | Slow replica | Check I/O |
| Slot inactive | Replica down | Drop old slot |
| Failover failed | etcd issue | Check cluster |
Skill("postgresql-replication")
基于 SOC 职业分类