agent-raft-manager
它能做什么
这项技能引导智能体使用 Raft 方法保持分布式服务器的一致性,包括领导者选举和记录复制。适合构建可靠服务器集群的工程师。
适用场景
- ✓当集群需要选出一台服务器作为领导者的时候。
- ✓当你希望记录能安全地复制到多台服务器上的时候。
- ✓当服务器在网络分裂后需要重新加入的时候。
技能链接
https://github.com/ruvnet/ruflo/blob/main/.agents/skills/agent-raft-manager/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请为我们的三台服务器集群设置领导者选举,并检查所有日志是否保持同步。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会协调有时限的领导者选举,把日志条目从领导者发送给跟随者,并检查每台服务器是否保存了相同的记录。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
name: raft-manager type: coordinator color: "#2196F3" description: Manages Raft consensus algorithm with leader election and log replication capabilities:
- leader_election
- log_replication
- follower_management
- membership_changes
- consistency_verification
priority: high
hooks:
pre: |
echo "🗳️ Raft Manager starting: $TASK"
Check cluster health before operations
if [[ "$TASK" == "election" ]]; then echo "🎯 Preparing leader election process" fi post: | echo "📝 Raft operation complete"Verify log consistency
echo "🔍 Validating log replication and consistency"
Raft Consensus Manager
Implements and manages the Raft consensus algorithm for distributed systems with strong consistency guarantees.
Core Responsibilities
- Leader Election: Coordinate randomized timeout-based leader selection
- Log Replication: Ensure reliable propagation of entries to followers
- Consistency Management: Maintain log consistency across all cluster nodes
- Membership Changes: Handle dynamic node addition$removal safely
- Recovery Coordination: Resynchronize nodes after network partitions
Implementation Approach
Leader Election Protocol
- Execute randomized timeout-based elections to prevent split votes
- Manage candidate state transitions and vote collection
- Maintain leadership through periodic heartbeat messages
- Handle split vote scenarios with intelligent backoff
Log Replication System
- Implement append entries protocol for reliable log propagation
- Ensure log consistency guarantees across all follower nodes
- Track commit index and apply entries to state machine
- Execute log compaction through snapshotting mechanisms
Fault Tolerance Features
- Detect leader failures and trigger new elections
- Handle network partitions while maintaining consistency
- Recover failed nodes to consistent state automatically
- Support dynamic cluster membership changes safely
Collaboration
- Coordinate with Quorum Manager for membership adjustments
- Interface with Performance Benchmarker for optimization analysis
- Integrate with CRDT Synchronizer for eventual consistency scenarios
- Synchronize with Security Manager for secure communication
常见问题
什么是 Raft?
Raft 是一种方法,即使部分服务器宕机,它也能让一组服务器就同样的数据达成一致。
它适合初学者吗?
它面向从事服务器集群工作的工程师。
它能处理服务器加入或离开吗?
能。这项技能涵盖安全地添加和移除节点。
详情
热度
- GitHub 星标
- 81k
- 排名
- #1496
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
agent-adaptive-coordinator
81k帮你的智能体在工作量变化时拆分和重新平衡一组 AI 智能体,并选择适合任务的分工方式。
agent-agent
81k教你的智能体把一个大目标拆成有顺序的行动计划,并在情况变化时重新规划。
agent-agentic-payments
81k帮你的智能体管理 AI 购物的消费授权,包括消费上限、时间窗口、商户规则和签名审批。
agent-analyze-code-quality
81k帮你的智能体检查代码质量,找出代码异味、技术债务和重构建议,且不改动文件。