mcserver/docs/operations-manual.md
2026-08-10 14:24:14 -04:00

103 lines
3.1 KiB
Markdown

# Server Operations & Administration Manual
## 1. Instance Target Context
Set the active container target in your shell session:
```bash
export INSTANCE_NAME="mc_forge_server"
```
---
## 2. Data Preservation Reference Matrix
When performing world resets or maintenance, classify directories according to this matrix:
| Category | Directory / File Path | Purpose | Action on Reset |
| :--- | :--- | :--- | :--- |
| **Immutable** | `data/config/` | Mod configuration files | **Preserve** |
| **Immutable** | `data/mods/` | Server mod JAR files | **Preserve** |
| **Immutable** | `data/server.properties` | Generated server settings | **Preserve** |
| **Immutable** | `data/eula.txt` | EULA agreement file | **Preserve** |
| **Volatile** | `data/world/` | Dynamic terrain & player data | Delete to reset seed |
| **Volatile** | `data/logs/` | Server console log files | Safe to purge |
| **Volatile** | `data/crash-reports/` | Crash stack traces | Safe to purge |
| **Volatile** | `data/simplebackups/` | World backup archives | Store or purge |
| **Volatile** | `data/.cache/` | Mod resource cache | Safe to purge |
| **Volatile** | `data/modernfix/` | Structure cache files | Safe to purge |
---
## 3. Lifecycle & Reset Workflows
### Clean World Reset (Preserving Configs & Mods)
```bash
docker stop $INSTANCE_NAME
mv data/world data/world_backup_$(date +%Y%m%d_%H%M%S)
docker start $INSTANCE_NAME
```
### Targeted Dimensional Wipes
```bash
docker stop $INSTANCE_NAME
rm -rf data/world/DIM-1 # Nether
rm -rf data/world/DIM1 # End
docker start $INSTANCE_NAME
```
### Full Nuclear Server Reset
```bash
docker compose down
rm -rf data/world data/logs/* data/crash-reports/* data/.cache data/modernfix/structureCacheV1 data/usercache.json data/banned-players.json data/banned-ips.json data/ops.json
docker compose up -d
```
### Host File Ownership Recovery
```bash
sudo chown -R $USER:$USER ./data
chmod -R u+rwX ./data
```
---
## 4. Diagnostics & Telemetry
### Log Filter Pipeline (Errors & Warnings)
```bash
docker logs $INSTANCE_NAME 2>&1 | grep -iE "ERROR|WARN|Exception|Fatal|Failed|Caused by" | tail -n 60
```
### Health & Container Status Check
```bash
docker ps -f "name=$INSTANCE_NAME" --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}"
```
---
## 5. RCON Command Reference
### Chunky Pre-Generation
```bash
docker exec -i $INSTANCE_NAME rcon-cli "chunky shape circle"
docker exec -i $INSTANCE_NAME rcon-cli "chunky center 0 0"
docker exec -i $INSTANCE_NAME rcon-cli "chunky radius 4000"
docker exec -i $INSTANCE_NAME rcon-cli "chunky start"
docker exec -i $INSTANCE_NAME rcon-cli "chunky progress"
```
### Performance Profiling (spark)
```bash
docker exec -i $INSTANCE_NAME rcon-cli "spark profiler --timeout 30"
docker exec -i $INSTANCE_NAME rcon-cli "spark healthreport"
```
### Claim Management (FLAN)
```bash
docker exec -i $INSTANCE_NAME rcon-cli "flan reload"
```
### Moderation & Player Control
```bash
docker exec -i $INSTANCE_NAME rcon-cli "whitelist add <player>"
docker exec -i $INSTANCE_NAME rcon-cli "tp <player1> <player2>"
docker exec -i $INSTANCE_NAME rcon-cli "gamerule keepInventory true"
```