add MasterSelector to select master node
d
add thrift server and client