Deployment and Operations Architecture
About 2 min
Architecture Goals
The deployment architecture focuses on quick delivery, clear dependencies, persistent data, and diagnosable issues. The common commercial edition delivery method is Docker Compose orchestration, including Nginx, Java backend, Redis, MySQL, EMQX, ZLMediaKit, TDengine, and related components. For higher availability and larger scale, combine this with Cluster Edition Docs.
Container Topology
Deployment Modes
| Mode | Scenario | Description |
|---|---|---|
| Docker quick deployment | Demo, testing, low-cost evaluation | Start complete dependencies quickly through Compose |
| Source-code development deployment | Secondary development and integration | Start backend, frontend, databases, and middleware separately |
| Commercial production deployment | Formal delivery | Configure license, domain, SSL, backup, monitoring, and security policies |
| Cluster deployment | High concurrency, high availability, multi-node | Plan server clusters, Web clusters, and load balancing using the cluster docs |
Service Responsibilities
| Service | Responsibility | Operations Focus |
|---|---|---|
| Nginx | Static resources, HTTPS, API reverse proxy, WebSocket proxy | Certificates, paths, timeouts, logs |
| Java backend | Platform APIs, device access, rules, notifications, video callbacks | JVM, logs, upload directory, license file |
| Redis | Cache, sessions, distributed locks | Password, memory, persistence, internal-network access |
| MySQL | Business master data | Initialization, backup, slow SQL, character set |
| EMQX/Netty | MQTT access and message routing | Authentication callback, ACL, connections, ports |
| ZLMediaKit | Stream pulling, forwarding, recording | Hook URL, port ranges, recording directory |
| TDengine | Time-series data storage | Data directory, log directory, disk space |
Port Planning
| Component | Common Ports |
|---|---|
| Nginx | 80, 443 |
| Java backend | 8080, 8081, 5683, 8888, 8889, 5061 |
| EMQX | 1883, 8083, 8084, 18083 |
| Redis | 6379 |
| MySQL | 3306 |
| ZLMediaKit | 554, 1935, 8000, 9000, 10000, 30000-30100 |
| TDengine | 6030, 6041, 6043-6049 |
Only expose necessary ports in production. Databases, Redis, time-series stores, and internal management ports should be restricted to internal networks or security groups.
Persistence and Backup
- Redis, MySQL, TDengine, Nginx logs, upload directories, and video recording directories should be mounted to the host or persistent storage.
- Initialization SQL, upgrade SQL, license files, certificates, and configuration files must be included in the delivery checklist.
- Database backups should be restored regularly in drills to avoid unusable backups.
- Video recordings and time-series data grow quickly, so retention periods and disk-capacity alerts are required.
Launch Checklist
- Domain, SSL certificate, Nginx reverse proxy, and static asset paths have been verified.
- Backend services can access MySQL, Redis, EMQX/Netty, TDengine, and ZLMediaKit.
- Device MQTT/HTTP/CoAP access paths and authentication flows have been verified.
- Rule engine, alarm notifications, video callbacks, and file upload directories are available.
- Log directories, database backup, monitoring indicators, and alarm notifications are configured.
- Commercial license configuration is complete and delivery records are retained.
Troubleshooting Order
- Page unavailable: check Nginx access logs, error logs, and static asset paths first.
- API error: check Java application logs, database connection, and Redis status.
- Device offline: check MQTT Broker, authentication callback, ACL, topics, and firewall.
- Video unavailable: check ZLMediaKit hooks, port mapping, stream URL, and recording directory permissions.
- Startup failure: check mounted directory permissions, port conflicts, container logs, and configuration-file format.
