Skip to main content
WuKongIM multi-node cluster provides high availability, disaster recovery capability and load balancing, suitable for large applications with high data security requirements.

Cluster Features

Advantages:
  • High availability and strong disaster recovery capability
  • Supports online scaling
  • Real-time automatic backup between multiple replicas
  • Load balancing
Disadvantages:
  • 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
Example server configuration:

Deployment Steps

1. Install Load Balancer and Monitoring

Create installation directory on the gateway node:
Create docker-compose.yml file:
Create nginx.conf file (replace IP addresses with actual addresses):
Create prometheus.yml file (replace IP addresses with actual addresses):

2. Install WuKongIM Nodes

Create installation directory on all WuKongIM nodes:
Node 1 Configuration (replace IP addresses with actual addresses):
Node 2 Configuration (replace IP addresses with actual addresses):
Node 3 Configuration (replace IP addresses with actual addresses):

3. Start Services

Startup Order:
  1. First start load balancer and monitoring:
  1. Then start all WuKongIM nodes:

4. Verify Deployment

Check service status:
Verify cluster status:
Access services:

Configuration Description

Key Environment Variables

Port Description

Troubleshooting

Common Issues

Node cannot join cluster:
Load balancer cannot be accessed:
Monitoring data anomaly:

Log Viewing

Scaling Operations

Adding new nodes to existing cluster:
  1. Create configuration file on new node
  2. Set new node ID
  3. Update WK_CLUSTER_INITNODES to include new node
  4. Start new node service
  5. 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