In recent years, with the continuous development of network and information technology, the distributed system has replaced the centralized architecture and become the focus of researchers. Consistency is a basic and complex problem in the implementation of distributed systems. This paper mainly studies the state consistency algorithm of peer-to-peer distributed system based on DM(DM). This paper first summarizes the types of DM algorithms. In order to achieve high throughput, low latency and high availability at the same time as possible, this paper designs a VC algorithm for state machine replication, and this paper makes a quantifiable performance analysis of the consensus protocol from the four aspects of cluster fault tolerance, communication cost and election cost.