deployment
约 319 字大约 1 分钟
Docker 一键部署
BigPeng大鹏提供完整的 Docker Compose 部署方案,一键启动所有核心中间件。
启动步骤
# 克隆代码
git clone https://gitee.com/danilox/bigpeng.git
cd bigpeng
# 启动所有服务
docker-compose up -d
# 查看服务状态
docker ps服务列表
| 服务 | 端口 | 说明 |
|---|---|---|
| Etcd | 2379 | 服务发现/配置中心 |
| MySQL | 3306 | 业务数据库 |
| DragonflyDB | 6379 | 高性能分布式缓存 |
| Redis | 6379 | 缓存/会话存储(备选) |
| Prometheus | 9090 | 指标采集/存储 |
| Grafana | 3000 | 监控可视化 |
| Jaeger | 16686 | 全链路追踪 |
构建服务
编译 Release 版本
cd bigpeng-auth
cargo build --release启动服务
./target/release/bigpeng-auth生产部署
Kubernetes 部署
BigPeng大鹏支持 K3s 轻量 Kubernetes 编排:
# 部署到 K3s
kubectl apply -f k8s/CI/CD
使用 GitHub Actions 实现自动化构建和部署:
name: Build and Deploy
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build
run: cargo build --release
- name: Deploy
run: ./scripts/deploy.sh监控告警
Prometheus 配置
scrape_configs:
- job_name: 'bigpeng'
static_configs:
- targets: ['localhost:8080']Grafana 仪表板
导入预定义的仪表板 JSON 文件,实现可视化监控。
日志管理
日志格式
{
"timestamp": "2026-03-22T10:00:00Z",
"level": "INFO",
"message": "Request processed",
"service": "bigpeng-gateway",
"request_id": "abc123"
}日志收集
使用 Fluentd 收集日志,发送到 Elasticsearch 或 Loki。
