aboutsummaryrefslogtreecommitdiff
path: root/weed/command/server.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-07-31 09:18:41 -0700
committerChris Lu <chris.lu@gmail.com>2021-07-31 09:18:41 -0700
commit6ba65c3382d8e6e73bfa5312ed9c04c5b17aece5 (patch)
treebcd4f992ff5a831b104bac2c93d79b7c91fc9e10 /weed/command/server.go
parent10c11b9fd11ca67e4b9cecdafa472f3d5f6a2175 (diff)
downloadseaweedfs-6ba65c3382d8e6e73bfa5312ed9c04c5b17aece5.tar.xz
seaweedfs-6ba65c3382d8e6e73bfa5312ed9c04c5b17aece5.zip
customizable debug port
Diffstat (limited to 'weed/command/server.go')
-rw-r--r--weed/command/server.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/weed/command/server.go b/weed/command/server.go
index 19fe8607b..9bac2be97 100644
--- a/weed/command/server.go
+++ b/weed/command/server.go
@@ -18,6 +18,7 @@ type ServerOptions struct {
cpuprofile *string
memprofile *string
debug *bool
+ debugPort *int
v VolumeServerOptions
}
@@ -80,7 +81,8 @@ var (
func init() {
serverOptions.cpuprofile = cmdServer.Flag.String("cpuprofile", "", "cpu profile output file")
serverOptions.memprofile = cmdServer.Flag.String("memprofile", "", "memory profile output file")
- serverOptions.debug = cmdServer.Flag.Bool("debug", false, "generate full goroutine stack dump http://localhost:6060/debug/pprof/goroutine?debug=2")
+ serverOptions.debug = cmdServer.Flag.Bool("debug", false, "serves runtime profiling data, e.g., http://localhost:6060/debug/pprof/goroutine?debug=2")
+ serverOptions.debugPort = cmdServer.Flag.Int("debug.port", 6060, "http port for debugging")
masterOptions.port = cmdServer.Flag.Int("master.port", 9333, "master server http listen port")
masterOptions.metaFolder = cmdServer.Flag.String("master.dir", "", "data directory to store meta data, default to same as -dir specified")
@@ -143,7 +145,7 @@ func init() {
func runServer(cmd *Command, args []string) bool {
if *serverOptions.debug {
- go http.ListenAndServe(":6060", nil)
+ go http.ListenAndServe(fmt.Sprintf(":%d", *serverOptions.debugPort), nil)
}
util.LoadConfiguration("security", false)