Browse Source

add http debug interface

pull/279/head
tnextday 10 years ago
parent
commit
4d8f549123
  1. 3
      weed/topology/store_replicate.go
  2. 4
      weed/weedserver/master_server.go
  3. 4
      weed/weedserver/volume_server.go

3
weed/topology/store_replicate.go

@ -50,6 +50,9 @@ func ReplicatedWrite(masterNode string, s *storage.Store,
_, err := operation.Upload(u,
string(needle.Name), bytes.NewReader(needle.Data), needle.IsGzipped(), string(needle.Mime),
jwt)
if err != nil {
glog.V(0).Infof("write replication to %s err, %v", u, err)
}
return err == nil
}
if !distributedOperation(masterNode, s, volumeId, repWrite) {

4
weed/weedserver/master_server.go

@ -7,6 +7,8 @@ import (
"net/url"
"sync"
"net/http/pprof"
"github.com/chrislusf/raft"
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/security"
@ -80,6 +82,8 @@ func NewMasterServer(r *mux.Router, port int, metaFolder string,
r.HandleFunc("/{fileId}", ms.proxyToLeader(ms.redirectHandler))
r.HandleFunc("/stats/counter", ms.guard.WhiteList(statsCounterHandler))
r.HandleFunc("/stats/memory", ms.guard.WhiteList(statsMemoryHandler))
r.HandleFunc("/debug/pprof/", ms.guard.WhiteList(pprof.Index))
r.HandleFunc("/debug/pprof/{name}", ms.guard.WhiteList(pprof.Index))
ms.Topo.StartRefreshWritableVolumes()

4
weed/weedserver/volume_server.go

@ -5,6 +5,8 @@ import (
"net/http"
"time"
"net/http/pprof"
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/security"
"github.com/chrislusf/seaweedfs/weed/storage"
@ -64,6 +66,8 @@ func NewVolumeServer(adminMux, publicMux *http.ServeMux, ip string,
adminMux.HandleFunc("/stats/counter", vs.guard.WhiteList(statsCounterHandler))
adminMux.HandleFunc("/stats/memory", vs.guard.WhiteList(statsMemoryHandler))
adminMux.HandleFunc("/stats/disk", vs.guard.WhiteList(vs.statsDiskHandler))
adminMux.HandleFunc("/debug/pprof/", vs.guard.WhiteList(pprof.Index))
adminMux.HandleFunc("/debug/pprof/{name}", vs.guard.WhiteList(pprof.Index))
adminMux.HandleFunc("/delete", vs.guard.WhiteList(vs.batchDeleteHandler))
adminMux.HandleFunc("/", vs.privateStoreHandler)
if publicMux != adminMux {

Loading…
Cancel
Save