Cluster Features
Advantages:- High availability and strong disaster recovery capability
- Supports online scaling
- Real-time automatic backup between multiple replicas
- Load balancing
- Slightly complex deployment
- Requires multiple machines
Cluster Principle: WuKongIM follows the
2n+1 principle, where n represents the number of nodes allowed to fail.- Allow 1 machine to fail: requires 3 machines (2×1+1=3)
- Allow 2 machines to fail: requires 5 machines (2×2+1=5)
Environment Requirements
- Number of machines: 4 or more
- Operating System: Linux (Ubuntu recommended)
- Configuration: 2 cores 4GB or 4 cores 8GB
- Docker: Version 24.0.4 or above
Deployment Steps
1. Install Load Balancer and Monitoring
Create installation directory on thegateway node:
docker-compose.yml file:
nginx.conf file (replace IP addresses with actual addresses):
prometheus.yml file (replace IP addresses with actual addresses):
2. Install WuKongIM Nodes
Create installation directory on all WuKongIM nodes:3. Start Services
Startup Order:- First start load balancer and monitoring:
- Then start all WuKongIM nodes:
4. Verify Deployment
Check service status:- Demo Interface: http://119.45.33.109:15172
- Management Interface: http://119.45.33.109:15300
- Monitoring Interface: http://119.45.33.109:9090
- API Address: http://119.45.33.109:15001
Configuration Description
Key Environment Variables
Port Description
Troubleshooting
Common Issues
Node cannot join cluster:Log Viewing
Scaling Operations
Adding new nodes to existing cluster:- Create configuration file on new node
- Set new node ID
- Update
WK_CLUSTER_INITNODESto include new node - Start new node service
- Update load balancer configuration
Next Steps
Server Configuration
Configure cluster authentication and performance optimization
Cluster Configuration
Detailed cluster configuration guide
Single Node Deployment
Learn about single node deployment
API Documentation
Start using WuKongIM API

