This allows all config variable to be set via environment variables using
a similar naming convention for the toml config. For example, to change the
HTTP API port using the config, you would set:
[http]
bind-address = ":8086"
To change it with an environment variable, you would use:
HTTP_BIND_ADDRESS=":8086" influxd
The section name is used as the env variable prefix and the config key
name is the suffix. The only change to the config name is that "-" should
be replaced with "_" to avoid shell interpretation issues.
This makes it much easier to configure docker instances within a docker container
or adhoc instances at the command-line.
For slice config sections like graphite, you can currently only override the first
entry since the default config only has 1 entry. To do that use, GRAPHITE_0 as the
prefix. You cannot currently add new entries like GRAPHITE_1. A future PR might
address this issue.
The environment variable values should be the same as the config values.
The order that configuration values are applied is as follows:
* Default config
* Config file
* Environment variables
* Command-line arguments
Fixes#3246
When starting a influxd in a docker container, the processess needs to know
the hosts address and port in order to create its NodeInfo correctly. -hostname
previously only allowed us to change the hostname and the port would always be 8088
which may not be correctly if running multiple containers on the same host.
Hostnames were always being resolved to an IP address and the IP
address was used as the host address and raft peer address. There
was no way to use an actual hostname instead of an IP address.
There is a race when stopping servers where the meta.Store is closing
but the server has not signaled it is closing so the reporting goroutine
repeeatedly errors out in fast loop during this time. It creates a lot
of noise in the logs.
This adds some basic ability to join a node to an existing cluster. It
uses a rpc layer to initiate a join request to an existing memeber. The
response indicates whether the joining node should take part in the raft
cluster and who it's peers should be. If raft should not be started, the
peers are the addresses of the current raft members that it should delegate
consensus operations.
To keep the meta store implementation agnostic of whether it's running
a local raft or not, a consensusStrategy type was also added.
This adds some basic plumbing to make remote procedure calls to other cluster
members. This first implementation allows a node to contact the raft leader
and fetch a copy of the meta data. This will be used by non-raft members to
pull down the latest metadata.
With this change remote mapping no longer uses HTTP, as the HTTP ports
exposed by nodes on the cluster are not known cluster wide. The TCP
ports exposed by the cluster service are, so this change uses that
functionality. Each RemoteMapper has its own dedicated connection pool
for each node, and remote mapping TCP connections are in no way coupled
with query TCP connections.
The multiple checks for Mapper and Executor type -- the lack of DRYness
in this code -- meant the same checks would need to be copied. Therefore
this change, as well as fixing the bug, improves the situation a little
bit by *asking* the Mappers what type of Executor is required. This code
is still not ideal.
Fixes#3355.
With this change, the query engine code gathers information about
shards and tagsets by working with individual shards, collating the
information, and returning that to the client. It does not assume that any
particular shard is local, and accesses all shards through abstracted
Mappers, of which there are two types -- a Mapper type for Raw queries
and a second type for Aggregate queries. There are corresponding
Executors for each type of Mapper, but both types of Executors share the
same interface.
This commit adds a write ahead log to the shard. Entries are cached
in memory and periodically flushed back into the index. The WAL and
the cache are both partitioned into buckets so that flushing doesn't
stop the world as long.
Statements were only being normalized if a default database was included
in the query (usually via the query param 'db'). However if no default
database was included, and none was an explicit part of the measurement
name, no database-existence check was run. This result in a later panic
with wildcard expansion.