package run
import "github.com/influxdata/influxdb/cmd/influxd/run"
Package run is the run (default) subcommand for the influxd command.
Index ¶
- Constants
- type BuildInfo
- type Command
- func NewCommand() *Command
- func (cmd *Command) Close() error
- func (cmd *Command) ParseConfig(path string) (*Config, error)
- func (cmd *Command) ParseFlags(args ...string) (Options, error)
- func (cmd *Command) Run(args ...string) error
- type Config
- func NewConfig() *Config
- func NewDemoConfig() (*Config, error)
- func (c *Config) ApplyEnvOverrides(getenv func(string) string) error
- func (c *Config) Diagnostics() (*diagnostics.Diagnostics, error)
- func (c *Config) FromToml(input string) error
- func (c *Config) FromTomlFile(fpath string) error
- func (c *Config) Validate() error
- type Options
- type PrintConfigCommand
- func NewPrintConfigCommand() *PrintConfigCommand
- func (cmd *PrintConfigCommand) Run(args ...string) error
- type Server
- func NewServer(c *Config, buildInfo *BuildInfo) (*Server, error)
- func (s *Server) Close() error
- func (s *Server) Err() <-chan error
- func (s *Server) LogQueriesOnTermination() bool
- func (s *Server) Open() error
- func (s *Server) SetLogOutput(w io.Writer)
- func (s *Server) SetStartupMetrics(sp StartupProgress)
- func (s *Server) Statistics(tags map[string]string) []models.Statistic
- type Service
- type StartupProgress
- type StartupProgressLogger
Constants ¶
const ( // DefaultBindAddress is the default address for various RPC services. DefaultBindAddress = "127.0.0.1:8088" )
Types ¶
type BuildInfo ¶
BuildInfo represents the build details for the server code.
type Command ¶
type Command struct { Version string Branch string Commit string BuildTime string Closed chan struct{} Stdin io.Reader Stdout io.Writer Stderr io.Writer Logger *zap.Logger Server *Server // How to get environment variables. Normally set to os.Getenv, except for tests. Getenv func(string) string // contains filtered or unexported fields }
Command represents the command executed by "influxd run".
func NewCommand ¶
func NewCommand() *Command
NewCommand return a new instance of Command.
func (*Command) Close ¶
Close shuts down the server.
func (*Command) ParseConfig ¶
ParseConfig parses the config at path. It returns a demo configuration if path is blank.
func (*Command) ParseFlags ¶
ParseFlags parses the command line flags from args and returns an options set.
func (*Command) Run ¶
Run parses the config from args and runs the server.
type Config ¶
type Config struct { Meta *meta.Config `toml:"meta"` Data tsdb.Config `toml:"data"` Coordinator coordinator.Config `toml:"coordinator"` FluxController control.Config `toml:"flux-controller"` Retention retention.Config `toml:"retention"` Precreator precreator.Config `toml:"shard-precreation"` Monitor monitor.Config `toml:"monitor"` Subscriber subscriber.Config `toml:"subscriber"` HTTPD httpd.Config `toml:"http"` Logging logger.Config `toml:"logging"` GraphiteInputs []graphite.Config `toml:"graphite"` CollectdInputs []collectd.Config `toml:"collectd"` OpenTSDBInputs []opentsdb.Config `toml:"opentsdb"` UDPInputs []udp.Config `toml:"udp"` ContinuousQuery continuous_querier.Config `toml:"continuous_queries"` // Server reporting ReportingDisabled bool `toml:"reporting-disabled"` // BindAddress is the address that all TCP services use (Raft, Snapshot, Cluster, etc.) BindAddress string `toml:"bind-address"` // TLS provides configuration options for all https endpoints. TLS tlsconfig.Config `toml:"tls"` }
Config represents the configuration format for the influxd binary.
func NewConfig ¶
func NewConfig() *Config
NewConfig returns an instance of Config with reasonable defaults.
func NewDemoConfig ¶
NewDemoConfig returns the config that runs when no config is specified.
func (*Config) ApplyEnvOverrides ¶
ApplyEnvOverrides apply the environment configuration on top of the config.
func (*Config) Diagnostics ¶
func (c *Config) Diagnostics() (*diagnostics.Diagnostics, error)
Diagnostics returns a diagnostics representation of Config.
func (*Config) FromToml ¶
FromToml loads the config from TOML.
func (*Config) FromTomlFile ¶
FromTomlFile loads the config from a TOML file.
func (*Config) Validate ¶
Validate returns an error if the config is invalid.
type Options ¶
Options represents the command line options that can be parsed.
func (*Options) GetConfigPath ¶
GetConfigPath returns the config path from the options. It will return a path by searching in this order:
- The CLI option in ConfigPath
- The environment variable INFLUXDB_CONFIG_PATH
- The first influxdb.conf file on the path: - ~/.influxdb - /etc/influxdb
type PrintConfigCommand ¶
PrintConfigCommand represents the command executed by "influxd config".
func NewPrintConfigCommand ¶
func NewPrintConfigCommand() *PrintConfigCommand
NewPrintConfigCommand return a new instance of PrintConfigCommand.
func (*PrintConfigCommand) Run ¶
func (cmd *PrintConfigCommand) Run(args ...string) error
Run parses and prints the current config loaded.
type Server ¶
type Server struct { BindAddress string Listener net.Listener Logger *zap.Logger MuxLogger *log.Logger MetaClient *meta.Client TSDBStore *tsdb.Store QueryExecutor *query.Executor PointsWriter *coordinator.PointsWriter Subscriber *subscriber.Service Services []Service Prometheus *prometheus.Registry // These references are required for the tcp muxer. SnapshotterService *snapshotter.Service Monitor *monitor.Monitor StartupProgressMetrics StartupProgress // Profiling CPUProfile string CPUProfileWriteCloser io.WriteCloser MemProfile string MemProfileWriteCloser io.WriteCloser // contains filtered or unexported fields }
Server represents a container for the metadata and storage data and services. It is built using a Config and it manages the startup and shutdown of all services in the proper order.
func NewServer ¶
NewServer returns a new instance of Server built from a config.
func (*Server) Close ¶
Close shuts down the meta and data stores and all services.
func (*Server) Err ¶
Err returns an error channel that multiplexes all out of band errors received from all services.
func (*Server) LogQueriesOnTermination ¶
func (*Server) Open ¶
Open opens the meta and data store and all services.
func (*Server) SetLogOutput ¶
SetLogOutput sets the logger used for all messages. It must not be called after the Open method has been called.
func (*Server) SetStartupMetrics ¶
func (s *Server) SetStartupMetrics(sp StartupProgress)
func (*Server) Statistics ¶
Statistics returns statistics for the services running in the Server.
type Service ¶
Service represents a service attached to the server.
type StartupProgress ¶
type StartupProgress interface { AddShard() CompletedShard() }
type StartupProgressLogger ¶
type StartupProgressLogger struct {
// contains filtered or unexported fields
}
func NewStartupProgressLogger ¶
func NewStartupProgressLogger(logger *zap.Logger) *StartupProgressLogger
func (*StartupProgressLogger) AddShard ¶
func (s *StartupProgressLogger) AddShard()
func (*StartupProgressLogger) CompletedShard ¶
func (s *StartupProgressLogger) CompletedShard()
Source Files ¶
command.go config.go config_command.go server.go startup_logger.go
- Version
- v1.12.0 (latest)
- Published
- Apr 8, 2025
- Platform
- linux/amd64
- Imports
- 58 packages
- Last checked
- 2 days ago –
Tools for package owners.