|
@ -2,19 +2,21 @@ package command |
|
|
|
|
|
|
|
|
import ( |
|
|
import ( |
|
|
"fmt" |
|
|
"fmt" |
|
|
"golang.org/x/exp/slices" |
|
|
|
|
|
"net/http" |
|
|
"net/http" |
|
|
"os" |
|
|
"os" |
|
|
"path" |
|
|
"path" |
|
|
"strings" |
|
|
"strings" |
|
|
"time" |
|
|
"time" |
|
|
|
|
|
|
|
|
|
|
|
"golang.org/x/exp/slices" |
|
|
|
|
|
|
|
|
"github.com/gorilla/mux" |
|
|
"github.com/gorilla/mux" |
|
|
"github.com/seaweedfs/raft/protobuf" |
|
|
"github.com/seaweedfs/raft/protobuf" |
|
|
stats_collect "github.com/seaweedfs/seaweedfs/weed/stats" |
|
|
|
|
|
"github.com/spf13/viper" |
|
|
"github.com/spf13/viper" |
|
|
"google.golang.org/grpc/reflection" |
|
|
"google.golang.org/grpc/reflection" |
|
|
|
|
|
|
|
|
|
|
|
stats_collect "github.com/seaweedfs/seaweedfs/weed/stats" |
|
|
|
|
|
|
|
|
"github.com/seaweedfs/seaweedfs/weed/util/grace" |
|
|
"github.com/seaweedfs/seaweedfs/weed/util/grace" |
|
|
|
|
|
|
|
|
"github.com/seaweedfs/seaweedfs/weed/glog" |
|
|
"github.com/seaweedfs/seaweedfs/weed/glog" |
|
@ -179,6 +181,7 @@ func startMaster(masterOption MasterOptions, masterWhiteList []string) { |
|
|
} |
|
|
} |
|
|
ms.SetRaftServer(raftServer) |
|
|
ms.SetRaftServer(raftServer) |
|
|
r.HandleFunc("/cluster/status", raftServer.StatusHandler).Methods("GET") |
|
|
r.HandleFunc("/cluster/status", raftServer.StatusHandler).Methods("GET") |
|
|
|
|
|
r.HandleFunc("/cluster/healthz", raftServer.HealthzHandler).Methods("GET", "HEAD") |
|
|
if *m.raftHashicorp { |
|
|
if *m.raftHashicorp { |
|
|
r.HandleFunc("/raft/stats", raftServer.StatsRaftHandler).Methods("GET") |
|
|
r.HandleFunc("/raft/stats", raftServer.StatsRaftHandler).Methods("GET") |
|
|
} |
|
|
} |
|
|