raft change from http to grpc

master grpc port is fixed to http port + 10000
This commit is contained in:
Chris Lu
2019-02-18 22:38:14 -08:00
parent 448645203a
commit 07af52cb6f
6 changed files with 65 additions and 87 deletions

View File

@@ -1,21 +0,0 @@
package weed_server
import (
"github.com/chrislusf/seaweedfs/weed/operation"
"net/http"
)
func (s *RaftServer) HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request)) {
s.router.HandleFunc(pattern, handler)
}
func (s *RaftServer) statusHandler(w http.ResponseWriter, r *http.Request) {
ret := operation.ClusterStatusResult{
IsLeader: s.topo.IsLeader(),
Peers: s.Peers(),
}
if leader, e := s.topo.Leader(); e == nil {
ret.Leader = leader
}
writeJsonQuiet(w, r, http.StatusOK, ret)
}