Move things around in the config file for clarity and add comments.

pull/144/head
Paul Dix 2013-12-11 17:19:02 -05:00
parent a8aab8507b
commit bc8b3b94e0
2 changed files with 31 additions and 14 deletions

View File

@ -1,11 +1,4 @@
# A command separated list of servers to seed
# this server. this is only relevant when the
# server is joining a new cluster. Otherwise
# the server will use the list of known servers
# prior to shutting down
# seed-servers =
datadir = "/tmp/influxdb/development/db"
# Welcome to the InfluxDB configuration file.
[logging]
# logging level can be one of "debug", "info", "warn" or "error"
@ -23,9 +16,30 @@ assets = "./admin"
# Raft configuration
[raft]
# The raft port should be open between all servers in a cluster.
# However, this port shouldn't be accessible from the internet.
# port = 8090
# Where the raft logs are stored. The user running InfluxDB will need read/write access.
dir = "/tmp/influxdb/development/raft"
# Protobuf configuration
[protobuf]
port = 8099
[storage]
dir = "/tmp/influxdb/development/db"
[cluster]
# A comma separated list of servers to seed
# this server. this is only relevant when the
# server is joining a new cluster. Otherwise
# the server will use the list of known servers
# prior to shutting down. Any server can be pointed to
# as a seed. It will find the Raft leader automatically.
# Here's an example. Note that the port on the host is the same as the raft port.
# seed-servers = "hosta:8090,hostb:8090"
# Replication happens over a TCP connection with a Protobuf protocol.
# This port should be reachable between all servers in a cluster.
# However, this port shouldn't be accessible from the internet.
# protobuf_port = 8099

View File

@ -41,9 +41,9 @@ func parseTomlConfiguration(filename string) (*Configuration, error) {
apiHttpPort := configSet.Int("api.port", 8086)
raftPort := configSet.Int("raft.port", 8090)
raftDir := configSet.String("raft.dir", "/tmp/influxdb/development/raft")
seedServers := configSet.String("seed-servers", "")
dataDir := configSet.String("datadir", "/tmp/influxdb/development/db")
protobufPort := configSet.Int("protobuf.port", 8099)
seedServers := configSet.String("cluster.seed-servers", "")
dataDir := configSet.String("storage.dir", "/tmp/influxdb/development/db")
protobufPort := configSet.Int("cluster.protobuf_port", 8099)
logFile := configSet.String("logging.file", "influxdb.log")
logLevel := configSet.String("logging.level", "info")
@ -69,6 +69,9 @@ func parseTomlConfiguration(filename string) (*Configuration, error) {
if server == "" {
continue
}
if !strings.HasPrefix(server, "http://") {
server = "http://" + server
}
config.SeedServers = append(config.SeedServers, server)
}
return config, nil