Multi-Node Mode
Description
Applicable scenarios: Applications with high data security requirements, large applications. Advantages: High availability, strong disaster recovery, supports online scaling, real-time automatic backup between multiple replicas, load balancing, etc. Disadvantages: Slightly complex deployment, requires multiple machines. WuKongIM cluster follows the2n+1 principle, where n represents the number of allowed failures. For example, to allow 1 machine to fail without affecting normal service operation requires 2×1+1=3 machines in the cluster; to allow 2 machines to fail without affecting normal service operation requires 2×2+1=5 machines in the cluster, and so on.
Environment Requirements
- Number of machines: 3 or more
- Operating System: Linux (Ubuntu recommended) (Recommended configuration: 2 cores 4GB or 4 cores 8GB)
- Load Balancer: nginx (recommended version 1.27.0 or above)
| Name | Internal IP | External IP |
|---|---|---|
| node1(1001) | 10.206.0.13 | 119.45.229.172 |
| node2(1002) | 10.206.0.14 | 129.211.213.76 |
| node3(1003) | 10.206.0.8 | 1.13.191.138 |
Preparation
You need to deploynginx (recommended version 1.27.0) on the node1 node for load balancing.
Installation
1. Download Executable File
Scope: All nodes2. Modify Executable File Permissions
Scope: All nodesConfiguration
Configure WuKongIM
On node1, create configuration filewk.yaml with the following content:
wk.yaml with the following content:
wk.yaml with the following content:
Configure nginx
Create nginx configuration file with the following content:Remember to restart nginx for the configuration to take effect:
Start or Stop
Start WuKongIM on all nodes:Port Configuration
External Network Ports
| Port | Description |
|---|---|
| 15001 | HTTP API port (only open to internal LAN) |
| 15100 | TCP port, app clients need access |
| 15200 | WebSocket port, web IM clients need access |
| 15300 | Management system port |
| 15172 | Demo port, for demonstrating WuKongIM communication capabilities |
Internal Network Ports (nodes need to access each other)
| Port | Description |
|---|---|
| 5001 | HTTP API port (only open to internal LAN) |
| 5100 | TCP port, only needs internal network access in distributed setup |
| 5200 | WebSocket port, only needs internal network access in distributed setup |
| 5300 | Management system port |
Make sure to open the required ports in your firewall:
Verification
-
Access
http://119.45.229.172:15172/login, enter any username and password, after login you can chat, indicating successful deployment. -
Access
http://119.45.229.172:15300/webto enter the management system. The default built-in guest has read-only permissions. If you need operation permissions, please see Authorization Configuration.

