In the era of cloud,network equipment of the data center can not be controled by a controller.It's necessary for supportting the mode of cluster to control and extend.It's necessary for updating and deploying the business simply and rapidly.Synchronization and application's problem of public resource needs to be solved in the ODL cluster.In order to solve the problem,a method of high performance distributed lock based on ETCD distributed consistency storage service is proposed in this paper.The main research and work of this paper are as follows:(1)A distributed locking solution based on ETCD distributed conformance storage service is proposed.ETCD is a high availability key/value storage service that is used in distributed environments.There is no performance bottleneck similar to Zookeeper,and it is easy to implement distributed locks with the features of ETCD.(2)In order to improve the performance of the distributed lock,analyze the disadvantages of ETCD Java client and improve these disadvantages firstly.It's used to improve the communication efficiency between the client and the server by the GRPC protocol.In the key management,the lease method are used to replace the original TTL implementation.New client increase session management and retrying mechanism,enhanced client has a higher efficiency and communication guarantee than the original pure JSON client.(3)A distributed mutex lock,distributed read and write lock are implemented in this paper.A variety of locks's API provide more choices for the upper business,and distributed read lock can be multi-entry.There are optimization in the locking process to avoid the herd effect.In addition,the reliability,maintainability and safety performance of distributed locks have been designed,and all kinds of abnormal scenes such as lock reentry,deadlock,communication link failure and server fault are fully considered.Finally,the system tests,including function performance and reliability testing,tests show that the distributed lock function based on ETCD distributed conformance storage service is normal' and the enhanced client has a good performance.When the deadlock situation occurs,the system can provide a very good prevention and crack.The test shows that the distributed locking method proposed in this paper can meet the anticipative needs. |