[#37] 测试NixOS部署server通过
This commit is contained in:
48
deployment/build/templates/docs/INSTALL_SERVER.md
Normal file
48
deployment/build/templates/docs/INSTALL_SERVER.md
Normal file
@@ -0,0 +1,48 @@
|
||||
# Argus Server Offline Installation
|
||||
|
||||
## Prerequisites
|
||||
- Linux x86_64 (Ubuntu 22.04 recommended; see OS compatibility for NixOS)
|
||||
- Docker & Docker Compose installed
|
||||
- Open ports: 32300, 9200, 5601, 9090, 9093, 8080..8085, 21, 20, 21100–21110 (or auto-fallback to high ports)
|
||||
|
||||
## Quick Start
|
||||
1. Extract to a target dir, e.g. `/opt/argus-deploy/versions/<YYYYMMDD>`
|
||||
2. `cd scripts && sudo ./server-prepare-dirs.sh`
|
||||
3. `./server-install.sh`
|
||||
4. `./server-status.sh`
|
||||
5. `./server-selfcheck.sh` (on failure it auto-runs diagnose and writes logs under `logs/`)
|
||||
6. `./server-uninstall.sh` to tear down
|
||||
|
||||
## What the Installer Does
|
||||
- Loads local images (`images/all-images.tar.gz`)
|
||||
- Generates OS-compat override (`security_opt: ["label=disable"]`, `userns_mode: host`, bind `tmpfs:/run/named`)
|
||||
- Starts server-only services: bind/master/es/kibana/ftp/prometheus/grafana/alertmanager/web-frontend/web-proxy
|
||||
- DNS Bootstrap:
|
||||
- Ensure `/private/argus/etc/dns.conf` exists (write `172.31.0.2` if missing);
|
||||
- Run `/private/argus/etc/update-dns.sh` in dependent containers so `/etc/resolv.conf` points to bind;
|
||||
- Wait for `*.argus.com` hint files, then reload bind;
|
||||
- Restart web‑proxy to re-render nginx resolver from `dns.conf`;
|
||||
- Writes `logs/selfcheck.json` as final summary
|
||||
|
||||
## OS Compatibility
|
||||
- NixOS / non-xattr FS: containers run with `security_opt: ["label=disable"]` and `userns_mode: host`; ensure data dirs are pre-created via `sudo ./server-prepare-dirs.sh` and owned by runtime UID:GID (default 1000:1000).
|
||||
|
||||
## Files & Layout
|
||||
- `compose/` (docker-compose.yml, .env)
|
||||
- `private/` (data mounts)
|
||||
- `scripts/` (install/uninstall/status/selfcheck/diagnose)
|
||||
- `logs/` (selfcheck + diagnose outputs)
|
||||
|
||||
## Troubleshooting (Quick)
|
||||
- Run `./server-selfcheck.sh` → see `logs/selfcheck.json`
|
||||
- Run `./server-diagnose.sh` → produces timestamped logs:
|
||||
- `logs/diagnose_details_YYYYMMDD-HHMMSSZ.log`
|
||||
- `logs/diagnose_error_YYYYMMDD-HHMMSSZ.log`
|
||||
And updates `diagnose_details.log`/`diagnose_error.log` to the latest
|
||||
- Error lines are tagged `[service][source]`, e.g. `[kibana][http] /api/status=503`
|
||||
|
||||
Common issues:
|
||||
- Kibana 503: wait cold start or fix DNS so `es.log.argus.com` resolves
|
||||
- web‑proxy 504: check nginx `resolver` includes `172.31.0.2 127.0.0.11`
|
||||
- EACCES/locks: ensure `sudo ./server-prepare-dirs.sh` ran and ownership matches UID:GID
|
||||
|
||||
28
deployment/build/templates/docs/INSTALL_SERVER_zh.md
Normal file
28
deployment/build/templates/docs/INSTALL_SERVER_zh.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# Argus 服务端离线安装指南
|
||||
|
||||
## 先决条件
|
||||
- Linux x86_64(推荐 Ubuntu 22.04;NixOS 见“兼容说明”)
|
||||
- 已安装 Docker 与 Docker Compose
|
||||
- 端口:32300, 9200, 5601, 9090, 9093, 8080..8085, 21, 20, 21100–21110
|
||||
|
||||
## 快速开始
|
||||
1. 解压到目标目录(例如 `/opt/argus-deploy/versions/<YYYYMMDD>`)
|
||||
2. 进入 `scripts/`:`sudo ./server-prepare-dirs.sh`
|
||||
3. 安装:`./server-install.sh`
|
||||
4. 状态:`./server-status.sh`
|
||||
5. 自检:`./server-selfcheck.sh`(失败会自动采集诊断)
|
||||
6. 卸载:`./server-uninstall.sh`
|
||||
|
||||
## 安装流程要点
|
||||
- 仅启动 10 个服务端组件(不包含测试节点);
|
||||
- DNS Bootstrap:补齐首次部署 DNS 依赖(生成/确认 `dns.conf`、统一容器 resolv.conf、写入 `*.argus.com`、reload bind、重启 web‑proxy);
|
||||
- 输出自检结果到 `logs/selfcheck.json`。
|
||||
|
||||
## 兼容说明(NixOS 等)
|
||||
- 使用 `security_opt: ["label=disable"]` 与 `userns_mode: host`;
|
||||
- 先运行 `sudo ./server-prepare-dirs.sh` 创建/授权目录为 `1000:1000`;
|
||||
|
||||
## 故障排查(见下文 Troubleshooting_zh)
|
||||
- `./server-selfcheck.sh` → `logs/selfcheck.json`
|
||||
- `./server-diagnose.sh` → `logs/diagnose_error_*.log` / `logs/diagnose_details_*.log`
|
||||
|
||||
21
deployment/build/templates/docs/TROUBLESHOOTING.md
Normal file
21
deployment/build/templates/docs/TROUBLESHOOTING.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# Troubleshooting
|
||||
|
||||
- Status: `scripts/server-status.sh`
|
||||
- Selfcheck: `scripts/server-selfcheck.sh`
|
||||
- Diagnose: `scripts/server-diagnose.sh`
|
||||
|
||||
Outputs:
|
||||
- `logs/selfcheck.json`
|
||||
- `logs/diagnose_details_*.log` (full details)
|
||||
- `logs/diagnose_error_*.log` (tagged errors)
|
||||
|
||||
Web‑Proxy:
|
||||
- 8083 expects 200/302/403; 8084/8085 must include CORS header
|
||||
- nginx resolver should be `172.31.0.2 127.0.0.11`
|
||||
|
||||
Kibana/ES:
|
||||
- Verify `es.log.argus.com` resolves inside Kibana
|
||||
|
||||
Permissions:
|
||||
- Ensure `sudo ./server-prepare-dirs.sh` ran and ownership matches runtime UID:GID
|
||||
|
||||
15
deployment/build/templates/docs/TROUBLESHOOTING_zh.md
Normal file
15
deployment/build/templates/docs/TROUBLESHOOTING_zh.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# 故障排查
|
||||
|
||||
- 状态:`scripts/server-status.sh`
|
||||
- 自检:`scripts/server-selfcheck.sh`
|
||||
- 诊断:`scripts/server-diagnose.sh`
|
||||
|
||||
输出:
|
||||
- `logs/selfcheck.json`
|
||||
- `logs/diagnose_error_*.log`(错误摘要)
|
||||
- `logs/diagnose_details_*.log`(详细信息)
|
||||
|
||||
Web‑Proxy:8083=200/302/403;8084/8085 需包含 CORS
|
||||
Kibana:确认可解析 `es.log.argus.com`
|
||||
权限:先运行 `sudo ./server-prepare-dirs.sh`
|
||||
|
||||
Reference in New Issue
Block a user