server-management by davila7/claude-code-templates
npx skills add https://github.com/davila7/claude-code-templates --skill server-management生产环境运维的服务器管理原则。学会思考,而非死记命令。
| 场景 | 工具 |
|---|---|
| Node.js 应用 | PM2 (集群、重载) |
| 任意应用 | systemd (Linux 原生) |
| 容器 | Docker/Podman |
| 编排 | Kubernetes, Docker Swarm |
| 目标 | 含义 |
|---|---|
| 崩溃后重启 | 自动恢复 |
| 零停机重载 | 服务不中断 |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 集群化 | 利用所有 CPU 核心 |
| 持久化 | 服务器重启后存活 |
| 类别 | 关键指标 |
|---|---|
| 可用性 | 运行时间,健康检查 |
| 性能 | 响应时间,吞吐量 |
| 错误 | 错误率,类型 |
| 资源 | CPU,内存,磁盘 |
| 级别 | 响应 |
|---|---|
| 严重 | 立即处理 |
| 警告 | 尽快调查 |
| 信息 | 每日回顾 |
| 需求 | 选项 |
|---|---|
| 简单/免费 | PM2 指标,htop |
| 完整可观测性 | Grafana, Datadog |
| 错误追踪 | Sentry |
| 运行时间 | UptimeRobot, Pingdom |
| 日志类型 | 目的 |
|---|---|
| 应用日志 | 调试,审计 |
| 访问日志 | 流量分析 |
| 错误日志 | 问题检测 |
| 症状 | 解决方案 |
|---|---|
| CPU 使用率高 | 增加实例 (水平扩展) |
| 内存使用率高 | 增加 RAM 或修复内存泄漏 |
| 响应慢 | 先进行性能分析,再扩容 |
| 流量激增 | 自动扩缩容 |
| 类型 | 使用时机 |
|---|---|
| 垂直扩展 | 快速修复,单实例 |
| 水平扩展 | 可持续,分布式 |
| 自动扩缩容 | 流量变化大时 |
| 检查项 | 含义 |
|---|---|
| HTTP 200 | 服务正常响应 |
| 数据库连接正常 | 数据可访问 |
| 依赖项正常 | 外部服务可达 |
| 资源正常 | CPU/内存未耗尽 |
| 领域 | 原则 |
|---|---|
| 访问 | 仅使用 SSH 密钥,禁用密码 |
| 防火墙 | 仅开放所需端口 |
| 更新 | 定期安装安全补丁 |
| 密钥 | 使用环境变量,而非文件 |
| 审计 | 记录访问和变更 |
当出现问题时:
| ❌ 不要 | ✅ 要做 |
|---|---|
| 以 root 身份运行 | 使用非 root 用户 |
| 忽略日志 | 设置日志轮转 |
| 跳过监控 | 从第一天开始监控 |
| 手动重启 | 配置自动重启 |
| 不做备份 | 定期备份计划 |
记住: 管理良好的服务器是枯燥的。这正是目标。
每周安装数
162
代码仓库
GitHub 星标数
22.6K
首次出现
Jan 25, 2026
安全审计
安装于
opencode128
claude-code123
gemini-cli122
codex119
cursor110
github-copilot110
Server management principles for production operations. Learn to THINK, not memorize commands.
| Scenario | Tool |
|---|---|
| Node.js app | PM2 (clustering, reload) |
| Any app | systemd (Linux native) |
| Containers | Docker/Podman |
| Orchestration | Kubernetes, Docker Swarm |
| Goal | What It Means |
|---|---|
| Restart on crash | Auto-recovery |
| Zero-downtime reload | No service interruption |
| Clustering | Use all CPU cores |
| Persistence | Survive server reboot |
| Category | Key Metrics |
|---|---|
| Availability | Uptime, health checks |
| Performance | Response time, throughput |
| Errors | Error rate, types |
| Resources | CPU, memory, disk |
| Level | Response |
|---|---|
| Critical | Immediate action |
| Warning | Investigate soon |
| Info | Review daily |
| Need | Options |
|---|---|
| Simple/Free | PM2 metrics, htop |
| Full observability | Grafana, Datadog |
| Error tracking | Sentry |
| Uptime | UptimeRobot, Pingdom |
| Log Type | Purpose |
|---|---|
| Application logs | Debug, audit |
| Access logs | Traffic analysis |
| Error logs | Issue detection |
| Symptom | Solution |
|---|---|
| High CPU | Add instances (horizontal) |
| High memory | Increase RAM or fix leak |
| Slow response | Profile first, then scale |
| Traffic spikes | Auto-scaling |
| Type | When to Use |
|---|---|
| Vertical | Quick fix, single instance |
| Horizontal | Sustainable, distributed |
| Auto | Variable traffic |
| Check | Meaning |
|---|---|
| HTTP 200 | Service responding |
| Database connected | Data accessible |
| Dependencies OK | External services reachable |
| Resources OK | CPU/memory not exhausted |
| Area | Principle |
|---|---|
| Access | SSH keys only, no passwords |
| Firewall | Only needed ports open |
| Updates | Regular security patches |
| Secrets | Environment vars, not files |
| Audit | Log access and changes |
When something's wrong:
| ❌ Don't | ✅ Do |
|---|---|
| Run as root | Use non-root user |
| Ignore logs | Set up log rotation |
| Skip monitoring | Monitor from day one |
| Manual restarts | Auto-restart config |
| No backups | Regular backup schedule |
Remember: A well-managed server is boring. That's the goal.
Weekly Installs
162
Repository
GitHub Stars
22.6K
First Seen
Jan 25, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode128
claude-code123
gemini-cli122
codex119
cursor110
github-copilot110
Azure Data Explorer (Kusto) 查询技能:KQL数据分析、日志遥测与时间序列处理
119,800 周安装
UI/UX Pro Max:智能设计助手 - 配色、字体、图表、最佳实践一站式数据库
210 周安装
产品战略师工具:自动化OKR级联生成器,实现战略规划与团队对齐
167 周安装
静态代码分析工具配置指南:ESLint、SonarQube集成与安全扫描最佳实践
236 周安装
Binance VIP 借贷 API 使用指南 - 获取利率、抵押数据与借贷管理
686 周安装
PostgreSQL 数据库架构设计模板 - Claude 代码模板库,提升数据库设计效率
210 周安装
合规审查工具 - 自动检查业务计划、产品功能、营销活动的法律合规性 | GDPR/CCPA/HIPAA
425 周安装