This runbook is for a single-node server that persists to local files under data/.
It assumes a trusted/internal network (plain sockets, no TLS).
data/users.json(user store)data/games/*.json(game store)data/server-state.json(heartbeat/state)logs/(server logs)
java -jar server/target/chess-server.jar \
-Dchess.data.dir=data \
-Dchess.server.port=5000
Use the process manager / OS signal:
- Windows: stop the process from Task Manager or your service wrapper
- Linux:
SIGTERMto the server PID
- Stop the server (graceful).
- Start the server with the same
chess.data.dir. - Verify logs show:
Chess server starting...
Use the backup script to create a timestamped zip and enforce retention:
.\scripts\backup-rotate.ps1 -DataDir data -BackupDir backups -Retain 7 -Build
Retention policy: keep the most recent 7 backups in backups/ and delete older ones.
Store backups off the host if you need disaster recovery.
- Stop the server.
- Restore from a known-good backup:
.\scripts\restore.ps1 -BackupZip backups\chess-data-<timestamp>.zip -DataDir data -Force - Start the server.
- Verify login +
listGamesand check logs for quarantine warnings.
If the server fails to start or you suspect corrupted data:
- Make a backup of
data/first. - Run restore from a known-good backup:
java -cp server/target/chess-server.jar com.example.chess.server.tools.DataBackupTool \ restore backups/chess-data-<timestamp>.zip data --force - Start the server and monitor logs for warnings about quarantined files.
- Bind to a trusted interface only (firewall rules / allowlist).
- Only allow connections from internal networks or a VPN.
- Do not expose port
chess.server.portdirectly to the public internet.
logs/server-*.logrotates by size/count (seeLogconfig).- Watch for:
Metric alertwarningsFailed to persist/Failed to parsefile errorsRejected client connection server overloaded
- Corrupt JSON file: server quarantines it and logs a warning; restore from backup if needed.
- High load: you may see
Rejected client connection; increase thread/queue settings or reduce load. - Disk full: file writes fail; free space and restart.
chess.data.dir(default:data)chess.server.port(default:5000)chess.server.threads.core/chess.server.threads.maxchess.server.queue.capacitychess.socket.maxLineCharschess.socket.readTimeoutMs