mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
customizable debug port
This commit is contained in:
parent
10c11b9fd1
commit
6ba65c3382
|
@ -52,6 +52,7 @@ type FilerOptions struct {
|
||||||
defaultLevelDbDirectory *string
|
defaultLevelDbDirectory *string
|
||||||
concurrentUploadLimitMB *int
|
concurrentUploadLimitMB *int
|
||||||
debug *bool
|
debug *bool
|
||||||
|
debugPort *int
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
@ -75,7 +76,8 @@ func init() {
|
||||||
f.saveToFilerLimit = cmdFiler.Flag.Int("saveToFilerLimit", 0, "files smaller than this limit will be saved in filer store")
|
f.saveToFilerLimit = cmdFiler.Flag.Int("saveToFilerLimit", 0, "files smaller than this limit will be saved in filer store")
|
||||||
f.defaultLevelDbDirectory = cmdFiler.Flag.String("defaultStoreDir", ".", "if filer.toml is empty, use an embedded filer store in the directory")
|
f.defaultLevelDbDirectory = cmdFiler.Flag.String("defaultStoreDir", ".", "if filer.toml is empty, use an embedded filer store in the directory")
|
||||||
f.concurrentUploadLimitMB = cmdFiler.Flag.Int("concurrentUploadLimitMB", 128, "limit total concurrent upload size")
|
f.concurrentUploadLimitMB = cmdFiler.Flag.Int("concurrentUploadLimitMB", 128, "limit total concurrent upload size")
|
||||||
f.debug = cmdFiler.Flag.Bool("debug", false, "generate full goroutine stack dump http://localhost:6060/debug/pprof/goroutine?debug=2")
|
f.debug = cmdFiler.Flag.Bool("debug", false, "serves runtime profiling data, e.g., http://localhost:<debug.port>/debug/pprof/goroutine?debug=2")
|
||||||
|
f.debugPort = cmdFiler.Flag.Int("debug.port", 6060, "http port for debugging")
|
||||||
|
|
||||||
// start s3 on filer
|
// start s3 on filer
|
||||||
filerStartS3 = cmdFiler.Flag.Bool("s3", false, "whether to start S3 gateway")
|
filerStartS3 = cmdFiler.Flag.Bool("s3", false, "whether to start S3 gateway")
|
||||||
|
@ -126,7 +128,7 @@ var cmdFiler = &Command{
|
||||||
|
|
||||||
func runFiler(cmd *Command, args []string) bool {
|
func runFiler(cmd *Command, args []string) bool {
|
||||||
if *f.debug {
|
if *f.debug {
|
||||||
go http.ListenAndServe(":6060", nil)
|
go http.ListenAndServe(fmt.Sprintf(":%d", *f.debugPort), nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
util.LoadConfiguration("security", false)
|
util.LoadConfiguration("security", false)
|
||||||
|
|
|
@ -18,6 +18,7 @@ type ServerOptions struct {
|
||||||
cpuprofile *string
|
cpuprofile *string
|
||||||
memprofile *string
|
memprofile *string
|
||||||
debug *bool
|
debug *bool
|
||||||
|
debugPort *int
|
||||||
v VolumeServerOptions
|
v VolumeServerOptions
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,7 +81,8 @@ var (
|
||||||
func init() {
|
func init() {
|
||||||
serverOptions.cpuprofile = cmdServer.Flag.String("cpuprofile", "", "cpu profile output file")
|
serverOptions.cpuprofile = cmdServer.Flag.String("cpuprofile", "", "cpu profile output file")
|
||||||
serverOptions.memprofile = cmdServer.Flag.String("memprofile", "", "memory 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.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")
|
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 {
|
func runServer(cmd *Command, args []string) bool {
|
||||||
|
|
||||||
if *serverOptions.debug {
|
if *serverOptions.debug {
|
||||||
go http.ListenAndServe(":6060", nil)
|
go http.ListenAndServe(fmt.Sprintf(":%d", *serverOptions.debugPort), nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
util.LoadConfiguration("security", false)
|
util.LoadConfiguration("security", false)
|
||||||
|
|
Loading…
Reference in a new issue