From bc8b3b94e075f31faecfb4b164130fc879cd3a4b Mon Sep 17 00:00:00 2001 From: Paul Dix Date: Wed, 11 Dec 2013 17:19:02 -0500 Subject: [PATCH] Move things around in the config file for clarity and add comments. --- config.toml.sample | 36 +++++++++++++++++++++--------- src/configuration/configuration.go | 9 +++++--- 2 files changed, 31 insertions(+), 14 deletions(-) diff --git a/config.toml.sample b/config.toml.sample index 81484e2051..b724369f48 100644 --- a/config.toml.sample +++ b/config.toml.sample @@ -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 diff --git a/src/configuration/configuration.go b/src/configuration/configuration.go index 6f606438b3..fa1f95fc9e 100644 --- a/src/configuration/configuration.go +++ b/src/configuration/configuration.go @@ -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