The invention discloses an
MQTT server failover method, architecture, equipment and medium, a master node and a slave node communicate through a virtual routing redundancy (VRRP) protocol, and the master node periodically sends a VRRP
heartbeat message to the slave node; when a host-level fault occurs and the slave node does not receive a VRRP
heartbeat message of the master node within a preset
timeout interval, the slave node takes over a
virtual IP address and is upgraded to a master role; when a service-level fault occurs, the detection program running on the main node detects that the specified service is abnormal, and the main node actively reduces the priority of the main node and cancels the
virtual IP address bound with the main node; and when detecting that the priority of the master node is lower than that of the slave node, the slave node immediately initiates election and becomes a new master node, and binds the
virtual IP address to complete fault switching. By detecting the host-level fault and the service-level fault respectively, compared with single-point deployment, when the
server fails, services can be continuously provided to the outside, and the continuity of services is ensured.