Documentation
¶
Overview ¶
Copyright 2022 Huawei Cloud Computing Technologies Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2022 Huawei Cloud Computing Technologies Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2022 Huawei Cloud Computing Technologies Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2022 Huawei Cloud Computing Technologies Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- func CombineDomain(domain, addr string) string
- func FormatSpdy(cfg *Spdy)
- func Parse(conf Config, path string) error
- type App
- type Castor
- type CertValidator
- type Common
- type Config
- type Coordinator
- type Gossip
- type Logger
- type Meta
- type Monitor
- type MonitorMain
- type MonitorQuery
- type MonitorReport
- type Spdy
- func (c *Spdy) ApplyEnvOverrides(_ func(string) string) error
- func (c *Spdy) GetOpenSessionTimeout() time.Duration
- func (c *Spdy) GetSessionSelectTimeout() time.Duration
- func (c *Spdy) GetTCPDialTimeout() time.Duration
- func (c *Spdy) NewClientTLSConfig() (*tls.Config, error)
- func (c *Spdy) NewTLSConfig() (*tls.Config, error)
- func (c Spdy) Validate() error
- type Store
- type TSMeta
- type TSMonitor
- type TSSql
- type TSStore
- type Validator
Constants ¶
const ( DefaultPoolSize int = 30 DefaultWaitTimeout int = 30 )
const ( Fit algorithmType = "fit" Predict algorithmType = "predict" Detect algorithmType = "detect" FitDetect algorithmType = "fit_detect" )
const ( // DefaultPath is default path for storing logs DefaultPath = "/opt/openGemini/logs/" // DefaultLevel is the level of logs will be emitted DefaultLevel = zap.InfoLevel // DefaultMaxSize is the max size of a log file DefaultMaxSize = 10 * 1024 * 1024 // 10MB // DefaultMaxNum is the max number of log files DefaultMaxNum = 30 // DefaultMaxAge is the max duration a log file can keep DefaultMaxAge = 7 // 7days // DefaultCompressEnabled is whether the log files are compressed DefaultCompressEnabled = false )
const ( DefaultLoggingEnabled = true DefaultRaftFileName = "raft" DefaultGossipFileName = "gossip" DefaultHTTPBindAddress = ":8091" DefaultRPCBindAddress = ":8092" DefaultRaftBindAddress = ":8088" DefaultCommitTimeout = 50 * time.Millisecond DefaultLeaderLeaseTimeout = 500 * time.Millisecond DefaultElectionTimeout = 1000 * time.Millisecond DefaultHeartbeatTimeout = 1000 * time.Millisecond DefaultLeaseDuration = 60 * time.Second DefaultConcurrentWriteLimit = 10 DefaultVersion = 0 DefaultSplitRowThreshold = 1000 DefaultImbalanceFactor = 0.3 DefaultRaftStore = "boltdb" DefaultHostname = "localhost" DefaultSuspicionMult = 4 DefaultProbInterval = toml.Duration(time.Second) )
const ( DefaultHistoryFile = "history.json" DefaultMonitorAddress = "127.0.0.1:8086" DefaultMonitorDatabase = "monitor" DefaultMonitorRP = "autogen" DefaultMonitorRPDuration = 7 * 24 * time.Hour // DefaultStoreEnabled is whether the system writes gathered information in // an InfluxDB system for historical analysis. DefaultStoreEnabled = false // DefaultStoreDatabase is the name of the database where gathered information is written. DefaultStoreDatabase = "_internal" // DefaultStoreInterval is the period between storing gathered information. DefaultStoreInterval = 10 * time.Second // DefaultHttpEndpoint is the address monitor write to DefaultHttpEndpoint = "127.0.0.1:8086" // MonitorRetentionPolicy Name of the retention policy used by the monitor service. MonitorRetentionPolicy = "autogen" // MonitorRetentionPolicyDuration Duration of the monitor retention policy. MonitorRetentionPolicyDuration = 7 * 24 * time.Hour // MonitorRetentionPolicyReplicaN Default replication factor to set on the monitor retention policy. MonitorRetentionPolicyReplicaN = 1 // HttpPusher Pushing monitoring metric data through HTTP HttpPusher = "http" // FilePusher Save the monitoring metric data to file FilePusher = "file" DefaultPushers = "" PusherSep = "|" )
const ( Second = toml.Duration(time.Second) MinRecvWindowSize = 2 MinConcurrentAcceptSession = 1024 MinOpenSessionTimeout = 60 * Second MinSessionSelectTimeout = 60 * Second MinTCPDialTimeout = Second MinConnPoolSize = 2 DefaultRecvWindowSize = 8 DefaultConcurrentAcceptSession = 4096 DefaultOpenSessionTimeout = 300 * Second DefaultSessionSelectTimeout = 300 * Second DefaultTCPDialTimeout = Second DefaultConnPoolSize = 4 )
const ( // DefaultWriteTimeout is the default timeout for a complete write to succeed. DefaultWriteTimeout = 10 * time.Second DefaultQueryTimeout = 0 // DefaultShardWriterTimeout is the default timeout set on shard writers. DefaultShardWriterTimeout = 10 * time.Second // DefaultShardMapperTimeout is the default timeout set on shard mappers. DefaultShardMapperTimeout = 10 * time.Second // DefaultMaxConcurrentQueries is the maximum number of running queries. // A value of zero will make the maximum query limit unlimited. DefaultMaxConcurrentQueries = 0 // DefaultMaxQueryMem is the is the maximum size a query cache can reach before it starts stopping a query. DefaultMaxQueryMem = 0 DefaultMetaExecutorWriteTimeout = 5 * time.Second DefaultQueryLimitIntervalTime = 10 DefaultQueryLimitLevel = 0 DefaultQueryLimitFlag = false DefaultShardTier = "warm" DefaultForceBroadcastQuery = false DefaultRetentionPolicyLimit = 100 )
const ( EngineType1 = "tssp1" EngineType2 = "tssp2" DefaultEngine = "tssp1" DefaultImmutableMaxMemoryPercent = 10 DefaultCompactFullWriteColdDuration = time.Duration(1 * time.Hour) KB = 1024 MB = 1024 * 1024 GB = 1024 * 1024 * 1024 // DefaultMaxConcurrentCompactions is the maximum number of concurrent full and level compactions // that can run at one time. A value of 0 results in 50% of runtime.GOMAXPROCS(0) used at runtime. DefaultMaxConcurrentCompactions = 0 DefaultWriteColdDuration = time.Duration(5 * time.Second) Is32BitPtr = (^uintptr(0) >> 32) == 0 DefaultSnapshotThroughput = 48 * MB DefaultSnapshotThroughputBurst = 64 * MB DefaultMaxWriteHangTime = 15 * time.Second DefaultWALSyncInterval = 100 * time.Millisecond )
Variables ¶
This section is empty.
Functions ¶
func CombineDomain ¶ added in v0.2.0
func FormatSpdy ¶
func FormatSpdy(cfg *Spdy)
Types ¶
type Castor ¶ added in v0.2.0
type Castor struct {
Enabled bool `toml:"enabled"`
PyWorkerAddr []string `toml:"pyworker-addr"`
ConnPoolSize int `toml:"connect-pool-size"`
ResultWaitTimeout int `toml:"result-wait-timeout"`
FitDetect algoConfig `toml:"fit_detect"`
Detect algoConfig `toml:"detect"`
Predict algoConfig `toml:"predict"`
Fit algoConfig `toml:"fit"`
}
func (*Castor) ApplyEnvOverrides ¶ added in v0.2.0
func (*Castor) CheckAlgoAndConfExistence ¶ added in v0.2.0
func (*Castor) GetWaitTimeout ¶ added in v0.2.0
type CertValidator ¶
type CertValidator struct {
// contains filtered or unexported fields
}
func NewCertValidator ¶
func NewCertValidator(certFile, keyFile string) *CertValidator
func (*CertValidator) Validate ¶
func (c *CertValidator) Validate() error
type Common ¶
type Common struct {
MetaJoin []string `toml:"meta-join"`
ClusterID string `toml:"cluster-id"`
CPUNum int `toml:"cpu-num"`
MemorySize itoml.Size `toml:"memory-size"`
MemoryLimitSize itoml.Size `toml:"executor-memory-size-limit"`
MemoryWaitTime itoml.Duration `toml:"executor-memory-wait-time"`
}
Common represents the CommonConfiguration format for the influxd binary.
func NewCommon ¶
func NewCommon() *Common
NewCommon builds a new CommonConfiguration with default values.
func (*Common) ApplyEnvOverrides ¶
ApplyEnvOverrides apply the environment CommonConfiguration on top of the CommonConfig.
func (*Common) GetLogging ¶
type Coordinator ¶
type Coordinator struct {
WriteTimeout toml.Duration `toml:"write-timeout"`
MaxConcurrentQueries int `toml:"max-concurrent-queries"`
QueryTimeout toml.Duration `toml:"query-timeout"`
LogQueriesAfter toml.Duration `toml:"log-queries-after"`
ShardWriterTimeout toml.Duration `toml:"shard-writer-timeout"`
ShardMapperTimeout toml.Duration `toml:"shard-mapper-timeout"`
// Maximum number of memory bytes to use from the query
MaxQueryMem toml.Size `toml:"max-query-mem"`
MetaExecutorWriteTimeout toml.Duration `toml:"meta-executor-write-timeout"`
QueryLimitIntervalTime int `toml:"query-limit-interval-time"`
QueryLimitLevel int `toml:"query-limit-level"`
RetentionPolicyLimit int `toml:"rp-limit"`
ShardTier string `toml:"shard-tier"`
QueryLimitFlag bool `toml:"query-limit-flag"`
QueryTimeCompareEnabled bool `toml:"query-time-compare-enabled"`
ForceBroadcastQuery bool `toml:"force-broadcast-query"`
}
Coordinator represents the configuration for the coordinator service.
func NewCoordinator ¶
func NewCoordinator() Coordinator
NewCoordinator returns an instance of Config with defaults.
func (Coordinator) Validate ¶
func (c Coordinator) Validate() error
Validate validates that the configuration is acceptable.
type Gossip ¶
type Gossip struct {
Enabled bool `toml:"enabled"`
LogEnabled bool `toml:"log-enabled"`
BindAddr string `toml:"bind-address"`
MetaBindPort int `toml:"meta-bind-port"`
StoreBindPort int `toml:"store-bind-port"`
ProbInterval toml.Duration `toml:"prob-interval"`
SuspicionMult int `toml:"suspicion-mult"`
Members []string `toml:"members"`
}
type Logger ¶
type Logger struct {
Format string `toml:"format"`
Level zapcore.Level `toml:"level"`
MaxSize toml.Size `toml:"max-size"`
MaxNum int `toml:"max-num"`
MaxAge int `toml:"max-age"`
CompressEnabled bool `toml:"compress-enabled"`
Path string `toml:"path"`
// contains filtered or unexported fields
}
func (*Logger) GetFileName ¶
type Meta ¶
type Meta struct {
HTTPSEnabled bool `toml:"https-enabled"`
PprofEnabled bool `toml:"pprof-enabled"`
RetentionAutoCreate bool `toml:"retention-autocreate"`
ClusterTracing bool `toml:"cluster-tracing"`
LoggingEnabled bool `toml:"logging-enabled"`
BatchApplyCh bool `toml:"batch-enabled"`
Domain string `toml:"domain"`
Dir string `toml:"dir"`
HTTPBindAddress string `toml:"http-bind-address"`
RPCBindAddress string `toml:"rpc-bind-address"`
BindAddress string `toml:"bind-address"`
HTTPSCertificate string `toml:"https-certificate"`
HTTPSPrivateKey string `toml:"https-private-key"`
MaxConcurrentWriteLimit int `toml:"-"`
Version int `toml:"meta-version"`
Hostname string `toml:"hostname"`
SplitRowThreshold uint64 `toml:"split-row-threshold"`
ImbalanceFactor float64 `toml:"imbalance-factor"`
RaftStore string `toml:"raft-store"`
RemoteHostname string
JoinPeers []string
ElectionTimeout toml.Duration `toml:"election-timeout"`
HeartbeatTimeout toml.Duration `toml:"heartbeat-timeout"`
LeaderLeaseTimeout toml.Duration `toml:"leader-lease-timeout"`
CommitTimeout toml.Duration `toml:"commit-timeout"`
LeaseDuration toml.Duration `toml:"lease-duration"`
Logging Logger `toml:"logging"`
}
Meta represents the meta configuration.
func (*Meta) CombineDomain ¶ added in v0.2.0
type Monitor ¶
type Monitor struct {
Pushers string `toml:"pushers"`
StoreEnabled bool `toml:"store-enabled"`
StoreDatabase string `toml:"store-database"`
StoreInterval toml.Duration `toml:"store-interval"`
StorePath string `toml:"store-path"`
Compress bool `toml:"compress"`
HttpsEnabled bool `toml:"https-enabled"`
HttpAuth []string `toml:"http-auth"`
HttpEndPoint string `toml:"http-endpoint"`
// contains filtered or unexported fields
}
Monitor represents the configuration for the monitor service.
func NewMonitor ¶
type MonitorMain ¶
type MonitorMain struct {
Host string `toml:"host"`
MetricPath string `toml:"metric-path"`
ErrLogPath string `toml:"error-log-path"`
Process string `toml:"process"`
DiskPath string `toml:"disk-path"`
AuxDiskPath string `toml:"aux-disk-path"`
History string `toml:"history-file"`
Compress bool `toml:"compress"`
}
type MonitorQuery ¶
type MonitorReport ¶
type Spdy ¶
type Spdy struct {
ByteBufferPoolDefaultSize uint64
RecvWindowSize int `toml:"recv-window-size"`
ConcurrentAcceptSession int `toml:"concurrent-accept-session"`
ConnPoolSize int `toml:"conn-pool-size"`
OpenSessionTimeout toml.Duration `toml:"open-session-timeout"`
SessionSelectTimeout toml.Duration `toml:"session-select-timeout"`
TCPDialTimeout toml.Duration `toml:"tcp-dial-timeout"`
DataAckTimeout toml.Duration `toml:"data-ack-timeout"`
TLSEnable bool `toml:"tls-enable"`
TLSClientAuth bool `toml:"tls-client-auth"`
TLSInsecureSkipVerify bool `toml:"tls-insecure-skip-verify"`
TLSCertificate string `toml:"tls-certificate"`
TLSPrivateKey string `toml:"tls-private-key"`
TLSClientCertificate string `toml:"tls-client-certificate"`
TLSClientPrivateKey string `toml:"tls-client-private-key"`
TLSCARoot string `toml:"tls-ca-root"`
TLSServerName string `toml:"tls-server-name"`
}
func (*Spdy) GetOpenSessionTimeout ¶
func (*Spdy) GetSessionSelectTimeout ¶
func (*Spdy) GetTCPDialTimeout ¶
type Store ¶
type Store struct {
IngesterAddress string `toml:"store-ingest-addr"`
SelectAddress string `toml:"store-select-addr"`
DataDir string `toml:"store-data-dir"`
Domain string `toml:"domain"`
WALDir string `toml:"store-wal-dir"`
MetaDir string `toml:"store-meta-dir"`
Engine string `toml:"engine-type"`
Index string `toml:"index-version"`
// The max inmem percent of immutable
ImmTableMaxMemoryPercentage int `toml:"imm-table-max-memory-percentage"`
// Compaction options for tssp1 (descriptions above with defaults)
CompactFullWriteColdDuration toml.Duration `toml:"compact-full-write-cold-duration"`
MaxConcurrentCompactions int `toml:"max-concurrent-compactions"`
MaxFullCompactions int `toml:"max-full-compactions"`
CompactThroughput toml.Size `toml:"compact-throughput"`
CompactThroughputBurst toml.Size `toml:"compact-throughput-burst"`
SnapshotThroughput toml.Size `toml:"snapshot-throughput"`
SnapshotThroughputBurst toml.Size `toml:"snapshot-throughput-burst"`
CompactionMethod int `toml:"compaction-method"` // 0:auto, 1: streaming, 2: non-streaming
// Configs for snapshot
WriteColdDuration toml.Duration `toml:"write-cold-duration"`
ShardMutableSizeLimit toml.Size `toml:"shard-mutable-size-limit"`
NodeMutableSizeLimit toml.Size `toml:"node-mutable-size-limit"`
MaxWriteHangTime toml.Duration `toml:"max-write-hang-time"`
WalSyncInterval toml.Duration `toml:"wal-sync-interval"`
WalEnabled bool `toml:"wal-enabled"`
WalReplayParallel bool `toml:"wal-replay-parallel"`
CacheDataBlock bool `toml:"cache-table-data-block"`
CacheMetaBlock bool `toml:"cache-table-meta-block"`
EnableMmapRead bool `toml:"enable-mmap-read"`
Readonly bool `toml:"readonly"`
CompactRecovery bool `toml:"compact-recovery"`
ReadCacheLimit int `toml:"read-cache-limit"`
WriteConcurrentLimit int `toml:"write-concurrent-limit"`
}
Store is the configuration for the engine.
func (*Store) InsertAddr ¶ added in v0.2.0
func (*Store) SelectAddr ¶ added in v0.2.0
func (Store) ValidateEngine ¶
type TSMeta ¶
type TSMeta struct {
Common Common `toml:"common"`
Meta *Meta `toml:"meta"`
Logging Logger `toml:"logging"`
Monitor Monitor `toml:"monitor"`
Gossip *Gossip `toml:"gossip"`
Spdy Spdy `toml:"spdy"`
// TLS provides configuration options for all https endpoints.
TLS tlsconfig.Config `toml:"tls"`
}
TSMeta represents the configuration format for the ts-meta binary.
func NewTSMeta ¶
func NewTSMeta() *TSMeta
NewTSMeta returns an instance of TSMeta with reasonable defaults.
func (*TSMeta) ApplyEnvOverrides ¶
ApplyEnvOverrides apply the environment configuration on top of the config.
func (*TSMeta) GetLogging ¶
type TSMonitor ¶
type TSMonitor struct {
MonitorConfig MonitorMain `toml:"monitor"`
QueryConfig MonitorQuery `toml:"query"`
ReportConfig MonitorReport `toml:"report"`
Logging Logger `toml:"logging"`
}
TSMonitor represents the configuration format for the ts-meta binary.
func NewTSMonitor ¶
func NewTSMonitor() *TSMonitor
NewTSMonitor returns an instance of Config with reasonable defaults.
func (*TSMonitor) ApplyEnvOverrides ¶
ApplyEnvOverrides apply the environment configuration on top of the config.
func (*TSMonitor) GetLogging ¶
type TSSql ¶
type TSSql struct {
Common *Common `toml:"common"`
Coordinator Coordinator `toml:"coordinator"`
Monitor Monitor `toml:"monitor"`
Logging Logger `toml:"logging"`
Spdy Spdy `toml:"spdy"`
HTTP httpdConfig.Config `toml:"http"`
// TLS provides configuration options for all https endpoints.
TLS tlsconfig.Config `toml:"tls"`
Analysis Castor `toml:"castor"`
}
TSSql represents the configuration format for the TSSql binary.
func NewTSSql ¶
func NewTSSql() *TSSql
NewTSSql returns an instance of Config with reasonable defaults.
func (*TSSql) ApplyEnvOverrides ¶
ApplyEnvOverrides apply the environment configuration on top of the config.
func (*TSSql) GetLogging ¶
type TSStore ¶
type TSStore struct {
Common *Common `toml:"common"`
Data Store `toml:"data"`
Coordinator Coordinator `toml:"coordinator"`
Monitor Monitor `toml:"monitor"`
Logging Logger `toml:"logging"`
Gossip *Gossip `toml:"gossip"`
Spdy Spdy `toml:"spdy"`
HTTPD httpdConf.Config `toml:"http"`
Retention retention.Config `toml:"retention"`
HierarchicalStore retention.Config `toml:"hierarchical-storage"`
// TLS provides configuration options for all https endpoints.
TLS tlsconfig.Config `toml:"tls"`
Analysis Castor `toml:"castor"`
}
TSStore represents the configuration format for the influxd binary.
func NewTSStore ¶
func NewTSStore() *TSStore
NewTSStore returns an instance of Config with reasonable defaults.
func (*TSStore) ApplyEnvOverrides ¶
ApplyEnvOverrides apply the environment configuration on top of the config.