← スキル一覧に戻る

postgresql-replication
by pluginagentmarketplace
PostgreSQL developer roadmap plugin with database patterns and query optimization
⭐ 1🍴 0📅 2026年1月5日
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
PostgreSQL Replication Skill
Atomic skill for streaming replication
Overview
Production-ready patterns for streaming replication, monitoring, and failover with Patroni.
Prerequisites
- PostgreSQL 16+
- Multiple server nodes
- Network connectivity
Parameters
parameters:
operation:
type: string
required: true
enum: [setup_primary, setup_replica, monitor, failover]
replication_mode:
type: string
enum: [async, sync]
default: async
Quick Reference
Primary Setup
-- 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');
Replica Setup
pg_basebackup -h primary -D /data -U replicator -v -P -R
Monitor Lag
-- On primary
SELECT client_addr, state,
pg_size_pretty(pg_wal_lsn_diff(sent_lsn, replay_lsn)) as lag
FROM pg_stat_replication;
-- On replica
SELECT pg_is_in_recovery(), pg_last_wal_replay_lsn();
Patroni HA
scope: cluster
bootstrap:
dcs:
ttl: 30
maximum_lag_on_failover: 1048576
Replication Modes
| Mode | Data Safety | Latency |
|---|---|---|
| async | Possible loss | Low |
| sync | No loss | Higher |
Troubleshooting
| Problem | Cause | Solution |
|---|---|---|
| Lag increasing | Slow replica | Check I/O |
| Slot inactive | Replica down | Drop old slot |
| Failover failed | etcd issue | Check cluster |
Usage
Skill("postgresql-replication")
スコア
総合スコア
60/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です