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 the 2n+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.
On node1, create configuration file wk.yaml with the following content:
mode: "release"external: # Public network configuration ip: "119.45.229.172" # Node external IP, IP address that clients can access tcpAddr: "119.45.229.172:15100" # Long connection address for app access, note this is the load balancer server's IP and port, not local wsAddr: "ws://119.45.229.172:15200" # Long connection address for web access, note this is the load balancer server's IP and port, not localcluster: nodeId: 1001 # Node ID apiUrl: "http://10.206.0.13:5001" # Current node's internal API address serverAddr: "10.206.0.13:11110" # Current node's internal distributed communication address initNodes: - "1001@10.206.0.13:11110" - "1002@10.206.0.14:11110" - "1003@10.206.0.8:11110"
On node2, create configuration file wk.yaml with the following content:
mode: "release"external: # Public network configuration ip: "129.211.213.76" # Node external IP, IP address that clients can access tcpAddr: "119.45.229.172:15100" # Long connection address for app access, note this is the load balancer server's IP and port, not local wsAddr: "ws://119.45.229.172:15200" # Long connection address for web access, note this is the load balancer server's IP and port, not localcluster: nodeId: 1002 # Node ID apiUrl: "http://10.206.0.14:5001" # Current node's internal API address serverAddr: "10.206.0.14:11110" # Current node's internal distributed communication address initNodes: - "1001@10.206.0.13:11110" - "1002@10.206.0.14:11110" - "1003@10.206.0.8:11110"
On node3, create configuration file wk.yaml with the following content:
mode: "release"external: # Public network configuration ip: "1.13.191.138" # Node external IP, IP address that clients can access tcpAddr: "119.45.229.172:15100" # Long connection address for app access, note this is the load balancer server's IP and port, not local wsAddr: "ws://119.45.229.172:15200" # Long connection address for web access, note this is the load balancer server's IP and port, not localcluster: nodeId: 1003 # Node ID apiUrl: "http://10.206.0.8:5001" # Current node's internal API address serverAddr: "10.206.0.8:11110" # Current node's internal distributed communication address initNodes: - "1001@10.206.0.13:11110" - "1002@10.206.0.14:11110" - "1003@10.206.0.8:11110"
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/web to enter the management system. The default built-in guest has read-only permissions. If you need operation permissions, please see Authorization Configuration.