altinity-expert-clickhouse-replication

Diagnoses ClickHouse replication health, Keeper connectivity, replica lag, and queue issues using system tables.

42|7|Updated Dec 26, 2025
One-click install
npx skills add https://github.com/ntk148v/clicklens --skill altinity-expert-clickhouse-replication
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: altinity-expert-clickhouse-replication
Source: https://github.com/ntk148v/clicklens/tree/main/.agent/skills/altinity-expert-clickhouse-replication
Command: npx skills add https://github.com/ntk148v/clicklens --skill altinity-expert-clickhouse-replication

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Diagnoses ClickHouse replication health, Keeper connectivity, replica lag, and queue issues to prevent silent failures and data divergence across clusters.

Core Features & Use Cases

  • Replication health checks: evaluate system.replicas, queue sizes, lag, and failover readiness to identify problematic replicas.
  • Keeper/ZooKeeper diagnostics: verify Keeper connections, session status, and recent errors to maintain quorum and stability.
  • Queue and task analysis: inspect system.replication_queue and related metrics to prioritize remediation of stalled or stuck tasks.
  • Use Case: When a replica becomes readonly or experiences significant lag, run diagnostics to locate root causes and actionable fixes.

Quick Start

Generate a replication health diagnostic report for all ClickHouse replicas in your cluster.

Frequently Asked Questions about altinity-expert-clickhouse-replication

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I diagnose ClickHouse replication lag and readonly replicas?

Diagnose ClickHouse replication lag and readonly replicas by querying system.replicas and system.replication_queue to surface health metrics, identify root causes, and recommend actionable fixes for stalled replication tasks.

What causes a ClickHouse replica to become readonly or experience high lag?

A ClickHouse replica becomes readonly or experiences high lag due to replication queue backlogs and Keeper connectivity issues. Inspecting system.zookeeper_connection and system.replication_queue identifies stalled tasks, session errors, and failover readiness problems.

How to check ClickHouse Keeper connectivity and session status?

Check ClickHouse Keeper connectivity and session status by querying the system.zookeeper_connection table to verify quorum stability, monitor recent session errors, and ensure replication health diagnostics accurately reflect underlying coordination service issues.

How do I fix a stalled ClickHouse replication queue?

Fix a stalled ClickHouse replication queue by inspecting system.replication_queue metrics to prioritize remediation of stuck tasks. Analyzing queue sizes and replica lag locates root causes and applies actionable fixes to restore normal replication.

When do I need to run ClickHouse replication health diagnostics?

Run ClickHouse replication health diagnostics when clusters experience silent failures, data divergence, readonly replicas, or significant backlog in replication tasks. Evaluating failover readiness and Keeper connections prevents severe replication issues across distributed environments.