optimize the code
add the test class
format the class
repair the logic of rigisting the agent master
repari the logic of checking the local mysql
add some log
repair the logic of Finding mysql master