adjust for metrics port

This commit is contained in:
Chris Lu
2020-09-24 10:21:23 -07:00
parent d2d3aec3e1
commit 4856bce0ee
7 changed files with 30 additions and 34 deletions

View File

@@ -13,6 +13,7 @@ import (
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
"github.com/chrislusf/seaweedfs/weed/security"
"github.com/chrislusf/seaweedfs/weed/server"
stats_collect "github.com/chrislusf/seaweedfs/weed/stats"
"github.com/chrislusf/seaweedfs/weed/util"
)
@@ -86,6 +87,8 @@ func runFiler(cmd *Command, args []string) bool {
util.LoadConfiguration("security", false)
go stats_collect.StartMetricsServer(*f.metricsHttpPort)
f.startFiler()
return true
@@ -124,7 +127,6 @@ func (fo *FilerOptions) startFiler() {
Port: uint32(*fo.port),
Cipher: *fo.cipher,
Filers: peers,
MetricsHttpPort: *fo.metricsHttpPort,
})
if nfs_err != nil {
glog.Fatalf("Filer startup error: %v", nfs_err)

View File

@@ -115,6 +115,8 @@ func runS3(cmd *Command, args []string) bool {
util.LoadConfiguration("security", false)
go stats_collect.StartMetricsServer(*s3StandaloneOptions.metricsHttpPort)
return s3StandaloneOptions.startS3Server()
}
@@ -155,8 +157,7 @@ func (s3opt *S3Options) startS3Server() bool {
}
}
go stats_collect.StartMetricsServer(stats_collect.S3Gather, *s3opt.metricsHttpPort)
go stats_collect.LoopPushingMetric("s3", stats_collect.SourceName(uint32(*s3opt.port)), stats_collect.S3Gather, metricsAddress, metricsIntervalSec)
go stats_collect.LoopPushingMetric("s3", stats_collect.SourceName(uint32(*s3opt.port)), metricsAddress, metricsIntervalSec)
router := mux.NewRouter().SkipClean(true)

View File

@@ -2,6 +2,7 @@ package command
import (
"fmt"
stats_collect "github.com/chrislusf/seaweedfs/weed/stats"
"os"
"runtime"
"runtime/pprof"
@@ -151,11 +152,6 @@ func runServer(cmd *Command, args []string) bool {
serverOptions.v.rack = serverRack
msgBrokerOptions.ip = serverIp
// metrics port
filerOptions.metricsHttpPort = serverMetricsHttpPort
serverOptions.v.metricsHttpPort = serverMetricsHttpPort
s3Options.metricsHttpPort = serverMetricsHttpPort
// serverOptions.v.pulseSeconds = pulseSeconds
// masterOptions.pulseSeconds = pulseSeconds
@@ -174,6 +170,7 @@ func runServer(cmd *Command, args []string) bool {
}
runtime.GOMAXPROCS(runtime.NumCPU())
go stats_collect.StartMetricsServer(*serverMetricsHttpPort)
folders := strings.Split(*volumeDataFolders, ",")

View File

@@ -25,6 +25,7 @@ import (
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/pb/volume_server_pb"
"github.com/chrislusf/seaweedfs/weed/server"
stats_collect "github.com/chrislusf/seaweedfs/weed/stats"
"github.com/chrislusf/seaweedfs/weed/storage"
"github.com/chrislusf/seaweedfs/weed/util"
)
@@ -111,6 +112,8 @@ func runVolume(cmd *Command, args []string) bool {
grace.SetupProfiling(*v.cpuProfile, *v.memProfile)
}
go stats_collect.StartMetricsServer(*v.metricsHttpPort)
v.startVolumeServer(*volumeFolders, *maxVolumeCounts, *volumeWhiteListOption, *minFreeSpacePercent)
return true
@@ -209,7 +212,6 @@ func (v VolumeServerOptions) startVolumeServer(volumeFolders, maxVolumeCounts, v
*v.fixJpgOrientation, *v.readRedirect,
*v.compactionMBPerSecond,
*v.fileSizeLimitMB,
*v.metricsHttpPort,
)
// starting grpc server
grpcS := v.startGrpcService(volumeServer)