dbbackup/README.md

32 lines
1.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# dbbackup — 数据库备份与日志同步管理模块
FOMS 平台拆出的独立模块之一。松耦合设计:表 `cluster_id` 仅存字符串 ID不建外键
不 import foms 核心代码,可独立部署测试。
## 职责
| 功能 | 表 | 说明 |
|---|---|---|
| 数据库复制binlog 日志同步) | `dbbackup_replications` | MySQL 主从复制配置,原 `sync_databases` |
| 备份任务 | `dbbackup_jobs` | 全量/增量、cron、保留期、存储位置 |
| 备份记录 | `dbbackup_records` | 大小/耗时/校验/可恢复性 |
## 端点
| 端点 | 说明 |
|---|---|
| `/dbbackup/api/agent_report_db_health.dspy` | Agent 上报复制状态 |
| `/dbbackup/api/run_backup.dspy` | 触发备份 |
| `/dbbackup/api/report_backup_result.dspy` | Agent 上报备份结果 |
| `/dbbackup/api/cleanup_expired_backups.dspy` | 清理过期备份 |
## 加载
```python
from dbbackup.init import load_dbbackup
def init():
load_dbbackup()
```
所有表共享宿主应用数据库(`get_module_dbname('dbbackup')`)。