Skip to content

deployment

约 319 字大约 1 分钟

Docker 一键部署

BigPeng大鹏提供完整的 Docker Compose 部署方案,一键启动所有核心中间件。

启动步骤

# 克隆代码
git clone https://gitee.com/danilox/bigpeng.git
cd bigpeng

# 启动所有服务
docker-compose up -d

# 查看服务状态
docker ps

服务列表

服务端口说明
Etcd2379服务发现/配置中心
MySQL3306业务数据库
DragonflyDB6379高性能分布式缓存
Redis6379缓存/会话存储(备选)
Prometheus9090指标采集/存储
Grafana3000监控可视化
Jaeger16686全链路追踪

构建服务

编译 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。