Files
aiops/docs/quick-start.md
T
Logan.Li e0d652d211 feat: 完善堡垒机与 Agent 智能运维能力
- 支持 Windows Agent 构建、安装脚本和统一上报协议

- 增强 RDP 剪贴板、虚拟盘和文件传输能力

- 新增 AIOps 上下文工具、告警 RCA trace 落库和回放接口

- 重构 docs 模块文档并补充终端、堡垒机、监控、AI Agent 设计
2026-07-05 23:49:36 +08:00

169 lines
3.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.
# 快速开始
## 环境要求
| 工具 | 最低版本 | 说明 |
|------|---------|------|
| Go | 1.24+ | 后端编译(SQLite 需 CGO_ENABLED=1) |
| Node.js | 18+ | 前端构建 |
| npm | 9+ | 包管理 |
| gcc/clang | - | CGO 编译 SQLite |
| Docker | 20+ | 可选,Compose/K8s 部署 |
### 检查环境
```bash
go version
node -v
./run.sh help
```
## 安装
### 1. 克隆仓库
```bash
git clone https://gitee.com/attacker/aiops.git
cd aiops
```
### 2. 安装依赖
```bash
make install
# 或
cd backend && go mod download && cd ..
cd frontend && npm install && cd ..
```
## 本地开发(推荐)
```bash
chmod +x run.sh
./run.sh dev
```
输出示例:
```
[OK] 后端已启动 (PID: ..., 端口: 8080)
[OK] 前端已启动 (PID: ..., 端口: 5173)
```
| 地址 | 说明 |
|------|------|
| http://localhost:5173 | 前端界面(Vite 热重载) |
| http://localhost:8080 | 后端 API |
| http://localhost:8080/version | 版本信息 |
| http://localhost:8080/health | 健康检查 |
### 默认账号
- 用户名:`admin`
- 密码:`123456`
## 常用命令
```bash
./run.sh dev # 启动开发环境
./run.sh stop # 停止
./run.sh restart # 重启
./run.sh status # 查看状态
./run.sh logs # 实时日志
./run.sh help # 完整帮助
```
## 独立二进制(本机试用)
```bash
./run.sh build tag v1.0.0 # 编译到 ./aiops
./aiops version
./aiops --mode local # SQLite + redka,零外部依赖
```
数据文件与二进制同级:`./sqlite3.db`、`./redka.db`。
## Docker Compose(单机演示)
```bash
./run.sh docker up
# 访问 http://localhost:8080
```
## 发版(构建 + 推送镜像)
```bash
docker login
./run.sh release v1.5.0
```
镜像:`lghost/aiops:v1.5.0`
## 日志位置
| 场景 | 日志 |
|------|------|
| 本地开发后端 | `backend/logs/server.log` |
| 本地开发前端 | `frontend/logs/dev.log` |
| 独立二进制 | `logs/aiops.log` |
| Docker | `./run.sh docker logs` |
## 数据库
### 开发模式
默认 SQLite,数据库由后端自动迁移(AutoMigrate)。
### local 二进制模式
```bash
./aiops --mode local
# sqlite3.db / redka.db 在项目根目录
```
### 重置 local 数据
```bash
./run.sh binary stop
rm -f sqlite3.db redka.db
./run.sh binary upgrade
```
## 常见问题
### CGO 编译失败
```bash
export CGO_ENABLED=1
export GOPROXY=https://goproxy.cn,direct
```
### Go 模块下载慢
```bash
export GOPROXY=https://goproxy.cn,direct
export GOTOOLCHAIN=local
```
### 端口被占用
```bash
./run.sh stop
# 或
lsof -ti:8080 | xargs kill -9
lsof -ti:5173 | xargs kill -9
```
### Mac 编译的二进制无法在 Linux 运行
`./run.sh build` 在 Mac 上产出 darwin 二进制。Linux 部署请使用:
- `./run.sh release v1.x`(Docker 镜像)
- 或在 Linux 服务器上执行 `./run.sh build`
## 下一步
- [部署指南](./deployment.md) — 生产环境、版本管理、K8s
- [开发规范](./development-guide.md) — 代码规范
- [API 接口](./reference/api-reference.md) — 后端 API