Disable Monitor when running dataonly mode
parent
b2d5616662
commit
2ae6a43c36
|
@ -248,6 +248,7 @@ func (s *Server) Open() error {
|
|||
go mux.Serve(ln)
|
||||
|
||||
// Append services.
|
||||
s.appendMonitorService()
|
||||
s.appendClusterService(s.config.Cluster)
|
||||
s.appendPrecreatorService(s.config.Precreator)
|
||||
s.appendSnapshotterService()
|
||||
|
@ -312,11 +313,6 @@ func (s *Server) Open() error {
|
|||
return fmt.Errorf("open points writer: %s", err)
|
||||
}
|
||||
|
||||
// Open the monitor service
|
||||
if err := s.Monitor.Open(); err != nil {
|
||||
return fmt.Errorf("open monitor: %v", err)
|
||||
}
|
||||
|
||||
for _, service := range s.Services {
|
||||
if err := service.Open(); err != nil {
|
||||
return fmt.Errorf("open service: %s", err)
|
||||
|
@ -346,10 +342,6 @@ func (s *Server) Close() error {
|
|||
service.Close()
|
||||
}
|
||||
|
||||
if s.Monitor != nil {
|
||||
s.Monitor.Close()
|
||||
}
|
||||
|
||||
if s.PointsWriter != nil {
|
||||
s.PointsWriter.Close()
|
||||
}
|
||||
|
|
|
@ -14,34 +14,14 @@ import (
|
|||
"github.com/influxdata/influxdb/services/udp"
|
||||
)
|
||||
|
||||
func (s *Server) appendRetentionPolicyService(c retention.Config) {
|
||||
}
|
||||
|
||||
func (s *Server) appendAdminService(c admin.Config) {
|
||||
}
|
||||
|
||||
func (s *Server) appendHTTPDService(c httpd.Config) {
|
||||
}
|
||||
|
||||
func (s *Server) appendCollectdService(c collectd.Config) {
|
||||
}
|
||||
|
||||
func (s *Server) appendOpenTSDBService(c opentsdb.Config) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *Server) appendGraphiteService(c graphite.Config) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *Server) appendPrecreatorService(c precreator.Config) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *Server) appendUDPService(c udp.Config) {
|
||||
}
|
||||
|
||||
func (s *Server) appendContinuousQueryService(c continuous_querier.Config) {
|
||||
}
|
||||
|
||||
func raftDBExists(dir string) error { return nil }
|
||||
func (s *Server) appendAdminService(c admin.Config) {}
|
||||
func (s *Server) appendCollectdService(c collectd.Config) {}
|
||||
func (s *Server) appendContinuousQueryService(c continuous_querier.Config) {}
|
||||
func (s *Server) appendGraphiteService(c graphite.Config) error { return nil }
|
||||
func (s *Server) appendMonitorService() {}
|
||||
func (s *Server) appendHTTPDService(c httpd.Config) {}
|
||||
func (s *Server) appendOpenTSDBService(c opentsdb.Config) error { return nil }
|
||||
func (s *Server) appendPrecreatorService(c precreator.Config) error { return nil }
|
||||
func (s *Server) appendRetentionPolicyService(c retention.Config) {}
|
||||
func (s *Server) appendUDPService(c udp.Config) {}
|
||||
func raftDBExists(dir string) error { return nil }
|
||||
|
|
|
@ -19,6 +19,10 @@ import (
|
|||
"github.com/influxdata/influxdb/services/udp"
|
||||
)
|
||||
|
||||
func (s *Server) appendMonitorService() {
|
||||
s.Services = append(s.Services, s.Monitor)
|
||||
}
|
||||
|
||||
func (s *Server) appendRetentionPolicyService(c retention.Config) {
|
||||
if !c.Enabled {
|
||||
return
|
||||
|
|
|
@ -112,7 +112,7 @@ func (m *Monitor) Open() error {
|
|||
}
|
||||
|
||||
// Close closes the monitor system.
|
||||
func (m *Monitor) Close() {
|
||||
func (m *Monitor) Close() error {
|
||||
m.Logger.Println("shutting down monitor system")
|
||||
m.mu.Lock()
|
||||
close(m.done)
|
||||
|
@ -128,6 +128,7 @@ func (m *Monitor) Close() {
|
|||
m.DeregisterDiagnosticsClient("runtime")
|
||||
m.DeregisterDiagnosticsClient("network")
|
||||
m.DeregisterDiagnosticsClient("system")
|
||||
return nil
|
||||
}
|
||||
|
||||
// SetLogOutput sets the writer to which all logs are written. It must not be
|
||||
|
|
Loading…
Reference in New Issue