The application discloses an inter-node communication method and an electronic device, relates to the technical field of inter-node communication, and comprises the following steps: when a first node is initialized, a first completion
queue group and a first
queue pair group are created to form a first
resource pool, and a first
memory pool is applied as a unified
storage area; when the first node joins a cluster, a node announcement message is sent to other nodes in the cluster; in response to the first node receiving a communication task pointing to a second node, a first
queue pair is selected from available queue pairs, and a first memory area is divided from the first
memory pool; the second queue pair number and the second remote
access key of the second node are obtained from a preset
connection table; and based on the first queue pair and the first memory area, a
remote memory direct access operation is initiated to access the opposite end identified by the second queue pair number with the second remote
access key, thereby solving the technical problem of long inter-node communication
delay in the prior art, and improving the efficiency and reliability of inter-node communication.